TheNeuralBit commented on a change in pull request #13335:
URL: https://github.com/apache/beam/pull/13335#discussion_r529889217



##########
File path: sdks/python/apache_beam/pipeline.py
##########
@@ -504,10 +504,12 @@ def run(self, test_runner_api='AUTO'):
       if test_runner_api == 'AUTO':
         # Don't pay the cost of a round-trip if we're going to be going through
         # the FnApi anyway...
+        # The InteractiveRunner relies a constant pipeline reference, skip it.
         test_runner_api = (
             not self.runner.is_fnapi_compatible() and (
                 self.runner.__class__.__name__ != 'SwitchingDirectRunner' or
-                self._options.view_as(StandardOptions).streaming))
+                self._options.view_as(StandardOptions).streaming) and
+            self.runner.__class__.__name__ != 'InteractiveRunner')

Review comment:
       The SwitchingDirectRunner case is a little different since its checking 
for a specific case where that runner will use the Fn API. 
   
   If there's no way to avoid the need for a constant pipeline reference I 
think this is ok (I think we're getting rid of this roundtrip soon anyway), but 
let's break this into separate booleans for clarity, something like:
   
   ```py
   is_fnapi_compatible = self.runner.is_fnapi_compatible() or (
                   # DirectRunner uses the Fn API for batch only
                   self.runner.__class__.__name__ == 'SwitchingDirectRunner' and
                   not self._options.view_as(StandardOptions).streaming)
   
   test_runner_api = (not is_fn_api_compatible or 
                      self.runner.__class__.__name__ == 'InteractiveRunner')
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to