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

Export sample #263

Merged
merged 4 commits into from
Feb 16, 2018
Merged

Export sample #263

merged 4 commits into from
Feb 16, 2018

Conversation

graysonarts
Copy link
Contributor

Add a sample/tool for using export from the rest api. It also supports view filters.



def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
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 for list.py is for refresh tasks.

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.

🚀

Both nits

views = filter(lambda x: x.id == args.resource_id,
TSC.Pager(server.views.get))
view = views.pop()
(populate_name, option_factory_name, member_name, extension) = args.type
Copy link
Collaborator

Choose a reason for hiding this comment

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

It took me a few reads to understand what's going on here.
I think the code is fine, but some suggestions for clarity:

  • Rename 'populate_name' to 'populate_func_name'
  • Add a one line comment above that says something like "We've got lots of types and classes, this is code to figure out all the right functions to call" or something

tableau_auth = TSC.TableauAuth(args.username, password, args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):
views = filter(lambda x: x.id == args.resource_id,
Copy link
Collaborator

@t8y8 t8y8 Feb 15, 2018

Choose a reason for hiding this comment

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

Code is fine, and I'm not sure if this works so ignore it if not: But can we filter on ID natively yet?

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'm not sure views supports that right now.

@graysonarts graysonarts merged commit 2a2c898 into tableau:development Feb 16, 2018
@graysonarts graysonarts deleted the export_sample branch February 16, 2018 17:43
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