KevinGG commented on a change in pull request #13944:
URL: https://github.com/apache/beam/pull/13944#discussion_r575602039



##########
File path: 
sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py
##########
@@ -737,11 +738,15 @@ def __init__(self,
 
   def host_from_worker(self):
     # type: () -> str
-    if sys.platform == "darwin":
+    if sys.platform == 'darwin':
       # See https://docs.docker.com/docker-for-mac/networking/
       return 'host.docker.internal'
-    else:
-      return super(DockerSdkWorkerHandler, self).host_from_worker()
+    if sys.platform != 'win32' and is_in_notebook():

Review comment:
       You're right, it's not necessary if the code is not running inside a 
container. But it still works even if the code is not inside a container.
   
   The other thing we can check whether to enable this is through checking if 
the code is being executed in a docker container.
   But it feels so clunky and fragile to check that: 
https://stackoverflow.com/questions/43878953/how-does-one-detect-if-one-is-running-within-a-docker-container-within-python/43879407




----------------------------------------------------------------
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