Skip to main content
Answer

SDK: extraction pipeline update method is not working as expected

  • February 7, 2024
  • 9 replies
  • 176 views

I’m trying to use Update extraction pipelines method to update my extraction pipelines created. Here are some issues i face:

1. I’m unable to update contacts for an extraction pipeline, it throws the below error:
code - 

contact_info = [ExtractionPipelineContact(name="sangs", email="sm6@slb.com", role = "MAINTAINER", send_notification=True)]
to_update = ExtractionPipelineUpdate(external_id="<PIPELINE-EXT-ID-2>")
to_update.contacts.set(contact_info)
client.extraction_pipelines.update(to_update)

error - 

“CogniteAPIError: Unexpected field - items[0].update.contacts.set[0].send_notification - did you mean sendNotification? | code: 400 | X-Request-ID: 918d1113-6a5e-9d38-b850-61e3dc54c220 The API Failed to process some items. Successful (2xx): [] Unknown (5xx): [] Failed (4xx): [<PIPELINE-EXT-ID-2>, ...]”


2. I’m unable to set the specified fields to None using sdk : description, source, schedule,documentation, name and dataset-id. Im able to set only metadata and raw-tables to None. Wondering why some are supported and some arent. is this the expected behaviour? below is the error i face when i make specified fields to None:
code- 

to_update = ExtractionPipelineUpdate(external_id="<PIPELINE-EXT-ID-2>")
to_update.documentation.set(None)
client.extraction_pipelines.update(to_update)

error - 
“CogniteAPIError: Unexpected field - items[0].update.documentation.setNull - did you mean set? | code: 400 | X-Request-ID: 40485149-0d37-9f02-bed5-7d9dc32192d3 The API Failed to process some items. Successful (2xx): [] Unknown (5xx): [] Failed (4xx): [<PIPELINE-EXT-ID-2>, ...]”

 

3. i see “notificationConfig” is not supported in sdk yet. When can we expect it’s support?

Best answer by Jason Dressel

@Sangavi M Please try upgrading to the latest Cognite Python SDK.  I understand there was a bug.

The following code snippet works for me with v7.22:
 

update = ExtractionPipelineUpdate(external_id="csv:oee:datapoints")
update.contacts.set([ExtractionPipelineContact("jason", "jason.dressel@cognite.com", "sa", False)])
update.description.set("")
res = client.extraction_pipelines.update(update)
res

-Jason

9 replies

  • Author
  • Seasoned
  • February 7, 2024

@Snehal Jagtap 


Pasindu Perera
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • February 7, 2024

Hi @Sangavi M 

I was able to recreate the issue. I will check and get back to you with an update.

 

Thanks and regards,
Pasindu Perera


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • February 8, 2024

Hi @Sangavi M,

I have created a support ticket for this issue. The team will follow up and update you. 


Forum|alt.badge.img
  • Seasoned Practitioner
  • Answer
  • February 22, 2024

@Sangavi M Please try upgrading to the latest Cognite Python SDK.  I understand there was a bug.

The following code snippet works for me with v7.22:
 

update = ExtractionPipelineUpdate(external_id="csv:oee:datapoints")
update.contacts.set([ExtractionPipelineContact("jason", "jason.dressel@cognite.com", "sa", False)])
update.description.set("")
res = client.extraction_pipelines.update(update)
res

-Jason


  • Author
  • Seasoned
  • February 25, 2024

Hi Jason!

The update contacts part works now! Thank you. I’m still facing issue with updating documentation,source, etc fields to None 


Forum|alt.badge.img
  • Seasoned Practitioner
  • February 26, 2024

@Sangavi M , I set to an empty string (“”)

-Jason


  • Author
  • Seasoned
  • February 27, 2024

Hi @Jason Dressel !

setting to an empty string works for description,source and documentation but doesnt work for schedule:

CogniteAPIError: Request had constraint violation. Please fix the request and try again. [update.request.items[0].update.schedule.set: Possible values: “On trigger”, “Continuous” or cron expression. If empty then null. ] | code: 400 | X-Request-ID: 351a260a-f369-9670-bbaa-d6ed3bafdb8c


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • August 30, 2024

Hi @Sangavi M,

Did you manage to resolve this issue? 


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img+8

@Sangavi M are you still observing this issue?