apache / arrow

Apache Arrow is the universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics
https://arrow.apache.org/
Apache License 2.0
14.65k stars 3.55k forks source link

[Python] How to use fs.FileSystem.from_uri with Azurite #44682

Open fabricebaranski opened 2 weeks ago

fabricebaranski commented 2 weeks ago

Describe the usage question you have. Please include as many useful details as possible.

I want to use fs.FileSystem.from_uri with azurite. Here a short sample of code:

import pyarrow.fs as fs
local_new, path_new = fs.FileSystem.from_uri("abfs://myaccount.blob.core.windows.net/mycontainer")
local_new.create_dir("test")

The error I received is: az: error: unrecognized arguments: --scope https://storage.azure.com/.default How can I set account_key to be able to use FileSystem.from_uri?

Component(s)

Python

kou commented 2 weeks ago

The feature was removed by #44220.

Could you use an environment variable? AZURE_PASSWORD may work: https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.environmentcredential?view=azure-python

BTW, the error message is strange. Our Azure file system implementation doesn't use the az command.

fabricebaranski commented 2 weeks ago

I had to install az because otherwise I received an error because azwas not here. I tried by setting AZURE_PASSWORD, AZURE_STORAGE_ACCOUNT or AZURE_STORAGE_KEY (https://learn.microsoft.com/en-us/azure/storage/blobs/authorize-data-operations-cli#set-environment-variables-for-authorization-parameters) but it didn't work. I tried also setting query parameter credential_kind to environment but I got

terminate called after throwing an instance of 'Azure::Core::Credentials::AuthenticationException'
  what():  EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
Aborted
fabricebaranski commented 2 weeks ago

Do you have any example to test FileSystem.from_uri with Azurite?

fabricebaranski commented 1 week ago

I tested using fs.AzureFileSystem and it works. But I need to use from_uri so I don't know how to use it.