This is an automated email from the ASF dual-hosted git repository.

tvalentyn pushed a commit to branch tvalentyn-patch-2
in repository https://gitbox.apache.org/repos/asf/beam.git

commit aa83055428d79c1c66fecae014869dba00e01bd8
Author: tvalentyn <[email protected]>
AuthorDate: Fri Oct 31 14:30:16 2025 -0700

    When more than one instance of the same PipelineOption subclass is 
detected, use the first one.
---
 sdks/python/apache_beam/options/pipeline_options.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/options/pipeline_options.py 
b/sdks/python/apache_beam/options/pipeline_options.py
index 57056b395f6..be9f530ffdc 100644
--- a/sdks/python/apache_beam/options/pipeline_options.py
+++ b/sdks/python/apache_beam/options/pipeline_options.py
@@ -508,7 +508,7 @@ class PipelineOptions(HasDisplayData):
     subset = {}
     parser = _BeamArgumentParser(allow_abbrev=False)
     for cls in PipelineOptions.__subclasses__():
-      subset[str(cls)] = cls
+      subset.setdefault(str(cls), cls)
     for cls in subset.values():
       cls._add_argparse_args(parser)  # pylint: disable=protected-access
     if add_extra_args_fn:

Reply via email to