tvalentyn commented on code in PR #38590:
URL: https://github.com/apache/beam/pull/38590#discussion_r3602740353
##########
sdks/python/apache_beam/coders/coder_impl.py:
##########
@@ -444,6 +453,22 @@ def encode_to_stream(self, value, stream, nested):
elif t is bool:
stream.write_byte(BOOL_TYPE)
stream.write_byte(value)
+ elif t is datetime.datetime:
Review Comment:
What is your primary motivation for introducing the datetime coder:
determinism or performance?
For determinism: Have you considered using beam TimeStamp? It is also
possible to register a custom coder for a pipeline, which you are probably
aware of.
For performance: Have you evaluated the difference between your
implementation and the default?
I worry that the proposed DataTime coder assumes a certain format of the
datetime and might result in a silent dataloss if/when in a future version of
Python other bits of metadata become introduced, like `fold`. There are other
concerns with current encoding, which I'll discuss later if we decide to keep
it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]