diff --git a/airflow/models/dag.py b/airflow/models/dag.py index 1cb9220e58cac..0371ed9192c4d 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -507,7 +507,7 @@ def __init__( tzinfo = None if date.tzinfo else settings.TIMEZONE tz = pendulum.instance(date, tz=tzinfo).timezone - self.timezone = tz or settings.TIMEZONE + self.timezone: Timezone = tz or settings.TIMEZONE # Apply the timezone we settled on to end_date if it wasn't supplied if "end_date" in self.default_args and self.default_args["end_date"]: @@ -607,9 +607,9 @@ def __init__( f"Invalid values of dag.orientation: only support " f"{ORIENTATION_PRESETS}, but get {orientation}" ) - self.catchup = catchup + self.catchup: bool = catchup - self.partial = False + self.partial: bool = False self.on_success_callback = on_success_callback self.on_failure_callback = on_failure_callback @@ -627,7 +627,7 @@ def __init__( self.is_paused_upon_creation = is_paused_upon_creation self.auto_register = auto_register - self.fail_stop = fail_stop + self.fail_stop: bool = fail_stop self.jinja_environment_kwargs = jinja_environment_kwargs self.render_template_as_native_obj = render_template_as_native_obj diff --git a/airflow/settings.py b/airflow/settings.py index e51cd208d9f74..0b56268acb962 100644 --- a/airflow/settings.py +++ b/airflow/settings.py @@ -568,12 +568,12 @@ def initialize(): # By default Airflow plugins are lazily-loaded (only loaded when required). Set it to False, # if you want to load plugins whenever 'airflow' is invoked via cli or loaded from module. -LAZY_LOAD_PLUGINS = conf.getboolean("core", "lazy_load_plugins", fallback=True) +LAZY_LOAD_PLUGINS: bool = conf.getboolean("core", "lazy_load_plugins", fallback=True) # By default Airflow providers are lazily-discovered (discovery and imports happen only when required). # Set it to False, if you want to discover providers whenever 'airflow' is invoked via cli or # loaded from module. -LAZY_LOAD_PROVIDERS = conf.getboolean("core", "lazy_discover_providers", fallback=True) +LAZY_LOAD_PROVIDERS: bool = conf.getboolean("core", "lazy_discover_providers", fallback=True) # Determines if the executor utilizes Kubernetes IS_K8S_OR_K8SCELERY_EXECUTOR = conf.get("core", "EXECUTOR") in { @@ -613,4 +613,10 @@ def initialize(): # AIP-44: internal_api (experimental) # This feature is not complete yet, so we disable it by default. -_ENABLE_AIP_44 = os.environ.get("AIRFLOW_ENABLE_AIP_44", "false").lower() in {"true", "t", "yes", "y", "1"} +_ENABLE_AIP_44: bool = os.environ.get("AIRFLOW_ENABLE_AIP_44", "false").lower() in { + "true", + "t", + "yes", + "y", + "1", +}