Skip to content
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

fix: mitigate collisions in field names #295

Merged
merged 4 commits into from
Feb 14, 2022

Conversation

parthea
Copy link
Contributor

@parthea parthea commented Feb 12, 2022

Underscores may be appended to field names that collide with python or proto-plus keywords. In case a key only exists with a _ suffix, coerce the key to include the _ suffix. It's not possible to natively define the same field with a trailing underscore in protobuf. See related issue googleapis/python-api-core#227

@parthea parthea force-pushed the mitigate-collisions-in-field-names branch from ece257c to 3ea8150 Compare February 12, 2022 02:42
@codecov
Copy link

codecov bot commented Feb 12, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@51e316e). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             main      #295   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?        22           
  Lines           ?       986           
  Branches        ?       220           
========================================
  Hits            ?       986           
  Misses          ?         0           
  Partials        ?         0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51e316e...485bec2. Read the comment docs.

@parthea parthea changed the title [WIP] fix: mitigate collisions in field names fix: mitigate collisions in field names Feb 12, 2022
@parthea parthea force-pushed the mitigate-collisions-in-field-names branch 2 times, most recently from 7a347b1 to 4de2462 Compare February 14, 2022 19:02
Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few comments

tests/test_fields_mitigate_collision.py Outdated Show resolved Hide resolved
proto/message.py Outdated Show resolved Hide resolved
@parthea parthea marked this pull request as ready for review February 14, 2022 19:47
@parthea parthea requested review from a team as code owners February 14, 2022 19:47
@parthea parthea merged commit 158ae99 into main Feb 14, 2022
@parthea parthea deleted the mitigate-collisions-in-field-names branch February 14, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants