Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make databricks jobs list not throw if workspace contains zero jobs. #230

Merged
merged 2 commits into from
Jun 21, 2019

Conversation

andrewmchen
Copy link
Contributor

Fixed #172

@codecov-io
Copy link

codecov-io commented Jun 6, 2019

Codecov Report

Merging #230 into master will decrease coverage by 0.12%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   83.08%   82.96%   -0.13%     
==========================================
  Files          31       31              
  Lines        1969     1972       +3     
==========================================
  Hits         1636     1636              
- Misses        333      336       +3
Impacted Files Coverage Δ
databricks_cli/jobs/api.py 60.86% <0%> (-9.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90b4899...f4f2ca2. Read the comment docs.

return self.client.list_jobs(headers=headers)
resp = self.client.list_jobs(headers=headers)
if 'jobs' not in resp:
return {'jobs': []}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not resp[jobs] = []?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or resp.setdefault('jobs', [])?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it to resp[jobs] = []

@andrewmchen andrewmchen merged commit f4a05cb into databricks:master Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jobs api gives an error when there are no jobs
4 participants