pankajastro commented on code in PR #73374:
URL: https://github.com/apache/airflow/pull/73374#discussion_r4091708406
##########
providers/common/sql/src/airflow/providers/common/sql/datafusion/object_storage_provider.py:
##########
@@ -107,6 +107,37 @@ def get_scheme(self) -> str:
return "gs://"
+class AzureObjectStorageProvider(ObjectStorageProvider):
+ """Azure Object Storage Provider using DataFusion's MicrosoftAzure."""
+
+ @property
+ def get_storage_type(self) -> StorageType:
+ """Return the storage type."""
+ return StorageType.AZURE
+
+ def create_object_store(self, path: str, connection_config:
ConnectionConfig | None = None):
+ """Create an Azure object store using DataFusion's MicrosoftAzure."""
+ if connection_config is None:
+ raise ValueError(f"connection_config must be provided for
{self.get_storage_type.value}")
+
+ try:
+ credentials = connection_config.credentials
+ container = self.get_bucket(path)
+
+ azure_store = MicrosoftAzure(container_name=container,
**credentials)
+ self.log.info("Created Azure object store for container %s",
container)
+
+ return azure_store
+
+ except BaseException as e:
Review Comment:
Kept intentionally — matches GCS's identical pattern one class up, for the
same reason: a bad credential combination panics as
`pyo3_runtime.PanicException` here too (confirmed in review above for the
partial service-principal case), which `except Exception` wouldn't catch.
---
Drafted-by: Claude Code (Sonnet 5); reviewed by @pankajastro before posting
##########
providers/common/sql/tests/unit/common/sql/datafusion/test_engine.py:
##########
@@ -372,6 +373,292 @@ def
test_get_credentials_gcs_rejects_unsupported_identity_fields(self, unsupport
with pytest.raises(ValueError, match=f"{unsupported_field!r} is not
supported"):
engine._get_credentials(mock_conn)
+ def test_get_credentials_azure_with_shared_key(self):
Review Comment:
Consolidated the three shared-key variants (password, `shared_access_key`
extra, `account_key` extra) into one parametrized test — picked up
`account_key` coverage that wasn't tested before. Left the two
service-principal tests separate since they each pin a distinct regression
(basic wiring vs. the host-priority fix).
---
Drafted-by: Claude Code (Sonnet 5); reviewed by @pankajastro before posting
--
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]