You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/28 19:05:06 UTC

[GitHub] [airflow] potiuk commented on a diff in pull request #23335: Unify approach for user questions asked in Breeze

potiuk commented on code in PR #23335:
URL: https://github.com/apache/airflow/pull/23335#discussion_r861227623


##########
dev/breeze/src/airflow_breeze/commands/custom_param_types.py:
##########
@@ -53,6 +54,17 @@ def get_metavar(self, param) -> str:
         return f"[{choices_str}]"
 
 
+class AnswerChoice(BetterChoice):
+    """
+    Stores forced answer if it has been selected
+    """
+
+    name = "AnswerChoice"
+
+    def convert(self, value, param, ctx):
+        set_forced_answer(value)

Review Comment:
   This allowed us to remove manual "set_forced_answer" wherever `--answer` was used :)



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org