Skip to main content
Question

How cdf toolkit resolve dependencies between views ?

  • March 26, 2025
  • 1 reply
  • 9 views

Hello, 

We are using cdf toolkit to deploy our container, views and data models.

We recently added many new views, these views are dependent. i.e: they reference each other in the properties through a source block or via implements block. Here an examples of these view dependencies:

- externalId: View1
  implements: []
  name: View1
  properties:
    test:
      container:
        externalId: Container1
        space: some_space
        type: container
      containerPropertyIdentifier: Test
      name: test
      source:
        externalId: View2
        space: some_space
        type: view
        version: v1
  space: some_space
  version: v1

- externalId: View2
  implements: []
  name: View2
  properties:
    wow:
      container:
        externalId: Container2
        space: some_space
        type: container
      containerPropertyIdentifier: Test
      name: wow
  space: some_space
  version: v1

or 

- externalId: Country
  implements:
    - externalId: CountryAttributes
      space: '{{sp_dm_dap_knowledge_graph}}_wv'
      type: view
      version: '{{dap_version}}'
  name: Country
  properties:
    Wells:
      connectionType: multi_reverse_direct_relation
      name: Wells
      source:
        externalId: Well
        space: '{{sp_dm_dap_knowledge_graph}}_wv'
        type: view
        version: '{{dap_version}}'
      through:
        identifier: Country
        source:
          externalId: Well
          space: '{{sp_dm_dap_knowledge_graph}}_wv'
          type: view
          version: '{{dap_version}}'
  space: '{{sp_dm_dap_knowledge_graph}}_wv'
  version: '{{dap_version}}'

- externalId: CountryAttributes
  implements: []
  name: CountryAttributes
  properties:
    CountryName:
      container:
        externalId: Country
        space: '{{sp_dm_dap_knowledge_graph}}'
        type: container
      containerPropertyIdentifier: CountryName
      name: CountryName
    RegionalEntity:
      container:
        externalId: Country
        space: '{{sp_dm_dap_knowledge_graph}}'
        type: container
      containerPropertyIdentifier: RegionalEntity
      name: RegionalEntity
  space: '{{sp_dm_dap_knowledge_graph}}_wv'
  version: '{{dap_version}}'


We have these errors: 

 

ERROR (ResourceCreationError): Failed to create resource(s). Error: Cannot upsert view 'sp_dm_dap_knowledge_graph_wv:Country/0.0.28'. Implemented view 'sp_dm_dap_knowledge_graph_wv:CountryAttributes/0.0.28' does not exist. | code: 400 | X-Request-ID: 027470c1-3679-9e04-a540-68ab60d31be8 | cluster: westeurope-1
The API Failed to process some items.
Successful (2xx): []
Unknown (5xx): []
Failed (4xx):

 

IMHO, this is issue in CDF toolkit dependencies resolutions. How CDF toolkit does this? How to avoid this errors? 

 

Thank you 

Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img

Just so I understand you correctly, you are trying to deploy multiple views which have interdependencies with CogniteToolkit? 

 

Some context here. There is a bug in the API that is on process of being fixed. CogniteToolkit has implemented a workaround from version 0.4.11, that does some analysis of the view dependencies and deploys them sequentially. Thus if you are on an earlier version than 0.4.11, I suggest you upgrade. 


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings