Skip to content

Commit f0c4f81

Browse files
damccormtvalentyn
andauthored
Disable argument abbreviation in Python (#34934)
* Disable argument abbreviation in Python * Grammar Co-authored-by: tvalentyn <[email protected]> --------- Co-authored-by: tvalentyn <[email protected]>
1 parent ced1afb commit f0c4f81

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
* X behavior was changed ([#X](https://github.com/apache/beam/issues/X)).
8686
* Yapf version upgraded to 0.43.0 for formatting (Python) ([#34801](https://github.com/apache/beam/pull/34801/)).
8787
* Python: Added JupyterLab 4.x extension compatibility for enhanced notebook integration ([#34495](https://github.com/apache/beam/pull/34495)).
88+
* Python: Argument abbreviation is no longer enabled within Beam. If you previously abbreviated arguments (e.g. `--r` for `--runner`), you will now need to specify the whole argument ([#34934](https://github.com/apache/beam/pull/34934)).
8889

8990
## Deprecations
9091

sdks/python/apache_beam/options/pipeline_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def __init__(self, flags: Optional[Sequence[str]] = None, **kwargs) -> None:
296296

297297
# Build parser that will parse options recognized by the [sub]class of
298298
# PipelineOptions whose object is being instantiated.
299-
parser = _BeamArgumentParser()
299+
parser = _BeamArgumentParser(allow_abbrev=False)
300300
for cls in type(self).mro():
301301
if cls == PipelineOptions:
302302
break
@@ -411,7 +411,7 @@ def get_all_options(
411411
# sub-classes in the main session might be repeated. Pick last unique
412412
# instance of each subclass to avoid conflicts.
413413
subset = {}
414-
parser = _BeamArgumentParser()
414+
parser = _BeamArgumentParser(allow_abbrev=False)
415415
for cls in PipelineOptions.__subclasses__():
416416
subset[str(cls)] = cls
417417
for cls in subset.values():

0 commit comments

Comments
 (0)