beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From al...@apache.org
Subject [1/2] beam git commit: [BEAM-1649] Fix unresolved references in Python SDK
Date Wed, 08 Mar 2017 18:42:42 GMT
Repository: beam
Updated Branches:
  refs/heads/master 1d8be9743 -> 29d9bd3e6


[BEAM-1649] Fix unresolved references in Python SDK


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/e6ec2731
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/e6ec2731
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/e6ec2731

Branch: refs/heads/master
Commit: e6ec2731bebea6e9c2a00b6010adc6607ad7a348
Parents: 1d8be974
Author: Tibor Kiss <tibor.kiss@gmail.com>
Authored: Wed Mar 8 12:18:39 2017 +0100
Committer: Ahmet Altay <altay@google.com>
Committed: Wed Mar 8 10:42:13 2017 -0800

----------------------------------------------------------------------
 sdks/python/apache_beam/io/range_trackers.py      | 2 +-
 sdks/python/apache_beam/transforms/trigger.py     | 2 +-
 sdks/python/apache_beam/typehints/decorators.py   | 5 ++---
 sdks/python/apache_beam/typehints/typehints.py    | 3 ++-
 sdks/python/apache_beam/utils/pipeline_options.py | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/e6ec2731/sdks/python/apache_beam/io/range_trackers.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/io/range_trackers.py b/sdks/python/apache_beam/io/range_trackers.py
index 059b6ca..8627f76 100644
--- a/sdks/python/apache_beam/io/range_trackers.py
+++ b/sdks/python/apache_beam/io/range_trackers.py
@@ -339,7 +339,7 @@ class OrderedPositionRangeTracker(iobase.RangeTracker):
 
   def stop_position(self):
     with self._lock:
-      return self._end_position
+      return self._stop_position
 
   def try_claim(self, position):
     with self._lock:

http://git-wip-us.apache.org/repos/asf/beam/blob/e6ec2731/sdks/python/apache_beam/transforms/trigger.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/transforms/trigger.py b/sdks/python/apache_beam/transforms/trigger.py
index 69a35ae..04198ba 100644
--- a/sdks/python/apache_beam/transforms/trigger.py
+++ b/sdks/python/apache_beam/transforms/trigger.py
@@ -63,7 +63,7 @@ class ValueStateTag(StateTag):
   """StateTag pointing to an element."""
 
   def __repr__(self):
-    return 'ValueStateTag(%s, %s)' % (self.tag, self.combine_fn)
+    return 'ValueStateTag(%s)' % (self.tag)
 
   def with_prefix(self, prefix):
     return ValueStateTag(prefix + self.tag)

http://git-wip-us.apache.org/repos/asf/beam/blob/e6ec2731/sdks/python/apache_beam/typehints/decorators.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/typehints/decorators.py b/sdks/python/apache_beam/typehints/decorators.py
index df15f1b..9ac9168 100644
--- a/sdks/python/apache_beam/typehints/decorators.py
+++ b/sdks/python/apache_beam/typehints/decorators.py
@@ -234,9 +234,8 @@ def _unpack_positional_arg_hints(arg, hint):
   if isinstance(arg, list):
     tuple_constraint = typehints.Tuple[[typehints.Any] * len(arg)]
     if not typehints.is_consistent_with(hint, tuple_constraint):
-      raise typehints.TypeCheckError(
-          'Bad tuple arguments for %s: expected %s, got %s' % (
-              arg, tuple_constraint, hint))
+      raise TypeCheckError('Bad tuple arguments for %s: expected %s, got %s' %
+                           (arg, tuple_constraint, hint))
     if isinstance(hint, typehints.TupleConstraint):
       return tuple(_unpack_positional_arg_hints(a, t)
                    for a, t in zip(arg, hint.tuple_types))

http://git-wip-us.apache.org/repos/asf/beam/blob/e6ec2731/sdks/python/apache_beam/typehints/typehints.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/typehints/typehints.py b/sdks/python/apache_beam/typehints/typehints.py
index d0ef60e..20f842a 100644
--- a/sdks/python/apache_beam/typehints/typehints.py
+++ b/sdks/python/apache_beam/typehints/typehints.py
@@ -994,7 +994,8 @@ class WindowedTypeConstraint(TypeConstraint):
           '%s hint type-constraint violated. The type of element in '
           'is incorrect. Expected an instance of type %s, '
           'instead received an instance of type %s.' %
-          (repr(self), _unified_repr(self.inner_type), elem.__class__.__name__))
+          (repr(self), _unified_repr(self.inner_type),
+           instance.value.__class__.__name__))
 
 
 class GeneratorHint(IteratorHint):

http://git-wip-us.apache.org/repos/asf/beam/blob/e6ec2731/sdks/python/apache_beam/utils/pipeline_options.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/utils/pipeline_options.py b/sdks/python/apache_beam/utils/pipeline_options.py
index 709808f..d07c328 100644
--- a/sdks/python/apache_beam/utils/pipeline_options.py
+++ b/sdks/python/apache_beam/utils/pipeline_options.py
@@ -158,7 +158,7 @@ class PipelineOptions(HasDisplayData):
     # Special methods which may be accessed before the object is
     # fully constructed (e.g. in unpickling).
     if name[:2] == name[-2:] == '__':
-      return object.__getattr__(self, name)
+      return object.__getattribute__(self, name)
     elif name in self._visible_option_list():
       return self._all_options.get(name, getattr(self._visible_options, name))
     else:


Mime
View raw message