[
https://issues.apache.org/jira/browse/BEAM-5879?focusedWorklogId=162946&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-162946
]
ASF GitHub Bot logged work on BEAM-5879:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Nov/18 08:28
Start Date: 06/Nov/18 08:28
Worklog Time Spent: 10m
Work Description: robertwb 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_r231032655
##########
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):
+ crc = crc32c_fn(value)
+ else:
+ crc = crc32c_fn(value.encode('utf-8'))
Review comment:
I think we _masked_crc32c should only accept bytes values (which is
consistent with the idea of checksumming and how all the other hash functions
work in Python). In the code below, we can encode value before it's passed to
this function (if we decide that writing unicode to tfrecordio is fine).
----------------------------------------------------------------
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: 162946)
Time Spent: 1h (was: 50m)
> 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
> 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)