[Python API] Code envs doc shows unexisting functions

Jyegda
Level 2
[Python API] Code envs doc shows unexisting functions

Hi,

I am using Dataiku 9.0.5, Python 3.6

I'm trying to use the Python API to gather all the usages of a code env.

In the documentation there is a method named list_usage which should do the trick, but when I try to use it in a notebook via Dataiku, I get the following error message

AttributeError: 'DSSCodeEnv' object has no attribute 'list_usages'

Am I doing something wrong ?

I already check that the type of the object I'm calling the method with is correct and I checked the attributes of this object. It appears that the function I'm willing to use isn't the only one missing.

 

Can you provide me with a solution? Even if it's another way to do the trick ๐Ÿ™‚

Best regards,

Jyegda


Operating system used: Windows 10


Operating system used: Windows 10

0 Kudos
7 Replies
sergeyd
Dataiker

Hi @Jyegda 

Works on my DSS9.0.5:

Screenshot 2022-04-08 at 18.25.32.png

You should get that error message if you are on DSS8 and lower. Are you sure you are on DSS9? 

0 Kudos
Jyegda
Level 2
Author

Hi,

 

Thanks for your fast reply!

I'm not 100% sure, but this command seems to confirm that I'm using 9.0.4

Do you need some other informations ?

 

Ugo

0 Kudos
sergeyd
Dataiker

Thanks. Can you post the code you are trying to run? 

0 Kudos
Jyegda
Level 2
Author

Hi @sergeyd,

 

Sorry to bother you, do you have any update about my question ? ๐Ÿ™‚

 

Best regards,

Ugo

0 Kudos
sergeyd
Dataiker

Hi @Jyegda 

What do you get when you run this command from the DSS command-line interface: 

grep -r "list_usages" <DSS_INSTALL_DIR>/python/dataikuapi/*

I suspect that somehow you are still using DSS8 dataiku code.

0 Kudos
Jyegda
Level 2
Author

Hi @sergeyd ,

 

I've ran the command and here is the result

Capture dโ€™รฉcran result.png

I have other version of dataiku but the one running is 9.0.4.

Ugo

 

0 Kudos
Jyegda
Level 2
Author

It's approximately the same than the one you posted previously.
I'm just trying to get all usages for each code env.

0 Kudos