PCTEJA opened a new pull request, #77376:
URL: https://github.com/apache/airflow/pull/77376
closes: #77371
`get_fs()` in the Microsoft Azure provider passed `account_url` to
`adlfs.AzureBlobFileSystem`, which has no such parameter and silently drops it,
so any connection whose account is known only through `host` or `login` failed
with `ValueError: Must provide either a connection_string or account_name with
credentials!!`. That broke `ObjectStoragePath("abfs://...")` for wasb
shared-key connections, service-principal connections with the account URL in
`host`, and adls connections with a full endpoint in `host`, while the same
connections work with the hooks.
This derives the parameters adlfs actually reads from the URL
`parse_blob_account_url` already computes:
* `account_name` from the first label of the URL host, and `account_host`
from its netloc, when the host is an actual endpoint (contains a dot).
* `account_name` from a bare login (the wasb shared-key shape), with no
`account_host`, so adlfs builds the default endpoint from the effective account
name.
* Nothing when the login is a service principal client id (tenant id set)
and there is no endpoint host, so `account_name` still comes from extras or the
`AZURE_STORAGE_ACCOUNT_NAME` env var.
The extras overlay and `storage_options` still run last, so an explicit
`account_name` or `account_host` wins, and the connection-string path is
unchanged.
Tests: the mocked `test_get_fs` expectations now assert
`account_name`/`account_host` instead of `account_url`, with new cases for the
service-principal shapes above. A new `test_get_fs_with_real_filesystem` builds
the real `AzureBlobFileSystem` for the shared-key and full-URL connections, so
a keyword adlfs drops cannot pass unnoticed again.
`providers/microsoft/azure/tests/unit/microsoft/azure/fs/test_adls.py`: 11
passed; on unpatched main the changed cases fail (9 failed, only the
connection-string case still passes).
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — ChatGPT Astra
Generated-by: ChatGPT Astra following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
* Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
--
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]