You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2019/05/06 15:14:30 UTC

[beam] branch master updated: Adding PyDoc to CombiningValueStateSpec (#8477)

This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 9192ac9  Adding PyDoc to CombiningValueStateSpec (#8477)
9192ac9 is described below

commit 9192ac9cb2095e9b181d1a7ddd0e2a7c6d23c260
Author: Pablo <pa...@users.noreply.github.com>
AuthorDate: Mon May 6 08:14:15 2019 -0700

    Adding PyDoc to CombiningValueStateSpec (#8477)
    
    * Adding PyDoc to CombiningValueStateSpec
    
    * Coder type. Fix.
---
 sdks/python/apache_beam/transforms/userstate.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/transforms/userstate.py b/sdks/python/apache_beam/transforms/userstate.py
index 6d98ec4..aa4e866 100644
--- a/sdks/python/apache_beam/transforms/userstate.py
+++ b/sdks/python/apache_beam/transforms/userstate.py
@@ -64,9 +64,22 @@ class CombiningValueStateSpec(StateSpec):
   """Specification for a user DoFn combining value state cell."""
 
   def __init__(self, name, coder=None, combine_fn=None):
+    """Initialize the specification for CombiningValue state.
+
+    CombiningValueStateSpec(name, combine_fn) -> Coder-inferred combining value
+      state spec.
+    CombiningValueStateSpec(name, coder, combine_fn) -> Combining value state
+      spec with coder and combine_fn specified.
+
+    Args:
+      name (str): The name by which the state is identified.
+      coder (Coder): Coder specifying how to encode the values to be combined.
+        May be inferred.
+      combine_fn (``CombineFn`` or ``callable``): Function specifying how to
+        combine the values passed to state.
+    """
     # Avoid circular import.
     from apache_beam.transforms.core import CombineFn
-
     # We want the coder to be optional, but unfortunately it comes
     # before the non-optional combine_fn parameter, which we can't
     # change for backwards compatibility reasons.