-
Notifications
You must be signed in to change notification settings - Fork 316
docs: Improve clarity of "Output Only" fields in Dataset class #2201
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
Merged
Conversation
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
I'll finalize the "Output Only" docstring formatting for the Dataset. 1. I will change the "Output Only" annotation to "Output only. " (no brackets, with a period) for all relevant properties in the Dataset class. 2. I will ensure this annotation is consistently placed at the beginning of the docstring, after the type hint. 3. I will verify that the note in `Dataset.__init__` regarding server-populated fields and `Client.get_dataset()` is present and correctly formatted. 4. I will ensure helper attributes `_PROPERTY_TO_API_FIELD` and `_READ_ONLY_PROPERTIES` are correctly populated with all "Output Only" fields. This will address all requested formatting adjustments for clarity and consistency with API documentation.
This commit updates the docstrings for the `Dataset` class to more clearly indicate fields that are "Output Only". Changes include: - Adding an "Output only. " marker at the beginning of the docstring (after the type hint) for all server-populated fields such as `id`, `creationTime`, `lastModifiedTime`, `etag`, etc. - Updating the `Dataset.__init__` docstring to explicitly mention that these "Output Only" fields are populated by the server and require a call to `Client.get_dataset()` to be retrieved by the SDK. - Ensuring internal helper attributes (`_PROPERTY_TO_API_FIELD` and `_READ_ONLY_PROPERTIES`) are correctly updated to reflect these output-only properties. These changes aim to reduce confusion for you by aligning the Python SDK documentation more closely with the BigQuery API reference regarding which fields can be set by the client versus which are returned by the server.
I have reservations about this PR as expressed in internal issue b/407210727, comment #6 It feels like we are going overboard OR not going far enough, with very little happy medium. |
chalmerlowe
approved these changes
Jun 5, 2025
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.
Approved pending passing tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api: bigquery
Issues related to the googleapis/python-bigquery API.
size: s
Pull request size is small.
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.
fixes b/407210727