You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> from enum_test import Foo, BarEnum
>>> foo = Foo()
>>> bar = BarEnum.Bar.BAR
>>> foo.bars.append(bar)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/.pyenv/versions/3.7.0/lib/python3.7/_collections_abc.py", line 971, in append
self.insert(len(self), value)
File "~/lib/python3.7/site-packages/proto/marshal/collections/repeated.py", line 178, in insert
pb_value = self._marshal.to_proto(self._pb_type, value, strict=True)
File "~/lib/python3.7/site-packages/proto/marshal/marshal.py", line 215, in to_proto
expected=proto_type.__name__, got=pb_value.__class__.__name__,
TypeError: Parameter must be instance of the same class; expected Bar, got int
The text was updated successfully, but these errors were encountered:
This issue appears to be a side effect of the bug fixes released in 1.14.2 as it isn't an issue in previous versions.
For context, all the Enums in our API are structured like this, i.e. an outer
message
and innerenum
.For a simple repro case, in a
enum_test.py
file paste this:Then from a repl:
The text was updated successfully, but these errors were encountered: