diff --git a/sdks/python/apache_beam/runners/portability/portable_runner.py b/sdks/python/apache_beam/runners/portability/portable_runner.py index 94a467d5a249..b46ec75eb4ef 100644 --- a/sdks/python/apache_beam/runners/portability/portable_runner.py +++ b/sdks/python/apache_beam/runners/portability/portable_runner.py @@ -144,12 +144,15 @@ 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' 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)