Skip to main content
Anders  Albert
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
January 6, 2022
Parked

Cognite Data Fusion: Idempotent/Upsert CogniteClient

Related products:REST API
  • January 6, 2022
  • 2 replies
  • 63 views

I would like to have an option for an idempotent option for the Cognite Client. For example, I can add the same asset multiple times without rising an exception.

Use Case: I have a script (running on a schedule in Cognite Functon) which dynamically create an asset hierarchy. 

Current behavior: If I try to add a list of assets in which one asset is existing in CDF, then no new assets are appended to the hierarchy and an exception is raised.

Desired behavior: An option for suppressing the raised exception and add the new assets to the asset hierarchy.

``client.assets.create(new_assets, skip_existing=True)``

2 replies

Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Head of Community
January 13, 2022
Updated idea statusNewGathering Interest
Anita Hæhre
Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Head of Community
August 22, 2022
Gathering InterestParked
Anita Hæhre