Giter VIP home page Giter VIP logo

Comments (2)

TomAugspurger avatar TomAugspurger commented on June 17, 2024

from adlfs.

UnderTheCraft avatar UnderTheCraft commented on June 17, 2024

Does a CertificateCredential work with azure.storage.blob.ContainerClient?

No, as far as I can see, the ContainerClient can only be created using an "AzureNamedKeyCredential", "AzureSasCredential" or "TokenCredential".

But I actually already found a solution to read partitioned parquet with a CertificateCredential, using azure.storage.filedatalake.DataLakeServiceClient and another library called 'pyarrowfs_adlgen2' from Robin Kåveland.

What I think is interesting here, is that the constructor of the DataLakeServiceClient class also does not mention the usage of an CertificateCredential explicitly - just the three Credential options, I also mentioned above.
So the CertificateCredential might also work somehow with the adlfs lib, but since I have a working solution now, I probaly won't test this.

However, in case anyone else is facing the same issue, here the code I used:

from azure.storage.filedatalake import DataLakeServiceClient
from azure.identity import CertificateCredential
import pyarrowfs_adlgen2
import pyarrow
import pandas

credential = CertificateCredential(tenant_id, client_id, certificate_data=certificate)
datalake_service_client= DataLakeServiceClient(account_url=account_url, credential=credential)

handler = pyarrowfs_adlgen2.AccountHandler(datalake_service=datalake_service_client)
filesystem = pyarrow.fs.PyFileSystem(handler)

df = pandas.read_parquet(path=path, filesystem=filesystem)

@TomAugspurger feel free to close this issue, if no further action required from your side.

from adlfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.