henry3260 opened a new pull request, #73603:
URL: https://github.com/apache/airflow/pull/73603
Backport of #73599 to `v3-3-test` (cherry-pick of `8b4e4df`), together with
its parent #73179 (cherry-pick of `41480ac`).
## Why both commits
#73599 only fixes a defect introduced by #73179, and #73179 was never
backported — `v3-3-test` has no netloc-less branch in
`PiiAnonymizer.process_url` at all, so #73599 does not apply on its own.
Cherry-picking both gives 3.3 the SQLite path masking in its already-corrected
form:
- #73179 — `airflow info --anonymize` leaked the full SQLite database path
(the default backend), because a netloc-less URL was returned verbatim.
- #73599 — that masking handed the whole value to `process_path`, whose
username substitution is an unanchored substring replacement, so an OS username
that is a substring of the scheme corrupted the scheme itself (`sqlite:` →
`sq${USER}:` for a user named `lite`). The netloc-less branch now splits on the
first colon and masks only what follows.
## Conflict resolution
Only `airflow-core/tests/unit/cli/commands/test_info_command.py` conflicted,
and only in the import block: #73599's diff adds `from unittest import mock`
next to a `from io import StringIO` that does not exist on `v3-3-test`.
Resolved by keeping the branch's existing imports — `v3-3-test` already imports
`mock`, so no import change was needed. Both commits' source and test changes
applied otherwise unchanged.
Verified with `uv run --project airflow-core pytest
airflow-core/tests/unit/cli/commands/test_info_command.py::TestPiiAnonymizer` —
10 passed.
Note: the `generate-airflowctl-datamodels` pre-push hook fails on this
branch by rewriting `uv.lock` (`3.3.1` → `3.3.2`); that drift is pre-existing
on `v3-3-test` and unrelated to this change, so `uv.lock` is left untouched
here.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5)
Generated-by: Claude Code (Opus 5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]