Skip to main content
Maritsa Sarri
Expert ⭐️⭐️⭐️⭐️
Cognite Academy Instructor
March 25, 2022

Data Engineer Basics - Integrations

  • March 25, 2022
  • 59 replies
  • 1488 views

Welcome to the Data Engineer Basics - Integrations!

This discussion is dedicated to help learners of the Data Engineer Basics – Integrations learning path succeed. If you’re struggling any of the courses in this learning path, post a comment with the challenge you’re facing. You can also post your own tips and respond to fellow learners’ questions. Cognite Academy’s instructors are also here to help.

59 replies

August 25, 2022

Hi @ikequarsh 

Cogex is a command line tool that you get when you pip install cognite-extractor-manager
Hence CogEx short for Cognite Extractor. 

It should be the same way of setting it up.

Cogex init, prefills a directory with files, and makes virtual environment, and installs into the virtual enviroment the python modules specific to the extractors base project. and you just activate / set up the python interpreter inside your IDE to the virtual environment created  by poetry (“your-extractor-directory”/venv/bin/python ), that was ran when you ran cogex init. but it would be the same way if you manually setup a virtual environment and added the files and ran pip install requirement.txt as when you work on previous python project templates / boilerplates / forks before more and more python projects went over to poetry for the dependency and virtual environment manager. but now the python modules / libraries are in pyproject.toml file instead of being pip freezed into requirements.txt

As they say in the course video on “importing the new extractor project” you don’t have to use Pycharm for the extractor projects, but you use any IDE/text editor you want for this project. just set up your environment. I personally would use VS code and Windows Subsystem for Linux (WSL), but that is my preference. Sometimes working with virtual environments in windows can be a hassle, but that is where poetry comes in and try to help us.

Are you familiar with working with virtual environment in Python? 

Hope we get one step closer to solving your issue Isaac :)

Active ⭐️⭐️⭐️
December 1, 2022

Hello. I am going through the hands on excercise on the ‘Learn to Use the Cognite Python SDK’ Learning.

As i am trying to do the hands on excersice, i authenticated succesfuylly (Image 1)

 

and when i try to create my dataset (Image 2) wherre everything will be derived from as instructed, i get the following error:

I double checked the ‘answers’ notebook to make sure i wasnt doing anything out of the ordinary and it doesnt seem like it. Is there some permissions needed to do this besides signing up to the course?

Cognite Academy Instructor
December 2, 2022

Hi Miguel, 

Thanks for posting you question here.
Please can add the snapshot of the error/problem and then it will be easy for us to track down the problem.

Waiting for your reply.

Regards 
Kumar

 

Rahul Kumar
Active ⭐️⭐️⭐️
December 2, 2022

Hi Miguel, 

Thanks for posting you question here.
Please can add the snapshot of the error/problem and then it will be easy for us to track down the problem.

Waiting for your reply.

Regards 
Kumar

 

Hello Rahul!
I did add the error there. it reads ‘

CogniteAPIError: Resource not found. This may also be due to insufficient access rights. | code: 403 | X-Request-ID: 64e60cff-ff68-9db5-b8ec-b366b93d6640The API Failed to process some items.Successful (2xx): []Unknown (5xx): []Failed (4xx): ['MRosado_dataset']

 

here is the entirety of the error if it helps.

 

Cognite Academy Instructor
December 2, 2022

Hi Miguel,

Thanks for providing the details of the problem.
We are investigating the problem in detailed manner and will get back to you.

Have a nice weekend.

Regards
Kumar

 

Rahul Kumar
Active ⭐️⭐️⭐️
December 2, 2022

I have the same issue as Miguel, thanks

Cognite Academy Instructor
December 4, 2022

Hi Toye and Miguel, 

We have fixed the problem at our end and everything is working fine at my end.

Please can you run the code again and check if the problem is solved at your end.

Regards 
Kumar

 

Rahul Kumar
Active ⭐️⭐️⭐️
December 4, 2022

Yes thanks its working for data_sets but I get the same error when I try to create the asset

 

assets = [Asset(name='world',data_set_id=xxxxxxx, description='world asset')]

tra = client.assets.create(assets)

 

Thanks

Toye

Cognite Academy Instructor
December 5, 2022

Hi Toye, 
Thanks for posting the question here.
 Please can you mention in which lesson of the course you are facing the problem, so I will test the code at my end and investigate in details. 

Regards 
Kumar

Rahul Kumar
Seasoned ⭐️⭐️
December 5, 2022

As part of  “Learn to Use the Cognite Python SDK” course in Data integration , while running “test_Authentication.ipynb” notebook , I am getting below error on line “c.login.status()”

 

--> 703 httplib_response = self._make_request( 704 conn, 705 method, 706 url, 707 timeout=timeout_obj, 708 body=body, 709 headers=headers, 710 chunked=chunked, 711 ) 713 # If we're going to release the connection in ``finally:``, then 714 # the response doesn't need to know about the connection. Otherwise 715 # it will also try to release it and we'll have a double-release 716 # mess. File c:\Users\j.subhash.parandekar\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py:386, in HTTPConnectionPool._make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 385 try: --> 386 self._validate_conn(conn) 387 except (SocketTimeout, BaseSSLError) as e: 388 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout. File c:\Users\j.subhash.parandekar\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py:1042, in HTTPSConnectionPool._validate_conn(self, conn)

...

150 raise CogniteConnectionRefused from e --> 151 raise CogniteConnectionError from e 152 raise e CogniteConnectionError: