Conversation
samples/filter_sort_projects.py
Outdated
| TSC.RequestOptions.Operator.Equals, | ||
| filter_project_name)) | ||
|
|
||
| filter_projects_paged = server.projects.get(req_options=options) |
There was a problem hiding this comment.
This will only get the first 100 projects, we should use the next() and TSC.Pager pattern or this will fail on a server with more than 100 projects
There was a problem hiding this comment.
This is searching for a specific project name. It should only return one or zero.
There was a problem hiding this comment.
Ooooooh. Yes, that makes sense for project name, we should be careful for things where names aren't unique (User display name comes to mind) but none of the samples touch that yet.
samples/filter_sort_projects.py
Outdated
| filter_project_name)) | ||
|
|
||
| filter_projects_paged = server.projects.get(req_options=options) | ||
| print(filter_projects_paged[0][0].name) |
There was a problem hiding this comment.
What's this trying to do?
Clearer, if possible, is to use tuple unpacking.(Or a comment what this is double indexing into, I can't tell)
samples/filter_sort_projects.py
Outdated
|
|
||
| import tableauserverclient as TSC | ||
|
|
||
| def create_example_project(_name='Example Project', _content_permissions='LockedToProject', |
There was a problem hiding this comment.
These shouldn't be prefixed with _
There was a problem hiding this comment.
agree with @t8y8 here, let's remain these to not have _ in them.
samples/filter_sort_projects.py
Outdated
| server = TSC.Server(args.server) | ||
|
|
||
| with server.auth.sign_in(tableau_auth): | ||
| server.version = '2.7' |
There was a problem hiding this comment.
use_server_version() like the other sample
samples/filter_sort_projects.py
Outdated
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| main() No newline at end of file |
There was a problem hiding this comment.
I think there's a whitespace error here, it's hard to tell on github
There was a problem hiding this comment.
You need a trailing newline at the EOF.
If you run pycodestyle on the file, it'll tell you all the style things that need to be fixed.
graysonarts
left a comment
There was a problem hiding this comment.
Fix the few issues we outlined, and then 🚀
samples/filter_sort_projects.py
Outdated
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| main() No newline at end of file |
There was a problem hiding this comment.
You need a trailing newline at the EOF.
If you run pycodestyle on the file, it'll tell you all the style things that need to be fixed.
|
🚀 |
* Added filtering on project names in new sample script * Minor comment change * Clearer unpacking rest api response objects * Proper printing instructions * Style changes, removed_, using call to switch server version
* Added filtering on project names in new sample script * Minor comment change * Clearer unpacking rest api response objects * Proper printing instructions * Style changes, removed_, using call to switch server version
No description provided.