Skip to main content
Parked

Cognite Data Fusion: Idempotent/Upsert CogniteClient

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

Anders  Albert
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img

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 ⭐️⭐️⭐️⭐️
Forum|alt.badge.img+3
  • Head of Community
  • January 13, 2022
Updated idea statusNewGathering Interest

Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img+3
  • Head of Community
  • August 22, 2022
Gathering InterestParked