[
https://issues.apache.org/jira/browse/BEAM-6115?focusedWorklogId=169028&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-169028
]
ASF GitHub Bot logged work on BEAM-6115:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Nov/18 11:16
Start Date: 23/Nov/18 11:16
Worklog Time Spent: 10m
Work Description: lgajowy closed pull request #7123: [BEAM-6115]
SyntheticSource bundle size parameter sometimes should be casted to int
URL: https://github.com/apache/beam/pull/7123
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/sdks/python/apache_beam/testing/synthetic_pipeline.py
b/sdks/python/apache_beam/testing/synthetic_pipeline.py
index c76b9cd6904..2f8980b82c0 100644
--- a/sdks/python/apache_beam/testing/synthetic_pipeline.py
+++ b/sdks/python/apache_beam/testing/synthetic_pipeline.py
@@ -210,12 +210,13 @@ def split(self, desired_bundle_size, start_position=0,
stop_position=None):
index += 1
else:
if self._initial_splitting_num_bundles:
- bundle_size_in_elements = max(1, self._num_records /
- self._initial_splitting_num_bundles)
+ bundle_size_in_elements = max(1, int(
+ self._num_records /
+ self._initial_splitting_num_bundles))
else:
bundle_size_in_elements = (max(
div_round_up(desired_bundle_size, self.element_size),
- math.floor(math.sqrt(self._num_records))))
+ int(math.floor(math.sqrt(self._num_records)))))
bundle_ranges = []
for start in range(start_position, stop_position,
bundle_size_in_elements):
----------------------------------------------------------------
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: 169028)
Time Spent: 0.5h (was: 20m)
> SyntheticSource bundle size parameter sometimes is casted to invalid type
> -------------------------------------------------------------------------
>
> Key: BEAM-6115
> URL: https://issues.apache.org/jira/browse/BEAM-6115
> Project: Beam
> Issue Type: Bug
> Components: testing
> Reporter: Kasia Kucharczyk
> Assignee: Kasia Kucharczyk
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The parameter {code}bundle_size_in_elements{code} in SyntheticSources in
> Python in specific situations becomes `float` instead of `int` what causes
> failure on Dataflow:
> {code:java}
> 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 198, in execute
> self._split_task)
> File "/usr/local/lib/python2.7/dist-packages/dataflow_worker/executor.py",
> line 206, in _perform_source_split_considering_api_limits
> desired_bundle_size)
> File "/usr/local/lib/python2.7/dist-packages/dataflow_worker/executor.py",
> line 243, in _perform_source_split
> for split in source.split(desired_bundle_size):
> File
> "/usr/local/lib/python2.7/dist-packages/apache_beam/testing/synthetic_pipeline.py",
> line 222, in split
> bundle_size_in_elements):
> TypeError: range() integer step argument expected, got float.{code}
>
> Debugging showed that on Dataflow following line causes this problem (line
> 213-214):
> {code:python}max(1, self._num_records /
> self._initial_splitting_num_bundles){code}.
> In line 218, there is:
> {code:python}math.floor(math.sqrt(self._num_records)){code} which also
> returns float.
> In 222 line _bundle_size_in_elements_ is used to _range_ method which
> requires _int_.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)