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/10/29 15:44:44 UTC

[GitHub] [airflow] pierrejeambrun commented on a diff in pull request #27366: Fix coertion for VERBOSE and DRY_RUN env variables

pierrejeambrun commented on code in PR #27366:
URL: https://github.com/apache/airflow/pull/27366#discussion_r1008720461


##########
dev/breeze/src/airflow_breeze/utils/shared_options.py:
##########
@@ -19,7 +19,15 @@
 
 import os
 
-__verbose_value: bool = os.environ.get("VERBOSE", "false")[0].lower() == "t"
+
+def __get_default_bool_value(env_var: str) -> bool:
+    string_val = os.environ.get(env_var, "")
+    if not string_val:  # handle "" and other false-y coerce-able values
+        return False
+    return string_val[0].lower() in ["t", "y"]  # handle all kinds of truth-y/yes-y/false-y/non-sy strings

Review Comment:
   is it possible to call `_coerce_bool_value` from here to not duplicate these lines ?



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