You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/03/01 18:10:00 UTC

[jira] [Work logged] (BEAM-13993) Python portable SDK harness does not import beam_plugins at startup

     [ https://issues.apache.org/jira/browse/BEAM-13993?focusedWorklogId=734832&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-734832 ]

ASF GitHub Bot logged work on BEAM-13993:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Mar/22 18:09
            Start Date: 01/Mar/22 18:09
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #16920:
URL: https://github.com/apache/beam/pull/16920#discussion_r817021396



##########
File path: sdks/python/apache_beam/runners/worker/sdk_worker_main.py
##########
@@ -48,6 +49,31 @@
 _ENABLE_GOOGLE_CLOUD_PROFILER = 'enable_google_cloud_profiler'
 
 
+def _import_beam_plugins(plugins):
+  for plugin in plugins:
+    try:
+      importlib.import_module(plugin)
+      _LOGGER.info('Imported beam-plugin %s', plugin)
+    except ImportError:
+      try:
+        _LOGGER.debug(
+          (
+            "Looks like %s is not a module. "
+            "Trying to import it assuming it's a class"
+          ),
+          plugin
+        )
+        module, _ = plugin.rsplit('.', 1)
+        importlib.import_module(module)
+        _LOGGER.info('Imported %s for beam-plugin %s', module, plugin)
+      except ImportError:
+        _LOGGER.warning(

Review comment:
       Should this instead be a fatal error?




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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 734832)
    Time Spent: 1h 10m  (was: 1h)

> Python portable SDK harness does not import beam_plugins at startup
> -------------------------------------------------------------------
>
>                 Key: BEAM-13993
>                 URL: https://issues.apache.org/jira/browse/BEAM-13993
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-harness
>            Reporter: Steve Niemitz
>            Assignee: Steve Niemitz
>            Priority: P2
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Currently on the portable runner `–beam_plugins` is ignored.  They should instead be imported on SDK harness startup.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)