Skip to content

Commit f4a05cb

Browse files
authored
Make databricks jobs list not throw if workspace contains zero jobs. (#230)
* init * Update api.py
1 parent 2740846 commit f4a05cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

databricks_cli/jobs/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ def create_job(self, json, headers=None):
3131
return self.client.client.perform_query('POST', '/jobs/create', data=json, headers=headers)
3232

3333
def list_jobs(self, headers=None):
34-
return self.client.list_jobs(headers=headers)
34+
resp = self.client.list_jobs(headers=headers)
35+
if 'jobs' not in resp:
36+
resp['jobs'] = []
37+
return resp
3538

3639
def delete_job(self, job_id, headers=None):
3740
return self.client.delete_job(job_id, headers=headers)

0 commit comments

Comments
 (0)