-
Notifications
You must be signed in to change notification settings - Fork 437
Change server_info endpoint error message to be verbose #439
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
Conversation
Add handling for case in which API version is not supported by the Tableau server.
I haven't reviewed in detail yet, but I think the problem is that we handle this a level above at https://github.com/jacobj10/server-client-python/blob/e4ec849b19f02f016f90e641756d9bd81d23d026/tableauserverclient/server/server.py#L76 In this case, you're manually setting the API version to 2.5, avoiding the 'use legacy version check' fallback. I agree we should handle this, and I'll take a look at your PR! |
Ahh I see, I think I was manually updating the version due to confusion when reading the documentation. The correct way is to use the class methods? |
Hey! Yeah, the recommendation is to just use the methods like this: auth = TSC.TableauAuth(USERNAME, PASSWORD)
server = TSC.Server("http://SERVER", use_server_version=True)
# OR
server = TSC.Server("http://SERVER")
server.use_server_version() Regarding the bug, which is still sorta lurking there, even if you just use the methods above... maybe we should just catch all others and re-reaise? Would you be willing to update the PR to do that? To contribute you just need to sign the CLA (and make the build green) and we can help you get it merged in. Info on filling out the CLA can be found here: http://tableau.github.io/contributing.html |
... I'm not sure how that test is failing given you didn't touch sorting/filtering. Can you make sure your fork is updated tot he latest development branch? |
The test fails locally on my master branch as well. It looks like
|
The only explanation I have is some update in a library we depend on changed the encoding behavior? Feel free to take a look at that and include it in your PR, or ignore it and I won't hold it against you :) |
Ack I'll try to include in this PR, I'll let you know if I can't figure it out. Update: Yeah looks like it was an issue with |
Yep that did it. More of a single issue fix. It might be worth seeing if there are any |
Thanks, I'll take it! Can you confirm you've sent in the CLA? (I don't have an easy way to check on my end) I'll wait a day and then merge this. |
Sent :) |
CLA approved. |
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.
🚀
Release v0.9 ## 0.9 (4 Oct 2019) * Added Metadata API endpoints (#431) * Added site settings for Data Catalog and Prep Conductor (#434) * Added new fields to ViewItem (#331) * Added support and samples for Tableau Server Personal Access Tokens (#465) * Added Permissions endpoints (#429) * Added tags to ViewItem (#470) * Added Databases and Tables endpoints (#445) * Added Flow endpoints (#494) * Added ability to filter projects by topLevelProject attribute (#497) * Improved server_info endpoint error handling (#439) * Improved Pager to take in keyword arguments (#451) * Fixed UUID serialization error while publishing workbook (#449) * Fixed materalized views in request body for update_workbook (#461)
Add handling for case in which API version is not supported by the Tableau server. While trying to explore this library, I ran into an error when trying to call
server.server_info_get()
This stems from the code here:
https://github.com/jacobj10/server-client-python/blob/e4ec849b19f02f016f90e641756d9bd81d23d026/tableauserverclient/server/endpoint/server_info_endpoint.py#L17-L21
which can catch an error without setting the variable, leading to a confusing and non descriptive UnboundLocalError. Right now I just added an extra check for my specific error (version unsupported), but it my be worth just raising whatever error comes from the response.
This is my first time contributing so please let me know if you have any questions, comments, or concerns.