8000 Pager does not allow pulling usage information for views.get() · Issue #444 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Pager does not allow pulling usage information for views.get() #444

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

Closed
shinchris opened this issue Jun 7, 2019 · 2 comments
Closed

Pager does not allow pulling usage information for views.get() #444

shinchris opened this issue Jun 7, 2019 · 2 comments

Comments

@shinchris
Copy link
Contributor

The Pager generator takes in RequestOptions, but usage information for views.get() requires another parameter to be passed in. Currently, we cannot use Pager to get all views WITH usage information.

@t8y8
Copy link
Collaborator
t8y8 commented Jun 19, 2019

Actually, we do!

Sorta.

Pager accepts any callable, so you can just pass in a partial.

from functools import partial
usage_pager = partial(server.views.get, usage=True)
views = TSC.Pager(usage_pager)

for view in views:
    # do something

It could probably be a little cleaner but not sure how yet. We could have Pager take in *args and just blindly pass them to the callable, which works. Or we can document you should use a partial.

@t8y8
Copy link
Collaborator
t8y8 commented Jun 26, 2019

Solved!

@t8y8 t8y8 closed this as completed Jun 26, 2019
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

No branches or pull requests

2 participants
0