Error when starting a job with DSSClient
agondouin
Registered Posts: 3 ✭✭✭✭
Hello,
I'm trying to start a job by the API.
In the job definition, i have something like that:
definition = {
"type" : "RECURSIVE_FORCED_BUILD",
"outputs" : [{
"id" : "name_of_the_output_dataset",
"partition" : "NP"
}]
}
But i'm getting the following error:
File "dataiku_api.py", line 14, in
job = project.start_job(definition)
File "/Users/a.gondouin/dataiku-api-client-python/dataikuapi/dss/project.py", line 268, in start_job
return DSSJob(self.client, self.project_key, job_def['id'])
TypeError: list indices must be integers, not str
Do you have any idea ?
Thanks in advance
I'm trying to start a job by the API.
In the job definition, i have something like that:
definition = {
"type" : "RECURSIVE_FORCED_BUILD",
"outputs" : [{
"id" : "name_of_the_output_dataset",
"partition" : "NP"
}]
}
But i'm getting the following error:
File "dataiku_api.py", line 14, in
job = project.start_job(definition)
File "/Users/a.gondouin/dataiku-api-client-python/dataikuapi/dss/project.py", line 268, in start_job
return DSSJob(self.client, self.project_key, job_def['id'])
TypeError: list indices must be integers, not str
Do you have any idea ?
Thanks in advance
Answers
-
Hi,
Sorry for the late response, did you find a solution?
I think you need to cast the ids into integers instead of strings.
Matt -
Hello Matt,
Yes, I've found a solution.
In the definition block, I replaced the " with ' and it works fine.
The example in the documentation is with " https://doc.dataiku.com/dss/latest/api/public/client-python-examples/jobs.html#starting-new-jobs
Thanks for your answer.