[
https://issues.apache.org/jira/browse/BEAM-4006?focusedWorklogId=120944&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-120944
]
ASF GitHub Bot logged work on BEAM-4006:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Jul/18 18:07
Start Date: 09/Jul/18 18:07
Worklog Time Spent: 10m
Work Description: charlesccychen commented on a change in pull request
#5729: [BEAM-4006] Futurize transforms subpackage
URL: https://github.com/apache/beam/pull/5729#discussion_r201096467
##########
File path: sdks/python/apache_beam/transforms/util.py
##########
@@ -19,11 +19,17 @@
"""
from __future__ import absolute_import
+from __future__ import division
Review comment:
This change requires further changes in this file. In
`_BatchSizeEstimator._thin_data` on line 285, we need to explicitly cast to int
here; otherwise, we get the following error:
```
Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/dataflow_worker/batchworker.py", line
642, in do_work
work_executor.execute()
File "/usr/local/lib/python2.7/dist-packages/dataflow_worker/executor.py",
line 156, in execute
op.start()
File "dataflow_worker/native_operations.py", line 38, in
dataflow_worker.native_operations.NativeReadOperation.start
def start(self):
File "dataflow_worker/native_operations.py", line 39, in
dataflow_worker.native_operations.NativeReadOperation.start
with self.scoped_start_state:
File "dataflow_worker/native_operations.py", line 44, in
dataflow_worker.native_operations.NativeReadOperation.start
with self.spec.source.reader() as reader:
File "dataflow_worker/native_operations.py", line 54, in
dataflow_worker.native_operations.NativeReadOperation.start
self.output(windowed_value)
File "apache_beam/runners/worker/operations.py", line 175, in
apache_beam.runners.worker.operations.Operation.output
cython.cast(Receiver,
self.receivers[output_index]).receive(windowed_value)
File "apache_beam/runners/worker/operations.py", line 85, in
apache_beam.runners.worker.operations.ConsumerSet.receive
cython.cast(Operation, consumer).process(windowed_value)
File "apache_beam/runners/worker/operations.py", line 403, in
apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
File "apache_beam/runners/worker/operations.py", line 404, in
apache_beam.runners.worker.operations.DoOperation.process
self.dofn_receiver.receive(o)
File "apache_beam/runners/common.py", line 569, in
apache_beam.runners.common.DoFnRunner.receive
self.process(windowed_value)
File "apache_beam/runners/common.py", line 577, in
apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn)
File "apache_beam/runners/common.py", line 602, in
apache_beam.runners.common.DoFnRunner._reraise_augmented
raise
File "apache_beam/runners/common.py", line 575, in
apache_beam.runners.common.DoFnRunner.process
self.do_fn_invoker.invoke_process(windowed_value)
File "apache_beam/runners/common.py", line 352, in
apache_beam.runners.common.SimpleInvoker.invoke_process
output_processor.process_outputs(
File "apache_beam/runners/common.py", line 673, in
apache_beam.runners.common._OutputProcessor.process_outputs
self.main_receivers.receive(windowed_value)
File "apache_beam/runners/worker/operations.py", line 85, in
apache_beam.runners.worker.operations.ConsumerSet.receive
cython.cast(Operation, consumer).process(windowed_value)
File "apache_beam/runners/worker/operations.py", line 403, in
apache_beam.runners.worker.operations.DoOperation.process
with self.scoped_process_state:
File "apache_beam/runners/worker/operations.py", line 404, in
apache_beam.runners.worker.operations.DoOperation.process
self.dofn_receiver.receive(o)
File "apache_beam/runners/common.py", line 569, in
apache_beam.runners.common.DoFnRunner.receive
self.process(windowed_value)
File "apache_beam/runners/common.py", line 577, in
apache_beam.runners.common.DoFnRunner.process
self._reraise_augmented(exn)
File "apache_beam/runners/common.py", line 618, in
apache_beam.runners.common.DoFnRunner._reraise_augmented
six.reraise(type(new_exn), new_exn, original_traceback)
File "apache_beam/runners/common.py", line 575, in
apache_beam.runners.common.DoFnRunner.process
self.do_fn_invoker.invoke_process(windowed_value)
File "apache_beam/runners/common.py", line 352, in
apache_beam.runners.common.SimpleInvoker.invoke_process
output_processor.process_outputs(
File "apache_beam/runners/common.py", line 651, in
apache_beam.runners.common._OutputProcessor.process_outputs
for result in results:
File
"/usr/local/lib/python2.7/dist-packages/apache_beam/transforms/util.py", line
345, in process
yield self._batch
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File
"/usr/local/lib/python2.7/dist-packages/apache_beam/transforms/util.py", line
268, in record_time
self._thin_data()
File
"/usr/local/lib/python2.7/dist-packages/apache_beam/transforms/util.py", line
287, in _thin_data
+ odd_one_out)
TypeError: slice indices must be integers or None or have an __index__
method [while running
'Analyze/RunPhase[0]/BatchAnalyzerInputs/BatchElements/ParDo(_GlobalWindowsBatchingDoFn)']
```
----------------------------------------------------------------
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: 120944)
Time Spent: 4h 10m (was: 4h)
> Futurize and fix python 2 compatibility for transforms subpackage
> -----------------------------------------------------------------
>
> Key: BEAM-4006
> URL: https://issues.apache.org/jira/browse/BEAM-4006
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Reporter: Robbe
> Assignee: Matthias Feys
> Priority: Major
> Time Spent: 4h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)