beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (BEAM-5264) Reference DirectRunner implementation of Python user state and timers API
Date Mon, 03 Sep 2018 15:07:10 GMT


ASF GitHub Bot logged work on BEAM-5264:

                Author: ASF GitHub Bot
            Created on: 03/Sep/18 15:06
            Start Date: 03/Sep/18 15:06
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #6304: [BEAM-5264]
Reference DirectRunner implementation of Python User State and Timers API

 File path: sdks/python/apache_beam/runners/direct/
 @@ -0,0 +1,246 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Unit tests for user state and timers on the BundleBasedDirectRunner."""
+from __future__ import absolute_import
+import unittest
+import apache_beam as beam
+from apache_beam.coders import BytesCoder
+from apache_beam.coders import IterableCoder
+from apache_beam.coders import VarIntCoder
+from apache_beam.testing.test_pipeline import TestPipeline
+from apache_beam.testing.test_stream import TestStream
+from apache_beam.transforms.combiners import ToListCombineFn
+from apache_beam.transforms.core import DoFn
+from apache_beam.transforms.timeutil import TimeDomain
+from apache_beam.transforms.userstate import BagStateSpec
+from apache_beam.transforms.userstate import CombiningValueStateSpec
+from apache_beam.transforms.userstate import TimerSpec
+from apache_beam.transforms.userstate import on_timer
+class StatefulDoFnOnDirectRunnerTest(unittest.TestCase):
+  # pylint: disable=expression-not-assigned
+  all_records = None
+  def setUp(self):
+    # Use state on the TestCase class, since other references would be pickled
+    # into a closure and not have the desired side effects.
+    StatefulDoFnOnDirectRunnerTest.all_records = []
 Review comment:
   Any reason we can't use the standard assert_that? 

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:

Issue Time Tracking

    Worklog Id:     (was: 140608)

> Reference DirectRunner implementation of Python user state and timers API
> -------------------------------------------------------------------------
>                 Key: BEAM-5264
>                 URL:
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>    Affects Versions: 2.6.0
>            Reporter: Charles Chen
>            Assignee: Charles Chen
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
> This issue tracks the reference DirectRunner implementation of the Beam Python User
State and Timer API, described here: [].

This message was sent by Atlassian JIRA

View raw message