[
https://issues.apache.org/jira/browse/BEAM-3742?focusedWorklogId=194601&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-194601
]
ASF GitHub Bot logged work on BEAM-3742:
----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Feb/19 15:36
Start Date: 05/Feb/19 15:36
Worklog Time Spent: 10m
Work Description: robertwb commented on pull request #7722: [BEAM-3742]
Checkpointing for SDF over FnAPI in Python SDK and FnApiRunner.
URL: https://github.com/apache/beam/pull/7722#discussion_r253914524
##########
File path: sdks/python/apache_beam/runners/portability/fn_api_runner_test.py
##########
@@ -351,6 +352,43 @@ def is_buffered_correctly(actual):
assert_that(actual, is_buffered_correctly)
+ def test_sdf(self):
+
+ class ExpandStringsProvider(beam.transforms.core.RestrictionProvider):
+ def initial_restriction(self, element):
+ return (0, len(element))
+
+ def create_tracker(self, restriction):
+ return restriction_trackers.OffsetRestrictionTracker(
+ restriction[0], restriction[1])
+
+ def split(self, element, restriction):
+ start, end = restriction
+ middle = (end - start) // 2
+ return [(start, middle), (middle, end)]
+
+ class ExpandStringsDoFn(beam.DoFn):
+ def process(self, element, restriction_tracker=ExpandStringsProvider()):
+ assert isinstance(
+ restriction_tracker,
+ restriction_trackers.OffsetRestrictionTracker), restriction_tracker
+ for k in range(*restriction_tracker.current_restriction()):
+ if not restriction_tracker.try_claim(k):
+ return
+ yield element[k]
+ if k % 2 == 1:
+ restriction_tracker.defer_remainder()
+ break
Review comment:
Good catch. No good reason. Changed both to return.
----------------------------------------------------------------
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: 194601)
Time Spent: 1h 40m (was: 1.5h)
> Support for running a streaming SDF in Python SDK
> -------------------------------------------------
>
> Key: BEAM-3742
> URL: https://issues.apache.org/jira/browse/BEAM-3742
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-harness
> Reporter: Eugene Kirpichov
> Assignee: Chamikara Jayalath
> Priority: Major
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)