Skip to content

Commit ceed48c

Browse files
authored
Fix Portable PreCommit on 3.14 (#38033)
* Fix Portable PreCommit on 3.14 * linting
1 parent 295dc1c commit ceed48c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sdks/python/apache_beam/runners/portability/portable_runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,15 @@ def add_runner_options(parser):
144144
try:
145145
# no default values - we don't want runner options
146146
# added unless they were specified by the user
147-
add_arg_args = {'action': 'store', 'help': option.description}
147+
add_arg_args = {'action': 'store'}
148+
if option.description is not None:
149+
# Prevent bare %'s in help strings in 3.14+
150+
add_arg_args['help'] = option.description.replace("%", "%%")
148151
if option.type == beam_job_api_pb2.PipelineOptionType.BOOLEAN:
149152
add_arg_args['action'] = 'store_true' \
150153
if option.default_value != 'true' else 'store_false'
151154
elif option.type == beam_job_api_pb2.PipelineOptionType.INTEGER:
152-
add_arg_args['type'] = int
155+
add_arg_args['type'] = int # type: ignore
153156
elif option.type == beam_job_api_pb2.PipelineOptionType.ARRAY:
154157
add_arg_args['action'] = 'append'
155158
parser.add_argument("--%s" % option.name, **add_arg_args)

0 commit comments

Comments
 (0)