tvalentyn commented on code in PR #37101:
URL: https://github.com/apache/beam/pull/37101#discussion_r2615944434
##########
sdks/python/apache_beam/options/pipeline_options.py:
##########
@@ -510,8 +514,13 @@ def get_all_options(
# instance of each subclass to avoid conflicts.
subset = {}
parser = _BeamArgumentParser(allow_abbrev=False)
- for cls in PipelineOptions.__subclasses__():
- subset.setdefault(str(cls), cls)
+ if not hierarchy_only:
Review Comment:
i think it would read easier if we reverse the order of conditions (`if
hierarchy_only: ...`)
##########
sdks/python/apache_beam/options/pipeline_options.py:
##########
@@ -500,6 +501,9 @@ def get_all_options(
retain_unknown_options: If set to true, options not recognized by any
known pipeline options class will still be included in the result. If
set to false, they will be discarded.
+ hierarchy_only: If set to true, only returns options defined in this
class
+ and its super classes only. Otherwise, arguments that are defined in
Review Comment:
Do we have use-cases for is returning options from superclasses? would it be
sufficient to return only options defined in the current class?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]