-
Notifications
You must be signed in to change notification settings - Fork 37
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
Proto Plus messages are not pickleable #162
Comments
The preferred serialization mechanism is the composer = Composer(given_name="Richard", family_name="Strauss")
composer_bytes = Composer.serialize(composer)
composer2 = Composer.deserialize(composer_bytes) If using something like from multiprocessing import Pool
with Pool(5) as p:
def process_bach(bach_bytes):
bach = Composer.deserialize(bach_bytes)
return Composer.serialize(get_parent(bach))
initial_bachs = [Composer(given_name=name, family_name="Bach") for name in ["Johann Sebastian", "Carl Philipp", "Johann Christian", "Wilhelm Friedemann", "Johann Friedrich"]]
parent_bachs = [Composer.deserialize(bytes) for bytes in p.map(process_bach, (Composer.serialize(bach) for bach in initial_bachs))] |
@software-dov This issue is a major blocker for integrating current Bigtable (2.4.x) with Apache Beam, which relies on pickling messages across hosts / processes. See e.g. this CI failure. We could solve the issue by writing |
Pickling support addd by #280 |
From googleapis/python-iot#42
The current recommendation is to serialize to bytes. https://proto-plus-python.readthedocs.io/en/latest/reference/message.html
The text was updated successfully, but these errors were encountered: