Fokko commented on code in PR #4596:
URL: https://github.com/apache/iceberg-python/pull/4596#discussion_r4784154429


##########
pyiceberg/io/fsspec.py:
##########
@@ -302,6 +304,10 @@ def _adls(properties: Properties, hostname: str | None = 
None) -> AbstractFileSy
     if hostname and account_name is None:
         account_name = hostname.split(".")[0]
 
+    connection_string = properties.get(ADLS_CONNECTION_STRING)
+    if connection_string is None and account_name is not None:
+        connection_string = 
properties.get(f"{ADLS_CONNECTION_STRING}.{account_name}")

Review Comment:
   In Java, `adls.connection-string.<account>` isn't an Azure connection 
string. Its value is passed to `DataLakeFileSystemClientBuilder.endpoint(...)` 
(`AzureProperties.java:200-202`), and it is keyed by the location's full host 
(`ADLSFileIO.java:156` passes `location.host()`, e.g. 
`account.dfs.core.windows.net`). Here it is looked up by the bare account name 
and given to adlfs as `connection_string`, so a Java config either won't match 
or is parsed in the wrong format. As this is a separate item on #4140, could we 
split it into its own PR?



##########
pyiceberg/io/pyarrow.py:
##########
@@ -601,14 +603,14 @@ def _initialize_azure_fs(self, netloc: str | None = None) 
-> FileSystem:
 
         client_kwargs: dict[str, str] = {}
 
-        account_name = self.properties.get(ADLS_ACCOUNT_NAME)
+        account_name = get_first_property_value(self.properties, 
ADLS_ACCOUNT_NAME, ADLS_SHARED_KEY_ACCOUNT_NAME)

Review Comment:
   Java requires `adls.auth.shared-key.account.name` and 
`adls.auth.shared-key.account.key` to be set together and fails otherwise 
(`AzureProperties.java:112-117`). Here (and in `fsspec.py`) they're resolved 
independently. A name-only config is accepted silently, and a legacy 
`adls.account-name` can be paired with a Java 
`adls.auth.shared-key.account.key`. Could we resolve them as a pair, and raise 
a `ValueError` when only one of the Java keys is set?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to