Skip to main content
Solved

Cognite python SDK

  • 7 January 2023
  • 1 reply
  • 65 views

Forum|alt.badge.img+2

While trying to setup the Google - colab for CDF environment and authentication, i am getting an error. Unable to trace the rootcause of this error.  This code is a part of Notebook setup given in the Hands-On course

 

Link to notebook - Data processing and analysis for IDA course.ipynb - Colaboratory (google.com)

 

TypeError                                 Traceback (most recent call last)Cell In [2], line 57     55 def get_token():     56   return authenticate_device_code(app)['access_token']---> 57 client = CogniteClient(     58 ##  token_url=f'{AUTHORITY_URI}/v2.0',     59   token=get_token,     60   token_client_id=CLIENT_ID,     61   project=COGNITE_PROJECT,     62   base_url=f'https://{CDF_CLUSTER}.cognitedata.com',     63   client_name='cognite-python-dev',     64 )     65 print(client.iam.token.inspect())TypeError: __init__() got an unexpected keyword argument 'token'

Best answer by Mithila Jayalath

Hi Eashwar,

I checked your code and saw that you are using an outdated code to authenticate to the Cognite Client. Can you please check the code here and re-use it accordingly in order to authenticate?
 
For more information, please refer to the latest python SDK documentation here.

I hope the above code will slove your issue.

View original
Did this topic help you find an answer to your question?

1 reply

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 283 replies
  • Answer
  • January 7, 2023

Hi Eashwar,

I checked your code and saw that you are using an outdated code to authenticate to the Cognite Client. Can you please check the code here and re-use it accordingly in order to authenticate?
 
For more information, please refer to the latest python SDK documentation here.

I hope the above code will slove your issue.


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