-
Notifications
You must be signed in to change notification settings - Fork 436
initial checkin for get background jobs #298
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
initial checkin for get background jobs #298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 with some ?'s/nits
|
||
@property | ||
def name(self): | ||
"""For APi consistency""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring can probably go, or expand on what "API consistency" means
@@ -29,9 +29,9 @@ def _make_common_headers(auth_token, content_type): | |||
|
|||
@staticmethod | |||
def _safe_to_log(server_response): | |||
'''Checks if the server_response content is not xml (eg binary image or zip) | |||
"""Checks if the server_response content is not xml (eg binary image or zip) | |||
and and replaces it with a constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're tweaking my comment, can you fix my double 'and and' while you're there :)
@@ -94,6 +100,14 @@ def use_highest_version(self): | |||
import warnings | |||
warnings.warn("use use_server_version instead", DeprecationWarning) | |||
|
|||
def assert_at_least_version(self, version): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move this to the server object itself?
import warnings | ||
warnings.warn("Jobs.get(job_id) is deprecated, update code to use Jobs.get_by_id(job_id)") | ||
return self.get_by_id(job_id) | ||
self.parent_srv.assert_at_least_version('3.1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now, you need to call this assert to check that it's > 3.1 and also keep the > 2.6 for old back compat. I need to think about this, maybe it's better to have another decorator behavior_changed_in... or something like that.
But this seems fine for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 with some nits
id_ = element.get('id', None) | ||
type_ = element.get('jobType', None) | ||
status = element.get('status', None) | ||
created_at = element.get('createdAt', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add datetime parsing for all of the time fields using parse_datetime.py?
test/test_job.py
Outdated
self.assertEquals('Success', job.status) | ||
self.assertEquals('50', job.priority) | ||
self.assertEquals('single_subscription_notify', job.type) | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add asserts for the 3 datetime fields that are part of the xml response?
Also wondering if the xml response is left here intentionally as a comment.
🚀 |
New Endpoint from the scheduling team. First pass for the first endpoint