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

allow_alias enum option is not respected #159

Closed
busunkim96 opened this issue Oct 28, 2020 · 1 comment · Fixed by #207
Closed

allow_alias enum option is not respected #159

busunkim96 opened this issue Oct 28, 2020 · 1 comment · Fixed by #207
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@busunkim96
Copy link
Contributor

busunkim96 commented Oct 28, 2020

googleapis/python-recommendations-ai#14

IN_STOCK and STOCK_STATE_UNSPECIFIED both have a value of 0, without specifying allow_alias=True. This is causing deployment errors with protobuf.

The workaround is to specify no binary in requirements.txt:

protobuf==3.13.0 --no-binary=protobuf

https://github.com/googleapis/python-recommendations-ai/blob/90a06d1edb5b72403c6e039f99c90d1bdeef3337/google/cloud/recommendationengine_v1beta1/types/catalog.py#L167

Error

TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "google/cloud/recommendationengine_v1beta1/types/catalog.proto":
google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState: 
"google.cloud.recommendationengine.v1beta1.ProductCatalogItem.IN_STOCK" uses the same enum value as
"google.cloud.recommendationengine.v1beta1.ProductCatalogItem.STOCK_STATE_UNSPECIFIED". If this is
intended, set 'option allow_alias = true;' to the enum definition.

Docs
https://developers.google.com/protocol-buffers/docs/proto3

Protos: https://github.com/googleapis/googleapis/blob/9db36e1646684fc12657d735d9a388df3d5316e4/google/cloud/recommendationengine/v1beta1/catalog.proto#L133-L150

@software-dov software-dov transferred this issue from googleapis/gapic-generator-python Oct 29, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Oct 29, 2020
@busunkim96 busunkim96 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Oct 30, 2020
@busunkim96
Copy link
Contributor Author

busunkim96 commented Dec 23, 2020

I attempted to re-generate the recommendations ai library and the generated unit tests no longer pass.

googleapis/python-recommendations-ai#18

EDIT:

It is also impacting websecurityscanner: googleapis/python-websecurityscanner#30

At the moment there are four APIs that use this option. Two of them are already published and the other two are likely to be published in 2021.

https://github.com/googleapis/googleapis/search?q=allow_alias

  • appengine
  • websecurityscanner
  • recommendationengine
  • storage

@busunkim96 busunkim96 linked a pull request Mar 10, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants