GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Commenting and Docstring cleanup. A few very small code cleanups by t8y8 · Pull Request #120 · tableau/document-api-python

Conversation

@t8y8

@t8y8 t8y8 commented Dec 12, 2016

Copy link
Copy Markdown
Contributor

In the interest of making the library as approachable as possible for users and contributors, I took a pass at adding in more docstrings and comments where I felt appropriate.

Finding the right voice is hard, so I'm not married to my particular text.

Fields is already pretty well documented, but @RussTheAerialist may have updates in mind.

Ok, cheated and changed a few very minor pieces of code as well, I made a function 'private' since it really should be, and got rid of some extra parens.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@t8y8
t8y8 requested review from graysonarts and jdomingu December 12, 2016 05:06
t8y8
t8y8 commented Dec 12, 2016
View reviewed changes
Comment thread tableaudocumentapi/datasource.py


def make_unique_name(dbclass):
def _make_unique_name(dbclass):

@t8y8 t8y8 Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

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.

This shouldn't ever be called outside of the class so I made it private.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
t8y8
t8y8 commented Dec 12, 2016
View reviewed changes
Comment thread tableaudocumentapi/datasource.py
"""Initialize datasource from file (.tds ot .tdsx)"""

dsxml = xml_open(filename, cls.__name__.lower()).getroot()
dsxml = xml_open(filename, 'datasource').getroot()

@t8y8 t8y8 Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

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.

I realized that this was actually less readable than just making it a literal string, which removed the need for the comment "#Gets the name of the class and normalizes it so it can verify the file it opens"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
t8y8
t8y8 commented Dec 12, 2016
View reviewed changes
Comment thread tableaudocumentapi/datasource.py
self._datasourceXML.remove(tag)

###########
# fields

@t8y8 t8y8 Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

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.

I think these added more clutter than they helped, and weren't consistently applied.

I left the section headers in place (Public API, Private API)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@t8y8 t8y8 Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

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.

But then I realized I left several in. I'll remove them

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@t8y8
Commenting and Docstring cleanup. A few very small code cleanups
33a3665
benlower
benlower reviewed Dec 12, 2016
View reviewed changes
Comment thread tableaudocumentapi/connection.py Outdated
###########
@property
def dbclass(self):
"""The type of connection (e.g. 'MySQL', 'Postgresql')."""

@benlower benlower Dec 12, 2016

Copy link
Copy Markdown
Contributor

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.

is there a list of all available options somewhere? if so would be nice to point ppl to that

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@t8y8 t8y8 Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

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.

The dbclass.py file lists my best guess at a comprehensive list that I extracted from our CPP code :), I can point them to that

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
benlower
benlower reviewed Dec 12, 2016
View reviewed changes
Comment thread tableaudocumentapi/workbook.py Outdated
"""
"""A class for writing Tableau workbook files."""

###########################################################################

@benlower benlower Dec 12, 2016

Copy link
Copy Markdown
Contributor

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.

so are we leaving this comment in to denote the public API? fine if we do just checking

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@t8y8 t8y8 Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

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.

I left the public and private api bits in, I personally am not a fan, so I'm happy to remove them.

But I was deferring to your original commit 🍭

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
benlower
benlower reviewed Dec 12, 2016
View reviewed changes
Comment thread tableaudocumentapi/xfile.py Outdated
"""Opens the provided 'filename'. Handles detecting if the file is an archive,
detecting the document version, and validating the root tag."""

# Is the file a zip (twbx or tdsx)

@benlower benlower Dec 12, 2016

Copy link
Copy Markdown
Contributor

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.

let's be consistent with what is in datasource.py and prepend each extension with a ".". so make this ".twbx or .tdsx" please

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

t8y8 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
benlower
benlower approved these changes Dec 12, 2016
View reviewed changes

@benlower benlower left a comment

Copy link
Copy Markdown
Contributor

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.

🚀 with a couple of nits

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@t8y8
few more tweaks
34e2ebf
jdomingu
jdomingu approved these changes Dec 14, 2016
View reviewed changes

@jdomingu jdomingu left a comment

Copy link
Copy Markdown
Contributor

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.

Looks great! 🚀

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@t8y8
t8y8 merged commit fe16c0c into tableau:development Dec 14, 2016
@t8y8
t8y8 deleted the feature-docstrings branch December 14, 2016 00:38
graysonarts pushed a commit that referenced this pull request Jan 11, 2017
Russell Hay
Release 0.6 (#126)
65fbc80
* Fix #117 by only attempting files with the right extension inside the archive (#118)

* Commenting and Docstring cleanup. A few very small code cleanups (#120)

Add docstrings and remove clutter. I also made some very tiny tweaks to some code for clarity.

* Small cleanups for various editors. Play nice with built in test-runners (#121)

* Add Py36, update travis to use pycodestyle (#124)

* Add `initial sql` and `query band` support (#123)

Addresses #109 and #110

* Prep for release of 0.6 (#125)

* Prep for release of 0.6

* wordsmithing the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@graysonarts graysonarts Awaiting requested review from graysonarts
2 more reviewers
@benlower benlower benlower approved these changes
@jdomingu jdomingu jdomingu approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@t8y8 @benlower @jdomingu
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.