beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rober...@apache.org
Subject [5/6] incubator-beam git commit: Move explicit references to _NativeWrite.
Date Mon, 10 Oct 2016 19:05:14 GMT
Move explicit references to _NativeWrite.


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

Branch: refs/heads/python-sdk
Commit: 807013a963ecd9f1aaa8551508b2ef45be595380
Parents: e2dc685
Author: Robert Bradshaw <robertwb@google.com>
Authored: Thu Oct 6 17:10:07 2016 -0700
Committer: Robert Bradshaw <robertwb@google.com>
Committed: Mon Oct 10 10:30:00 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/io/iobase.py                        | 9 ++++-----
 .../apache_beam/runners/inprocess/transform_evaluator.py    | 5 +++--
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/807013a9/sdks/python/apache_beam/io/iobase.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/io/iobase.py b/sdks/python/apache_beam/io/iobase.py
index b83d7eb..f070b39 100644
--- a/sdks/python/apache_beam/io/iobase.py
+++ b/sdks/python/apache_beam/io/iobase.py
@@ -44,7 +44,6 @@ from apache_beam.transforms import ptransform
 from apache_beam.transforms import window
 
 from apache_beam.runners.dataflow.native_io.iobase import *
-from apache_beam.runners.dataflow.native_io.iobase import _NativeWrite
 
 
 # Encapsulates information about a bundle of a source generated when method
@@ -705,11 +704,11 @@ class Write(ptransform.PTransform):
     self.sink = sink
 
   def apply(self, pcoll):
-    from apache_beam.io import iobase
-    if isinstance(self.sink, iobase.NativeSink):
+    from apache_beam.runners.dataflow.native_io import iobase as native_iobase
+    if isinstance(self.sink, native_iobase.NativeSink):
       # A native sink
-      return pcoll | 'native_write' >> _NativeWrite(self.sink)
-    elif isinstance(self.sink, iobase.Sink):
+      return pcoll | 'native_write' >> native_iobase._NativeWrite(self.sink)
+    elif isinstance(self.sink, Sink):
       # A custom sink
       return pcoll | WriteImpl(self.sink)
     elif isinstance(self.sink, ptransform.PTransform):

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/807013a9/sdks/python/apache_beam/runners/inprocess/transform_evaluator.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/runners/inprocess/transform_evaluator.py b/sdks/python/apache_beam/runners/inprocess/transform_evaluator.py
index 9aeda46..7d9166c 100644
--- a/sdks/python/apache_beam/runners/inprocess/transform_evaluator.py
+++ b/sdks/python/apache_beam/runners/inprocess/transform_evaluator.py
@@ -29,6 +29,7 @@ from apache_beam.runners.common import DoFnRunner
 from apache_beam.runners.common import DoFnState
 from apache_beam.runners.inprocess.inprocess_watermark_manager import InProcessWatermarkManager
 from apache_beam.runners.inprocess.inprocess_transform_result import InProcessTransformResult
+from apache_beam.runners.dataflow.native_io.iobase import _NativeWrite  # pylint: disable=protected-access
 from apache_beam.transforms import core
 from apache_beam.transforms import sideinputs
 from apache_beam.transforms.window import GlobalWindows
@@ -54,7 +55,7 @@ class TransformEvaluatorRegistry(object):
         core.ParDo: _ParDoEvaluator,
         core.GroupByKeyOnly: _GroupByKeyOnlyEvaluator,
         sideinputs.CreatePCollectionView: _CreatePCollectionViewEvaluator,
-        io.iobase._NativeWrite: _NativeWriteEvaluator,  # pylint: disable=protected-access
+        _NativeWrite: _NativeWriteEvaluator,
     }
 
   def for_application(
@@ -98,7 +99,7 @@ class TransformEvaluatorRegistry(object):
     """
     return isinstance(applied_ptransform.transform,
                       (core.GroupByKeyOnly, sideinputs.CreatePCollectionView,
-                       io.iobase._NativeWrite))  # pylint: disable=protected-access
+                       _NativeWrite))
 
 
 class _TransformEvaluator(object):


Mime
View raw message