zhengdaodeguL opened a new pull request, #77377:
URL: https://github.com/apache/airflow/pull/77377
Fixes #77371
`ObjectStoragePath("abfs://...")` on Azure failed for wasb connections and
full-URL hosts. `get_fs()` in
`providers/microsoft/azure/src/airflow/providers/microsoft/azure/fs/adls.py`
always passed an `account_url` keyword to `adlfs.AzureBlobFileSystem` when no
connection string was present, but adlfs has no `account_url` parameter in its
`__init__` signature (it accepts `account_name`, `account_key`,
`connection_string`, `credential`, `sas_token`, `account_host`, ...), so the
keyword was swallowed by `**kwargs` and the account information was lost.
## Change
`get_fs()` still builds the account URL with the existing
`parse_blob_account_url(conn.host, conn.login)`, then derives `account_name`
from the first label of the URL's netloc and passes it to adlfs. If the host is
not the default `*.blob.core.windows.net`, it additionally passes
`account_host` (a keyword adlfs recognizes), preserving custom/private
endpoints. The connection-string path, service-principal handling,
password-to-account-key mapping, extras overrides, and `storage_options`
overrides are unchanged; `account_name`/`account_host` in extras can still
override the derived values.
## Verification
- New regression test `test_get_fs_account_information`
(`providers/microsoft/azure/tests/unit/microsoft/azure/fs/test_adls.py`, 4
parametrized cases: wasb-account-key, full-url-host, full-url-custom-host,
storage-options-override): all 4 FAIL before the fix and all 4 PASS after it.
- Full target file `test_adls.py`: 10 passed in 76.71s (6 pre-existing cases
with updated expectations + 4 new cases).
- `ruff format --check`: 2 files already formatted; `ruff check`: all checks
passed; `git diff --check`: clean.
Not verified locally: no real Azure end-to-end run (no account/network);
only the target test file was run, not the full microsoft-azure provider suite
or mypy; Breeze is unavailable on this machine (no Docker).
--
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]