You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/02/13 00:44:55 UTC

[GitHub] [beam] TheNeuralBit commented on a change in pull request #13944: [BEAM-10708] Support SqlTransform in container

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



##########
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:
       I'm not sure this is always necessary when running inside a notebook. I was able to run SqlTransform in a notebook for our demo last fall: https://gist.github.com/TheNeuralBit/9c79d71cbc90a962e795b80ca54fa3c8#file-simpler-python-pipelines-demo-ipynb
   
   It seems like this is necessary in your case because the IPython kernel is running inside a docker container, but that's not always true. In my case I was running the kernel directly on my desktop. Is there something else we can test here?

##########
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:
       Why the special case for windows?




----------------------------------------------------------------
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:
users@infra.apache.org