Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Export sample#263

Merged
graysonarts merged 4 commits intotableau:developmenttableau/server-client-python:developmentfrom
graysonarts:export_sampleCopy head branch name to clipboard
Feb 16, 2018
Merged

Export sample#263
graysonarts merged 4 commits intotableau:developmenttableau/server-client-python:developmentfrom
graysonarts:export_sampleCopy head branch name to clipboard

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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.