Cleaning up samples#47
Merged
t8y8 merged 2 commits intotableau:developmenttableau/server-client-python:developmentfrom Oct 2, 2016
Merged
Cleaning up samples#47t8y8 merged 2 commits intotableau:developmenttableau/server-client-python:developmentfrom
t8y8 merged 2 commits intotableau:developmenttableau/server-client-python:developmentfrom
Conversation
t8y8
commented
Oct 2, 2016
| for connection in sample_workbook.connections]) | ||
|
|
||
| # Update tags and show_tabs flag | ||
| original_tag_set = set(sample_workbook.tags) |
Collaborator
Author
There was a problem hiding this comment.
This is a simpler way to copy a set and doesn't require copy.copy
graysonarts
suggested changes
Oct 2, 2016
samples/explore_datasource.py
Outdated
| import tableauserverclient as TSC | ||
|
|
||
|
|
||
| parser = argparse.ArgumentParser(description='Explore datasource functions supported by the Server API.') |
Contributor
There was a problem hiding this comment.
Should probably move these into the main conditional also
Collaborator
Author
There was a problem hiding this comment.
I debated that too -- I wonder if I should wrap everything in a main(), and then just have:
if __name__ == "__main__":
main()
So it's easier to tell runtime from any setup?
| # Query projects for use when demonstrating publishing and updating | ||
| all_projects, pagination_item = server.projects.get() | ||
| default_project = next((project for project in all_projects if project.is_default()), None) | ||
| # SIGN IN |
Contributor
There was a problem hiding this comment.
I'm not sure if this is just a product of github, but the spaces here are showing different than then ones below. Make sure they are all spaces, not a mix of tabs and spaces.
Collaborator
Author
There was a problem hiding this comment.
Yeah I noticed that when it posted, weird, I'll make sure they're all spaces.
graysonarts
approved these changes
Oct 2, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Though not required, I moved all of the samples code to be wrapped in
if __name__ == "__main__"blocks since that's best practice for command line scripts.I also cleaned up imports to match pep8, and removed one or two that were unused.
I think we can refactor some of the really long lines a bit more to make them more readable -- especially with respect to the Filter/Sort options, but that can come in a later checkin.