import pyarrow.fs
azure_fs = pyarrow.fs.AzureFileSystem(account_name="test", sas_token="test")
print(azure_fs.__reduce__())
subtree_fs = pyarrow.fs.SubTreeFileSystem("/tmp", azure_fs)
print(subtree_fs.base_fs.__reduce__())
(<cyfunction AzureFileSystem._reconstruct at 0x79d22010c940>, ({'account_name': 'test', 'account_key': '', 'blob_storage_authority': '.blob.core.windows.net', 'blob_storage_scheme': 'https', 'client_id': '', 'client_secret': '', 'dfs_storage_authority': '.dfs.core.windows.net', 'dfs_storage_scheme': 'https', 'sas_token': 'test', 'tenant_id': ''},))
(<cyfunction AzureFileSystem._reconstruct at 0x79d22010c940>, ({'account_name': 'test', 'account_key': '', 'blob_storage_authority': '.blob.core.windows.net', 'blob_storage_scheme': 'https', 'client_id': '', 'client_secret': '', 'dfs_storage_authority': '.dfs.core.windows.net', 'dfs_storage_scheme': 'https', 'sas_token': '', 'tenant_id': ''},))
Describe the bug, including details regarding any error messages, version, and platform.
Reproduce:
Returns
Notice how the first result the
sas_tokenis not empty but the second one is.Cause:
The
sas_tokenand a couple of the other values returned byAzureFileSystem.__reduce__read fromselfof the python sideAzureFileSystemobject. When constructing aSubTreeFileSystem, the python sideAzureFileSystemobject is discarded and theSubTreeFileSystemonly holds a pointer to theCAzureFileSystem. Therefore its not possible to reconstruct a python sideAzureFileSystemincluding the attributes onselfof the originalAzureFileSystem.Component(s)
Python