From aef283465a59d6a1b19ba511e660fb1e1f2a9b88 Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Wed, 1 Apr 2026 19:00:25 +0000 Subject: [PATCH 1/2] Fix Portable PreCommit on 3.14 --- .../apache_beam/runners/portability/portable_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/runners/portability/portable_runner.py b/sdks/python/apache_beam/runners/portability/portable_runner.py index 94a467d5a249..72a97d2f8c43 100644 --- a/sdks/python/apache_beam/runners/portability/portable_runner.py +++ b/sdks/python/apache_beam/runners/portability/portable_runner.py @@ -144,7 +144,10 @@ def add_runner_options(parser): try: # no default values - we don't want runner options # added unless they were specified by the user - add_arg_args = {'action': 'store', 'help': option.description} + add_arg_args = {'action': 'store'} + if option.description is not None: + # Prevent bare %'s in help strings in 3.14+ + add_arg_args['help'] = option.description.replace("%", "%%") if option.type == beam_job_api_pb2.PipelineOptionType.BOOLEAN: add_arg_args['action'] = 'store_true' \ if option.default_value != 'true' else 'store_false' From 9b7e8558eea773b25117dafe14c5a64ce812bd06 Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Wed, 1 Apr 2026 20:21:00 +0000 Subject: [PATCH 2/2] linting --- sdks/python/apache_beam/runners/portability/portable_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/runners/portability/portable_runner.py b/sdks/python/apache_beam/runners/portability/portable_runner.py index 72a97d2f8c43..b46ec75eb4ef 100644 --- a/sdks/python/apache_beam/runners/portability/portable_runner.py +++ b/sdks/python/apache_beam/runners/portability/portable_runner.py @@ -152,7 +152,7 @@ def add_runner_options(parser): add_arg_args['action'] = 'store_true' \ if option.default_value != 'true' else 'store_false' elif option.type == beam_job_api_pb2.PipelineOptionType.INTEGER: - add_arg_args['type'] = int + add_arg_args['type'] = int # type: ignore elif option.type == beam_job_api_pb2.PipelineOptionType.ARRAY: add_arg_args['action'] = 'append' parser.add_argument("--%s" % option.name, **add_arg_args)