raulcd commented on code in PR #46837:
URL: https://github.com/apache/arrow/pull/46837#discussion_r2166931448
##########
python/pyarrow/tests/test_fs.py:
##########
@@ -1475,6 +1475,66 @@ def test_azurefs_options(pickle_module):
assert pickle_module.loads(pickle_module.dumps(fs4)) == fs4
assert fs4 != fs3
+ fs5 = AzureFileSystem(
+ account_name='fake-account-name',
+ tenant_id='fake-tenant-id',
+ client_id='fake-client-id',
+ client_secret='fake-client-secret'
+ )
+ assert isinstance(fs5, AzureFileSystem)
+ assert pickle_module.loads(pickle_module.dumps(fs5)) == fs5
+ assert fs5 != fs4
+
+ fs6 = AzureFileSystem(
+ account_name='fake-account-name',
+ client_id='fake-client-id'
+ )
+ assert isinstance(fs6, AzureFileSystem)
+ assert pickle_module.loads(pickle_module.dumps(fs6)) == fs6
+ assert fs6 != fs5
+
+ with pytest.raises(ValueError, match="client_id must be specified"):
+ AzureFileSystem(
+ account_name='fake-account-name',
+ tenant_id=None,
+ client_secret=None
+ )
+
+ error_msg1 = "Both of tenant_id and client_secret must be specified"
+ with pytest.raises(ValueError, match=error_msg1):
+ AzureFileSystem(
+ account_name='fake-account-name',
+ tenant_id='fake-tenant-id'
+ )
+
+ with pytest.raises(ValueError, match=error_msg1):
+ AzureFileSystem(
+ account_name='fake-account-name',
+ client_secret='fake-client-secret'
+ )
+
+ error_msg2 = "All of tenant_id, client_id, and client_secret must be
provided"
Review Comment:
isn't this error message deprecated now?
##########
python/pyarrow/_azurefs.pyx:
##########
@@ -66,6 +66,23 @@ cdef class AzureFileSystem(FileSystem):
SAS token for the storage account, used as an alternative to
account_key. If sas_token
and account_key are None the default credential will be used. The
parameters
account_key and sas_token are mutually exclusive.
+ tenant_id : str, default None
Review Comment:
we order those on alphabetical order, can you update them?
##########
python/pyarrow/tests/test_fs.py:
##########
@@ -1475,6 +1475,66 @@ def test_azurefs_options(pickle_module):
assert pickle_module.loads(pickle_module.dumps(fs4)) == fs4
assert fs4 != fs3
+ fs5 = AzureFileSystem(
+ account_name='fake-account-name',
+ tenant_id='fake-tenant-id',
+ client_id='fake-client-id',
+ client_secret='fake-client-secret'
+ )
+ assert isinstance(fs5, AzureFileSystem)
+ assert pickle_module.loads(pickle_module.dumps(fs5)) == fs5
+ assert fs5 != fs4
+
+ fs6 = AzureFileSystem(
+ account_name='fake-account-name',
+ client_id='fake-client-id'
+ )
+ assert isinstance(fs6, AzureFileSystem)
+ assert pickle_module.loads(pickle_module.dumps(fs6)) == fs6
+ assert fs6 != fs5
+
+ with pytest.raises(ValueError, match="client_id must be specified"):
+ AzureFileSystem(
+ account_name='fake-account-name',
+ tenant_id=None,
+ client_secret=None
Review Comment:
This should be set to something not None, otherwise the test doesn't fail
```suggestion
tenant_id=None,
client_secret=None
```
--
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]