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

Add cancel job #299

Merged
merged 5 commits into from
Jun 1, 2018
Merged

Add cancel job #299

merged 5 commits into from
Jun 1, 2018

Conversation

graysonarts
Copy link
Contributor

No description provided.

Copy link
Contributor

@shinchris shinchris left a comment

Choose a reason for hiding this comment

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

🚀

@@ -0,0 +1,47 @@
####
# This script demonstrates how to list all of the workbooks or datasources
Copy link
Contributor

Choose a reason for hiding this comment

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

Description here and on line 15 needs update

Copy link
Collaborator

@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

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

Nits 🚀

req = TSC.RequestOptions()

req.filter.add(TSC.Filter("progress", TSC.RequestOptions.Operator.LessThanOrEqual, 0))
for job in TSC.Pager(server.jobs.get, request_opts=req):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: You can just pass the endpoint

@@ -76,7 +76,7 @@ def delete_request(self, url):
# We don't return anything for a delete
self._make_request(self.parent_srv.session.delete, url, auth_token=self.parent_srv.auth_token)

def put_request(self, url, xml_request, content_type='text/xml'):
def put_request(self, url, xml_request=None, content_type='text/xml'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

So cancel takes an empty (as in b'') PUT? Didn't run job take an empty <tsRequest/ >?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah...

@@ -17,12 +18,20 @@ def get(self, job_id=None, req_options=None):
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)
if isinstance(job_id, RequestOptionsBase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm so sad. But customers will love the functionality!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah once we hit 1.0, we can remove this.

@graysonarts graysonarts merged commit dd87aa6 into tableau:development Jun 1, 2018
@graysonarts graysonarts deleted the add-cancel-job branch June 1, 2018 16:06
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.

None yet

3 participants