This is an automated email from the ASF dual-hosted git repository. tvalentyn pushed a commit to branch tvalentyn-patch-1 in repository https://gitbox.apache.org/repos/asf/beam.git
commit afd281683b49753cc71d5283171353058a42f327 Author: tvalentyn <[email protected]> AuthorDate: Wed Jul 22 10:16:51 2026 -0700 Provide better error when beam plugin was supplied but wasn't staged. --- sdks/python/apache_beam/runners/worker/sdk_worker_main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/runners/worker/sdk_worker_main.py b/sdks/python/apache_beam/runners/worker/sdk_worker_main.py index 754a631eaf3..e21c423751b 100644 --- a/sdks/python/apache_beam/runners/worker/sdk_worker_main.py +++ b/sdks/python/apache_beam/runners/worker/sdk_worker_main.py @@ -57,17 +57,21 @@ def _import_beam_plugins(plugins): try: importlib.import_module(plugin) _LOGGER.debug('Imported beam-plugin %s', plugin) - except ImportError: + except ImportError as exc: + if '.' not in plugin: + _LOGGER.warning('Failed to import beam-plugin %s', plugin, exc_info=exc) + continue + try: _LOGGER.debug(( "Looks like %s is not a module. " - "Trying to import it assuming it's a class"), + "Trying to import it assuming it's a class."), plugin) module, _ = plugin.rsplit('.', 1) importlib.import_module(module) _LOGGER.debug('Imported %s for beam-plugin %s', module, plugin) - except ImportError as exc: - _LOGGER.warning('Failed to import beam-plugin %s', plugin, exc_info=exc) + except ImportError as fallback_exc: + _LOGGER.warning('Failed to import beam-plugin %s', plugin, exc_info=fallback_exc) def create_harness(environment, dry_run=False):
