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 — fix: list oneofs in docstring by busunkim96 · Pull Request #1030 · googleapis/gapic-generator-python

This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Conversation

@busunkim96

@busunkim96 busunkim96 commented Oct 13, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Fixes #713

  • FIeld attributes state which oneof they are part of.

  • If a message has a oneof with more than 1 member field, the docstring includes a short explanation of oneofs and a list of the oneofs in the message.

The list looks a bit odd in the generated docs (output of nox -s docs / what's published to googleapis.dev) - suggestions on better ways to present the information are very appreciated.

@dandhlee Do you have an idea of how this docstring change would look in Cloud RAD?

image

Sorry, something went wrong.

Uh oh!

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

All reactions
busunkim96 added 2 commits October 13, 2021 23:39
@busunkim96
fix: list oneofs in docstring
14a88a6
@busunkim96
chore: copy to ads templates
15c82b4
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 13, 2021
@busunkim96
Merge branch 'master' into oneofs-in-docstrings
403a0be
busunkim96
busunkim96 commented Oct 13, 2021
View reviewed changes
Comment thread gapic/ads-templates/%namespace/%name/%version/%sub/types/_message.py.j2 Outdated
Comment on lines +8 to +11
This message has the following `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

@busunkim96 busunkim96 Oct 13, 2021

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.

Wording borrows heavily from https://developers.google.com/protocol-buffers/docs/proto3#oneof and https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread tests/integration/goldens/asset/google/cloud/asset_v1/types/asset_service.py Outdated
class OutputConfig(proto.Message):
r"""Output configuration for export assets destination.

This message has the following `oneof`_ fields (mutually exclusive fields).

@busunkim96 busunkim96 Oct 13, 2021

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.

@dandhlee This is a concrete example of the new docstring with the oneof information.

Sorry, something went wrong.

Uh oh!

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

All reactions

@dandhlee dandhlee Oct 14, 2021

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.

Will take a look, intuition tells me it'll just show up as `oneof`_

Sorry, something went wrong.

Uh oh!

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

All reactions

@dandhlee dandhlee Oct 14, 2021

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.

Sadly it doesn't get parsed, but I'll be happy to include support for it C:

Sorry, something went wrong.

Uh oh!

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

All reactions
@busunkim96
busunkim96 marked this pull request as ready for review October 14, 2021 14:45
@busunkim96
busunkim96 requested review from a team, atulep, parthea and software-dov October 14, 2021 14:46
parthea
parthea approved these changes Oct 14, 2021
View reviewed changes
software-dov
software-dov approved these changes Oct 14, 2021
View reviewed changes
atulep
atulep reviewed Oct 14, 2021
View reviewed changes
Comment thread gapic/ads-templates/%namespace/%name/%version/%sub/types/_message.py.j2 Resolved

Uh oh!

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

busunkim96 and others added 4 commits October 14, 2021 22:33
@busunkim96
docs: remove separate list in docstring
843c86b
@busunkim96
t push
9a6ef5e
Merge branch 'oneofs-in-docstrings' of github.com:googleapis/gapic-generator-python into oneofs-in-docstrings
@busunkim96
Merge branch 'master' into oneofs-in-docstrings
5058a3f
@busunkim96
chore: also update ads
8a80020
@busunkim96
busunkim96 merged commit a0e25c8 into master Oct 18, 2021
@busunkim96
busunkim96 deleted the oneofs-in-docstrings branch October 18, 2021 23:30
This was referenced Jan 18, 2022
chore(master): release reverted #1133
Merged
chore(master): release 0.40.0 #1138
Closed
chore(master): release 0.39.1 #1146
Closed
This was referenced Jan 26, 2022
chore(main): release 0.39.1 #1160
Closed
chore(main): release 0.39.1 #1162
Closed
chore(main): release 0.61.0 #1163
Merged
@sindrehan sindrehan mentioned this pull request Jan 15, 2025
Update gapic-generator-python BluEye-Robotics/blueye.protocol#51
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

4 more reviewers
@atulep atulep atulep left review comments
@dandhlee dandhlee dandhlee left review comments
@software-dov software-dov software-dov approved these changes
@parthea parthea parthea 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

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Docstrings do not specify which fields are one-ofs

Uh oh!

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

5 participants

@busunkim96 @software-dov @parthea @atulep @dandhlee
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 01402775 — 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.