TypeError: Object of type 'DSSProject' is not JSON serializable

dataikubest
dataikubest Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 8
edited July 16 in Using Dataiku

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

Setup Info
    Tags
      Help me…