-
Notifications
You must be signed in to change notification settings - Fork 414
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
Export sample #263
Conversation
samples/export.py
Outdated
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server') |
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.
Description here and for list.py is for refresh tasks.
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.
🚀
Both nits
samples/export.py
Outdated
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 |
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.
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, |
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.
Code is fine, and I'm not sure if this works so ignore it if not: But can we filter on ID natively yet?
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'm not sure views supports that right now.
Add a sample/tool for using export from the rest api. It also supports view filters.