jorisvandenbossche commented on code in PR #40021: URL: https://github.com/apache/arrow/pull/40021#discussion_r1487810807
########## python/pyarrow/_azurefs.pyx: ########## @@ -0,0 +1,134 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# cython: language_level = 3 + +from cython cimport binding + + +from pyarrow.lib import frombytes, tobytes +from pyarrow.includes.libarrow_fs cimport * +from pyarrow._fs cimport FileSystem + + +cdef class AzureFileSystem(FileSystem): + """ + Azure Blob Storage backed FileSystem implementation + + This implementation supports flat namespace and hierarchical namespace (HNS) a.k.a. + Data Lake Gen2 storage accounts. HNS will be automatically detected and HNS specific + features will be used when they provide a performance advantage. Note: `/` is the + only supported delimiter. + + The storage account is considered the root of the filesystem. When enabled containers + will be created or deleted during relevant directory operations. Obviously, this also + requires authentication with the additional permissions. + + By default [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/identity/azure-identity/README.md#defaultazurecredential) + is used for authentication. This means it will try several types of authentication + and go with the first one that works. If any auth paramters are provided when Review Comment: ```suggestion and go with the first one that works. If any authentication parameters are provided when ``` This is about `account_key`? Or also the other parameters? ########## python/pyarrow/_azurefs.pyx: ########## @@ -0,0 +1,134 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# cython: language_level = 3 + +from cython cimport binding + + +from pyarrow.lib import frombytes, tobytes +from pyarrow.includes.libarrow_fs cimport * +from pyarrow._fs cimport FileSystem + + +cdef class AzureFileSystem(FileSystem): + """ + Azure Blob Storage backed FileSystem implementation + + This implementation supports flat namespace and hierarchical namespace (HNS) a.k.a. + Data Lake Gen2 storage accounts. HNS will be automatically detected and HNS specific + features will be used when they provide a performance advantage. Note: `/` is the + only supported delimiter. + + The storage account is considered the root of the filesystem. When enabled containers Review Comment: ```suggestion The storage account is considered the root of the filesystem. When enabled, containers ``` ########## python/pyarrow/conftest.py: ########## @@ -54,6 +55,7 @@ defaults = { 'acero': False, + 'azure': False, Review Comment: Do we want to enable them when the filesystem can be imported? (like is done for s3 around line 156 below) ########## python/pyarrow/_azurefs.pyx: ########## @@ -0,0 +1,134 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# cython: language_level = 3 + +from cython cimport binding + + +from pyarrow.lib import frombytes, tobytes +from pyarrow.includes.libarrow_fs cimport * +from pyarrow._fs cimport FileSystem + + +cdef class AzureFileSystem(FileSystem): + """ + Azure Blob Storage backed FileSystem implementation + + This implementation supports flat namespace and hierarchical namespace (HNS) a.k.a. + Data Lake Gen2 storage accounts. HNS will be automatically detected and HNS specific + features will be used when they provide a performance advantage. Note: `/` is the + only supported delimiter. + + The storage account is considered the root of the filesystem. When enabled containers + will be created or deleted during relevant directory operations. Obviously, this also + requires authentication with the additional permissions. + + By default [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/identity/azure-identity/README.md#defaultazurecredential) Review Comment: ```suggestion By default `DefaultAzureCredential <https://github.com/Azure/azure-sdk-for-cpp/blob/main/sdk/identity/azure-identity/README.md#defaultazurecredential>`__ ``` ########## python/pyarrow/tests/test_fs.py: ########## @@ -291,6 +291,37 @@ def subtree_s3fs(request, s3fs): }""" [email protected] +def azurefs(request, azure_server): + request.config.pyarrow.requires('azure') + from pyarrow.fs import AzureFileSystem + + host, port = azure_server['connection'] + azureite_authority = f"{host}:{port}" + azureite_scheme = "http" + + container = 'pyarrow-filesystem/' + + fs = AzureFileSystem(account_name='devstoreaccount1', + account_key='Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuF' + 'q2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==', Review Comment: Where does this account name and key come from? -- 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]
