[
https://issues.apache.org/jira/browse/BEAM-5879?focusedWorklogId=163155&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-163155
]
ASF GitHub Bot logged work on BEAM-5879:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Nov/18 18:48
Start Date: 06/Nov/18 18:48
Worklog Time Spent: 10m
Work Description: tvalentyn commented on a change in pull request #6953:
[BEAM-5879 ] Make write_record() in tfrecordio.py py3 compatible
URL: https://github.com/apache/beam/pull/6953#discussion_r231245670
##########
File path: sdks/python/apache_beam/io/tfrecordio.py
##########
@@ -78,7 +78,10 @@ def _masked_crc32c(cls, value,
crc32c_fn=_default_crc32c_fn):
Masked crc32c checksum.
"""
- crc = crc32c_fn(value)
+ if isinstance(value, bytes):
Review comment:
+1. I want us to have clarity on which types we expect throughout methods of
TFRecord IO, we should avoid having APIs that accept both `str=unicode` and
`bytes`. See:
https://docs.python.org/3/howto/pyporting.html#text-versus-binary-data. If it
makes sense for TF Records to hold unencoded strings, then we may want to
encode them to bytes right before writing them, and decode them as soon as we
read them.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 163155)
Time Spent: 1h 10m (was: 1h)
> TFRecordio not Py3 compatible
> -----------------------------
>
> Key: BEAM-5879
> URL: https://issues.apache.org/jira/browse/BEAM-5879
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Environment: python 3.5
> Reporter: Ruoyu Liu
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Error when trying to write to file. Initial issue in line 103 in
> io/tfrecordio.py, after making the content to bytes, there will be
> segmentation fault when reading.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)