TheNeuralBit commented on a change in pull request #16920:
URL: https://github.com/apache/beam/pull/16920#discussion_r818014458
##########
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:
Yeah I think it makes sense to err on the side of caution here and make
this fatal. We could continue with pipeline execution, but it seems likely the
pipeline would fail for a different reason, or behave differently.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]