TypeError: Object of type 'DSSProject' is not JSON serializable
dataikubest
Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 8 ✭
I'm trying to use custom python step on scenario to create a bundle and deploy to project deployer.
import dataiku from datetime import datetime client = dataiku.api_client() # get DSS client deployer = client.get_projectdeployer() # get project deployer project = client.get_project(dataiku.default_project_key()) # get cross sell model project global_vars = project.get_variables() # get project variables bundle_id = global_vars['standard']['bundle_id'] # get bundle_id from project variable #create bundle project.export_bundle(bundle_id) # create deployment and deploy a bundle project_id = 'my-model-name' infra_id = 'qa-automation' deployment_id = '%s-%s-on-%s' % (project_id, bundle_id, infra_id) deployment = deployer.create_deployment(deployment_id, project, infra_id, bundle_id)
But this throws
TypeError: Object of type 'DSSProject' is not JSON serializable
Has anyone gone through this before?
Thanks in advance
Operating system used: linux
Tagged:
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,123 Neuron
I believe you need to pass the project_key (in your case project_id) to the create_deployment method:
deployment = deployer.create_deployment(deployment_id, project_id, infra_id, bundle_id)
What you are passing is the project handle.