Updating packages of versioned code environments throught the API
I am working on a script which pulls up each code environment from the automation node and do a package update. When I run the script I am getting this version error, after get the latest version of the code env, update package() doesn't have an parameter for code version. How to specify a version in update_packages() ?
Code
client = dataikuapi.DSSClient("DEV_URL", api_key="API_KEY")
client._session.verify = False
test_code_env_name = 'Python_39_test'
test_code_env_handle = client.get_code_env('PYTHON',test_code_env_name)
test_code_env_flag = test_code_env_handle.update_packages(force_rebuild_env=False)
print(test_code_env_flag)
Error (O/P of print)
Exception: Env update failed : [{"severity": "ERROR", "isFatal": true, "code": "ERR_CODEENV_UPDATE_FAILED", "title": "Environment update failed", "details": "Version not specified", "message": "Environment update failed: Version not specified"}]
Operating system used: Windows
Answers
-
Grixis PartnerApplicant, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 82 ✭✭✭✭✭
Hey @binary_wader ,
Did you fix it ? You error message seems to indicate a missing argument for create_code_env()
from api python doc
you can find this :# Create the code envcode_env = client.create_code_env("PYTHON", "my_code_env_name", "DESIGN_MANAGED", {"pythonInterpreter": "PYTHON36"})
Best,