AnandInguva commented on a change in pull request #16929:
URL: https://github.com/apache/beam/pull/16929#discussion_r820316894



##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -234,12 +262,27 @@ def from_dictionary(cls, options):
 
     Returns:
       A PipelineOptions object representing the given arguments.
+
+    Note: If a boolean flag is True in the dictionary,
+          implicitly the method assumes the boolean flag is
+          specified as a command line argument. If the
+          boolean flag is False, this method simply discards
+          them.
+    Eg: {no_auth: True} is similar to python your_file.py --no_auth
+        {no_auth: False} is similar to python your_file.py.
     """
     flags = []
     for k, v in options.items():
       if isinstance(v, bool):
         if v:
           flags.append('--%s' % k)
+        # capture boolean flags with 3 values
+        # {default=None, True, False}
+        elif k in _STORE_FALSE_OPTIONS_WITH_DIFFERENT_DEST:
+          _LOGGER.warning(

Review comment:
       Removed warning

##########
File path: sdks/python/apache_beam/options/pipeline_options.py
##########
@@ -212,6 +231,15 @@ def __init__(self, flags=None, **kwargs):
     # Users access this dictionary store via __getattr__ / __setattr__ methods.
     self._all_options = kwargs
 
+    if self.__class__ != PipelineOptions:
+      _invalid_options = {}
+      for option_name, option_value in self._all_options.items():
+        if option_name not in self._visible_option_list():
+          _invalid_options[option_name] = option_value
+
+      if _invalid_options:
+        _LOGGER.warning("Discarding invalid overrides: %s", _invalid_options)

Review comment:
       Done




-- 
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]


Reply via email to