Skip to content

Commit

Permalink
Add warning for unknown pipeline options (#29474)
Browse files Browse the repository at this point in the history
* add warning for unknown args

* bulk print warnings
  • Loading branch information
riteshghorse authored Nov 28, 2023
1 parent 86f711b commit 29cd0aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdks/python/apache_beam/options/pipeline_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@


def _static_value_provider_of(value_type):
""""Helper function to plug a ValueProvider into argparse.
"""Helper function to plug a ValueProvider into argparse.
Args:
value_type: the type of the value. Since the type param of argparse's
Expand Down Expand Up @@ -334,6 +334,10 @@ def get_all_options(

known_args, unknown_args = parser.parse_known_args(self._flags)
if retain_unknown_options:
if unknown_args:
_LOGGER.warning(
'Unknown pipeline options received: %s. Ignore if flags are '
'used for internal purposes.' % (','.join(unknown_args)))
i = 0
while i < len(unknown_args):
# Treat all unary flags as booleans, and all binary argument values as
Expand Down

0 comments on commit 29cd0aa

Please sign in to comment.