docs: add one-line docstrings to root-level helper modules - #1859
Open
jacalata wants to merge 5 commits into
Open
docs: add one-line docstrings to root-level helper modules#1859jacalata wants to merge 5 commits into
jacalata wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the generated API reference by adding concise, one-line docstrings to several root-level helper modules so Sphinx can render meaningful descriptions for commonly used helpers and constants.
Changes:
- Add module/class/function docstrings in
namespace.py,filesys_helpers.py,datetime_helpers.py, andexponential_backoff.py. - Add docstrings to
Configand its public configuration properties inconfig.py.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tableauserverclient/namespace.py | Adds docstrings for the namespace helper error and class/method. |
| tableauserverclient/filesys_helpers.py | Adds docstrings for filename/path helpers and file inspection utilities. |
| tableauserverclient/exponential_backoff.py | Adds docstrings for the backoff timer class and its sleep behavior. |
| tableauserverclient/datetime_helpers.py | Adds docstrings clarifying timestamp/UTC parsing and formatting helpers. |
| tableauserverclient/config.py | Adds docstrings documenting env-var-driven runtime configuration properties. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
20
to
23
| @property | ||
| def CHUNK_SIZE_MB(self): | ||
| """Chunk size in MB for multipart publish requests (env: TSC_CHUNK_SIZE_MB).""" | ||
| return int(os.getenv("TSC_CHUNK_SIZE_MB", 5 * 10)) # 5MB felt too slow, upped it to 50 |
Comment on lines
+37
to
+38
| def get_file_type(file): | ||
| """Detect the type of an open binary file by inspecting its magic bytes, returning one of 'zip', 'tde', 'xml', or 'hyper'.""" |
Two one-word docstring nits from Copilot: - CHUNK_SIZE_MB docstring now names the default (50). Previously it cited the env var without saying what a caller gets if it isn't set. - get_file_type's docstring now mentions it raises ValueError when no magic bytes match, instead of only describing the happy path.
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.
Motivation
The api-ref migration audit's
needs_docstringbucket includes a fewhelper modules that live outside
server/endpoint/andmodels/. Theyeach ship a small number of small functions, and none of them had
docstrings. Missing docstrings mean Sphinx has nothing to render on the
generated page under #1832, so users looking up
parse_datetimeor theexponential-backoff constants find bare signatures with no explanation.
Behavior change
Docs only. No runtime code changes.
Four commits, one file each:
filesys_helpers.py— one-line docstring on each of the helper functionsnamespace.py— one-line docstring on the module and theNamespaceclassdatetime_helpers.py— one-line docstrings ontimestamp,parse_datetime,format_datetime, and theUTCtzinfo classexponential_backoff.py+config.py— one-line docstrings on the backoffhelper and the config module's public constants
Each docstring states what the function does in one sentence. Nothing
prescriptive — these helpers are stable and the docstrings are meant to
be captured by Sphinx, not to change behavior.
Test plan
black --checkclean.will render the new docstrings.
🤖 Generated with Claude Code