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

ProductCatalogItem.StockState enum invalid #14

Closed
mdg41 opened this issue Oct 16, 2020 · 7 comments
Closed

ProductCatalogItem.StockState enum invalid #14

mdg41 opened this issue Oct 16, 2020 · 7 comments

Comments

@mdg41
Copy link

@mdg41 mdg41 commented Oct 16, 2020

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

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

@busunkim96
Copy link
Collaborator

@busunkim96 busunkim96 commented Oct 19, 2020

Loading

@matthiasa4
Copy link

@matthiasa4 matthiasa4 commented Nov 30, 2020

Hi - I'm trying to use this library and having issues with calling a MessageToDict method on the CatalogItem, giving me:

  • KeyError: 'DESCRIPTOR'
  • AttributeError: 'DESCRIPTOR'
    errors. Any chance this might be related?

Loading

@busunkim96
Copy link
Collaborator

@busunkim96 busunkim96 commented Dec 10, 2020

@matthiasa4 That is likely unrelated. Serialization for the messages works a bit differently on the newer clients. See https://proto-plus-python.readthedocs.io/en/latest/messages.html#serialization

Something like CatalogItem.to_dict(item) should do the trick (where item is the specific instance).

Loading

@matthiasa4
Copy link

@matthiasa4 matthiasa4 commented Dec 12, 2020

@busunkim96 that did the trick! Thanks a lot :)

Loading

@danoscarmike
Copy link

@danoscarmike danoscarmike commented Mar 12, 2021

@software-dov any thoughts on this one?

Loading

@busunkim96
Copy link
Collaborator

@busunkim96 busunkim96 commented Mar 12, 2021

This is fixed in https://github.com/googleapis/gapic-generator-python/releases/tag/v0.43.0. It should be resolved when the library is re-genenerated.

Loading

@parthea
Copy link
Contributor

@parthea parthea commented Mar 27, 2021

I'm going to close this off as the root cause has been determined and the generator has been updated.

Loading

@parthea parthea closed this Mar 27, 2021
busunkim96 pushed a commit that referenced this issue Mar 29, 2021
fix: BREAKING rename `PriceRange.min` to `PriceRange.min_`, `PriceRange.max` to `PriceRange.max_`

fix: fix bug with enums closes #14, #20

feat: add async clients

feat: add common resource helper methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

7 participants