kamilwu commented on a change in pull request #12927:
URL: https://github.com/apache/beam/pull/12927#discussion_r496712359
##########
File path: sdks/python/apache_beam/io/avroio.py
##########
@@ -627,11 +627,19 @@ def write_record(self, writer, value):
writer.append(value)
+class _FastAvroWriter(Writer):
+ """An adapter class which exposes a file handle so that it can be closed
+ by the sink. """
+ def __init__(self, file_handle, schema, codec):
+ super(_FastAvroWriter, self).__init__(file_handle, schema, codec)
Review comment:
It turned out this change is unnecessary -- I'll remove it then.
The problem was with pyenv and Python interpreter on my machine. It lacked
libpython.so. As a result, I couldn't import cythonized code. Instead, a pure
Python version, `_write_py.py`, was being used:
https://github.com/fastavro/fastavro/blob/master/fastavro/write.py#L3. That
pure Python version has some differences, but most importantly, the `Writer`
class doesn't set `self.fo` field:
https://github.com/fastavro/fastavro/blob/master/fastavro/_write_py.py#L411
(pure Python)
vs.
https://github.com/fastavro/fastavro/blob/master/fastavro/_write.pyx#L559
(cython)
I wrongly assumed it was the fault of updating the package.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]