This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 41480acd26d Mask the SQLite database path in airflow info --anonymize
(#73179)
41480acd26d is described below
commit 41480acd26db7ef2f8ff1eab724be9b0f0840374
Author: Y-C <[email protected]>
AuthorDate: Tue Sep 22 22:47:25 2026 +0800
Mask the SQLite database path in airflow info --anonymize (#73179)
The whole point of --anonymize is that the report is safe to paste into a
public bug report. SQLite is the default backend, so the people most likely
to rely on that promise are exactly the ones it was broken for.
Co-authored-by: Eason09053360
<[email protected]>
---
airflow-core/src/airflow/cli/commands/info_command.py | 5 ++++-
airflow-core/tests/unit/cli/commands/test_info_command.py | 8 ++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/cli/commands/info_command.py
b/airflow-core/src/airflow/cli/commands/info_command.py
index 4ec3255ec6e..f5d9f22e0c1 100644
--- a/airflow-core/src/airflow/cli/commands/info_command.py
+++ b/airflow-core/src/airflow/cli/commands/info_command.py
@@ -87,7 +87,6 @@ class PiiAnonymizer(Anonymizer):
return value
url_parts = urlsplit(value)
- netloc = None
if url_parts.netloc:
# unpack
userinfo = None
@@ -119,6 +118,10 @@ class PiiAnonymizer(Anonymizer):
netloc = host
else:
netloc = ""
+ else:
+ # A netloc-less URL is a local-file backend (SQLite is the
default), where
+ # the path itself is the identifying information.
+ return self.process_path(value)
return urlunsplit((url_parts.scheme, netloc, url_parts.path,
url_parts.query, url_parts.fragment))
diff --git a/airflow-core/tests/unit/cli/commands/test_info_command.py
b/airflow-core/tests/unit/cli/commands/test_info_command.py
index eff3501f6f4..7f1cba4d834 100644
--- a/airflow-core/tests/unit/cli/commands/test_info_command.py
+++ b/airflow-core/tests/unit/cli/commands/test_info_command.py
@@ -60,6 +60,14 @@ class TestPiiAnonymizer:
"postgresql+psycopg2://postgres/airflow",
"postgresql+psycopg2://postgres/airflow",
),
+ (
+ f"sqlite:///{os.path.expanduser('~/airflow/airflow.db')}",
+ "sqlite:///${HOME}/airflow/airflow.db",
+ ),
+ (
+ "sqlite:///relative.db",
+ "sqlite:///relative.db",
+ ),
],
)
def test_should_remove_pii_from_url(self, before, after):