This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new f0c4f814c2e Disable argument abbreviation in Python (#34934)
f0c4f814c2e is described below
commit f0c4f814c2e672a1fbd1c2b828433907c72ee465
Author: Danny McCormick <[email protected]>
AuthorDate: Thu May 15 10:02:14 2025 -0400
Disable argument abbreviation in Python (#34934)
* Disable argument abbreviation in Python
* Grammar
Co-authored-by: tvalentyn <[email protected]>
---------
Co-authored-by: tvalentyn <[email protected]>
---
CHANGES.md | 1 +
sdks/python/apache_beam/options/pipeline_options.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 7f5d38b4cf4..6c9d9e7c6b7 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -85,6 +85,7 @@
* X behavior was changed ([#X](https://github.com/apache/beam/issues/X)).
* Yapf version upgraded to 0.43.0 for formatting (Python)
([#34801](https://github.com/apache/beam/pull/34801/)).
* Python: Added JupyterLab 4.x extension compatibility for enhanced notebook
integration ([#34495](https://github.com/apache/beam/pull/34495)).
+* 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)).
## Deprecations
diff --git a/sdks/python/apache_beam/options/pipeline_options.py
b/sdks/python/apache_beam/options/pipeline_options.py
index 1b9b560099a..62cd8dba637 100644
--- a/sdks/python/apache_beam/options/pipeline_options.py
+++ b/sdks/python/apache_beam/options/pipeline_options.py
@@ -296,7 +296,7 @@ class PipelineOptions(HasDisplayData):
# Build parser that will parse options recognized by the [sub]class of
# PipelineOptions whose object is being instantiated.
- parser = _BeamArgumentParser()
+ parser = _BeamArgumentParser(allow_abbrev=False)
for cls in type(self).mro():
if cls == PipelineOptions:
break
@@ -411,7 +411,7 @@ class PipelineOptions(HasDisplayData):
# sub-classes in the main session might be repeated. Pick last unique
# instance of each subclass to avoid conflicts.
subset = {}
- parser = _BeamArgumentParser()
+ parser = _BeamArgumentParser(allow_abbrev=False)
for cls in PipelineOptions.__subclasses__():
subset[str(cls)] = cls
for cls in subset.values():