[ 
https://issues.apache.org/jira/browse/BEAM-4594?focusedWorklogId=118454&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-118454
 ]

ASF GitHub Bot logged work on BEAM-4594:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jul/18 22:23
            Start Date: 02/Jul/18 22:23
    Worklog Time Spent: 10m 
      Work Description: charlesccychen commented on a change in pull request 
#5691: [BEAM-4594] Beam Python state and timers user-facing API
URL: https://github.com/apache/beam/pull/5691#discussion_r199606238
 
 

 ##########
 File path: sdks/python/apache_beam/runners/common.py
 ##########
 @@ -207,18 +208,29 @@ def _validate(self):
     self._validate_process()
     self._validate_bundle_method(self.start_bundle_method)
     self._validate_bundle_method(self.finish_bundle_method)
+    self._validate_stateful_dofn()
 
   def _validate_process(self):
     """Validate that none of the DoFnParameters are repeated in the function
     """
-    for param in core.DoFn.DoFnParams:
-      assert self.process_method.defaults.count(param) <= 1
+    param_ids = list(d.param_id for d in self.process_method.defaults
+                     if isinstance(d, core._DoFnParam))
+    if len(param_ids) != len(set(param_ids)):
+      raise ValueError(
+          'DoFn %r has duplicate process method parameters: %s.' % (
+              self.do_fn, param_ids))
 
   def _validate_bundle_method(self, method_wrapper):
     """Validate that none of the DoFnParameters are used in the function
     """
-    for param in core.DoFn.DoFnParams:
-      assert param not in method_wrapper.defaults
+    for param in core.DoFn.DoFnProcessParams:
+      if param in method_wrapper.defaults:
+        raise ValueError(
+            'DoFn.process() method-only parameters cannot be used in %s.' %
 
 Review comment:
   Done.

----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 118454)
    Time Spent: 3.5h  (was: 3h 20m)

> Implement Beam Python User State and Timer API
> ----------------------------------------------
>
>                 Key: BEAM-4594
>                 URL: https://issues.apache.org/jira/browse/BEAM-4594
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py-core
>            Reporter: Charles Chen
>            Assignee: Charles Chen
>            Priority: Major
>              Labels: portability
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> This issue tracks the implementation of the Beam Python User State and Timer 
> API, described here: [https://s.apache.org/beam-python-user-state-and-timers].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to