initial checkin for get background jobs#298
initial checkin for get background jobs#298graysonarts merged 3 commits intotableau:developmenttableau/server-client-python:developmentfrom graysonarts:add-get-all-jobsCopy head branch name to clipboard
Conversation
|
|
||
| @property | ||
| def name(self): | ||
| """For APi consistency""" |
There was a problem hiding this comment.
This docstring can probably go, or expand on what "API consistency" means
| 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.
Since you're tweaking my comment, can you fix my double 'and and' while you're there :)
| import warnings | ||
| warnings.warn("use use_server_version instead", DeprecationWarning) | ||
|
|
||
| def assert_at_least_version(self, version): |
There was a problem hiding this comment.
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.
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
| 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.
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.
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