[
https://issues.apache.org/jira/browse/BEAM-5720?focusedWorklogId=154219&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-154219
]
ASF GitHub Bot logged work on BEAM-5720:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Oct/18 08:58
Start Date: 15/Oct/18 08:58
Worklog Time Spent: 10m
Work Description: robertwb commented on a change in pull request #6659:
[BEAM-5720] Fix encoding of large python ints in Python 3.
URL: https://github.com/apache/beam/pull/6659#discussion_r225082999
##########
File path: sdks/python/apache_beam/coders/coder_impl.pxd
##########
@@ -69,8 +69,9 @@ cdef class DeterministicFastPrimitivesCoderImpl(CoderImpl):
cdef object NoneType
-cdef char UNKNOWN_TYPE, NONE_TYPE, INT_TYPE, FLOAT_TYPE, BOOL_TYPE
-cdef char BYTES_TYPE, UNICODE_TYPE, LIST_TYPE, TUPLE_TYPE, DICT_TYPE, SET_TYPE
+cdef unsigned char UNKNOWN_TYPE, NONE_TYPE, INT_TYPE, FLOAT_TYPE, BOOL_TYPE
Review comment:
Previously the decoder put the "decode via fallback" in an else clause. I
tightened this up to require the tag to be UNKNOWN_TYPE throwing an exception
if an invalid tag was given, but this exposed the fact that 0xFF upcasts to int
differently depending on whether char is signed or unsigned. This make it more
explicit and consistent with stream.read_byte().
----------------------------------------------------------------
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: 154219)
Time Spent: 1h 20m (was: 1h 10m)
> Default coder breaks with large ints on Python 3
> ------------------------------------------------
>
> Key: BEAM-5720
> URL: https://issues.apache.org/jira/browse/BEAM-5720
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Reporter: Robert Bradshaw
> Assignee: Robert Bradshaw
> Priority: Minor
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> The test for `int` includes greater than 64-bit values, which causes an
> overflow error later in the code. We need to only use that coding scheme for
> machine-sized ints.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)