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: disambiguate method names that are reserved in transport classes by software-dov · Pull Request #1187 · googleapis/gapic-generator-python

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

Conversation

@software-dov

@software-dov software-dov commented Feb 3, 2022

Copy link
Copy Markdown
Contributor

In addition to the method specific stubs they provide, the generated
transports expose other methods to e.g. create a gRPC channel.
This presents the opportunity for a naming collision if an API has a
CreateChannel method.

This PR disambiguates colliding method names at the transport
level. Client level method names are unchanged for ergonomic reasons.

Sorry, something went wrong.

Uh oh!

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

All reactions
@software-dov
software-dov requested review from a team, arithmetic1728, atulep, busunkim96, parthea and vam-google February 3, 2022 21:59
@software-dov software-dov linked an issue Feb 3, 2022 that may be closed by this pull request
Naming conflict with create_channel in 2 generated clients #1149
Closed
@software-dov
fix: disambiguate method names that are reserved in transport classes
8772819
In addition to the method specific stubs they provide, the generated
transports expose other methods to e.g. create a gRPC channel.
This presents the opportunity for a naming collision if an API has a
CreateChannel method.

This PR disambiguates colliding method names at the transport
level. Client level method names are unchanged for ergonomic reasons.
@software-dov
software-dov force-pushed the create-chanel branch from ae9a5c8 to 8772819 Compare February 3, 2022 22:05
vam-google
vam-google approved these changes Feb 3, 2022
View reviewed changes

@vam-google vam-google 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.

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread gapic/schema/wrappers.py
#
# Note: this should really be a class variable,
# but python 3.6 can't handle that.
TRANSPORT_UNSAFE_NAMES = {

@vam-google vam-google Feb 3, 2022

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 like it is the second in a row disambiguating PR (the other one: #1178). Can we (should we) have some sort of centralized name-conflict resolution mechanism? I think it is fine for this PR to be as is, but in case more things like that happen, it would be good to have a unified name-conflict resolution unility class or something like that. WDYT?

Sorry, something went wrong.

Uh oh!

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

All reactions

@software-dov software-dov Feb 3, 2022

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.

Different names that refer to different data structures need to be disambiguated against different sets of names. It doesn't matter too much if there's a field named create_channel. I'd argue that there are costs to being too aggressive disambiguating names, and that it makes more sense to deal with them in the Method or Field class when collisions occur.

Sorry, something went wrong.

Uh oh!

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

All reactions

@vam-google vam-google Feb 4, 2022

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.

I agree that they have to be disamgiguated against different sets of names, but that set of names can be a standardized parameter to the generic disambiguating mechanism. Basically some mechanism though which all names go through, and get disambiguated depending on the context. But yeah, this is beyond the scope of this PR and we have many more important tasks to work on.

Sorry, something went wrong.

Uh oh!

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

All reactions
@software-dov
software-dov merged commit 78626d8 into googleapis:main Feb 3, 2022
@release-please release-please Bot mentioned this pull request Feb 3, 2022
chore(main): release 0.63.1 #1189
Merged
gcf-merge-on-green Bot pushed a commit that referenced this pull request Feb 3, 2022
@release-please
chore(main): release 0.63.1 (#1189)
2a274e7
🤖 I have created a release *beep* *boop*
---


### [0.63.1](v0.63.0...v0.63.1) (2022-02-03)


### Bug Fixes

* disambiguate method names that are reserved in transport classes ([#1187](#1187)) ([78626d8](78626d8))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Nov 24, 2025
@release-please
chore(main): release 0.63.1 (#1189)
6e54ace
🤖 I have created a release *beep* *boop*
---


### [0.63.1](googleapis/gapic-generator-python@v0.63.0...v0.63.1) (2022-02-03)


### Bug Fixes

* disambiguate method names that are reserved in transport classes ([#1187](googleapis/gapic-generator-python#1187)) ([78626d8](googleapis/gapic-generator-python@78626d8))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@parthea parthea Awaiting requested review from parthea
@busunkim96 busunkim96 Awaiting requested review from busunkim96
@atulep atulep Awaiting requested review from atulep
@arithmetic1728 arithmetic1728 Awaiting requested review from arithmetic1728
1 more reviewer
@vam-google vam-google vam-google 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.

Naming conflict with create_channel in 2 generated clients

Uh oh!

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

2 participants

@software-dov @vam-google
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.