Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# under the License.
from __future__ import annotations

import contextlib
import datetime
import functools
import io
Expand Down Expand Up @@ -1472,14 +1473,13 @@ def as_dict(
# if they are not provided through env, cmd and secret
hidden = "< hidden >"
for section, key in self.sensitive_config_values:
if not config_sources.get(section):
continue
if config_sources[section].get(key, None):
if display_source:
source = config_sources[section][key][1]
config_sources[section][key] = (hidden, source)
else:
config_sources[section][key] = hidden
if config_sources.get(section):
if config_sources[section].get(key, None):
if display_source:
source = config_sources[section][key][1]
config_sources[section][key] = (hidden, source)
else:
config_sources[section][key] = hidden

return config_sources

Expand Down Expand Up @@ -1649,16 +1649,13 @@ def _deprecated_value_is_set_in_config(
configs: Iterable[tuple[str, ConfigParser]],
) -> bool:
for config_type, config in configs:
if config_type == "default":
continue
try:
deprecated_section_array = config.items(section=deprecated_section, raw=True)
for key_candidate, _ in deprecated_section_array:
if key_candidate == deprecated_key:
if config_type != "default":
with contextlib.suppress(NoSectionError):
deprecated_section_array = config.items(section=deprecated_section, raw=True)
if any(key == deprecated_key for key, _ in deprecated_section_array):
return True
except NoSectionError:
pass
return False
else:
return False

@staticmethod
def _deprecated_variable_is_set(deprecated_section: str, deprecated_key: str) -> bool:
Expand Down