Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): Propagate tenant_id to CredentialProviderAzure if given #20583

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Jan 7, 2025

ref #20545

This is a bit of guesswork as I don't have a local repro of it - we now pass tenant_id to DefaultAzureCredential.get_token() if we see it in storage_options.

Other drive-bys to help with future debugging:

  • The Azure CLI version is now printed under pl.show_versions() - this affects the auth flow as one of the things we do is attempting to fetch the storage account key from the Azure CLI
  • Add more debug prints when POLARS_VERBOSE is enabled

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Jan 7, 2025
CredentialProviderAzure._extract_adls_uri_storage_account(str(path))
),
# For Azure we dispatch to `azure.identity` as much as possible
if _is_azure_cloud(scheme):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CredentialProviderAzure is now also initialized if the storage_options is not None, but does not contain any access keys.

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 30.18868% with 37 lines in your changes missing coverage. Please review.

Project coverage is 78.96%. Comparing base (f104170) to head (ce71f86).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/io/cloud/credential_provider.py 38.70% 18 Missing and 1 partial ⚠️
crates/polars-io/src/cloud/options.rs 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20583      +/-   ##
==========================================
- Coverage   78.98%   78.96%   -0.02%     
==========================================
  Files        1564     1564              
  Lines      220765   220802      +37     
  Branches     2504     2510       +6     
==========================================
- Hits       174368   174367       -1     
- Misses      45823    45860      +37     
- Partials      574      575       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nameexhaustion nameexhaustion changed the title fix: Propagate tenant_id to CredentialProviderAzure if given fix(python): Propagate tenant_id to CredentialProviderAzure if given Jan 7, 2025
@nameexhaustion nameexhaustion removed the rust Related to Rust Polars label Jan 7, 2025
@nameexhaustion nameexhaustion marked this pull request as ready for review January 7, 2025 07:52
@ritchie46 ritchie46 merged commit 3f74df4 into pola-rs:main Jan 7, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants