Abacn commented on code in PR #36072:
URL: https://github.com/apache/beam/pull/36072#discussion_r2337259778
##########
sdks/python/apache_beam/options/pipeline_options.py:
##########
@@ -449,11 +450,31 @@ def from_dictionary(cls, options):
return cls(flags)
+ @staticmethod
+ def _warn_on_unknown_options(unknown_args, parser):
+ if not unknown_args:
+ return
+
+ all_known_options = [
+ opt for action in parser._actions for opt in action.option_strings
+ ]
+
+ for arg in unknown_args:
+ if not arg.startswith('--'):
+ continue
+ arg_name = arg.split('=', 1)[0]
+ suggestions = difflib.get_close_matches(arg_name, all_known_options)
+ msg = f"Unparseable argument: {arg}"
+ if suggestions:
+ msg += f". Did you mean '{suggestions[0]}'?"
+ _LOGGER.warning(msg)
Review Comment:
yeah, sorry, the latest commit no longer has "continue" clause. this LGTM
--
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]