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

[FEAT] Infer Azure storage account from uri #3165

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

kevinzwang
Copy link
Member

@kevinzwang kevinzwang commented Nov 2, 2024

Resolves #3142

This PR also adds a dependency for the derive_builder crate, which I'm hoping to introduce into our repo and use throughout our code to reduce builder boilerplate.

@kevinzwang
Copy link
Member Author

@anilmenon14 could you check if the changes in this PR works? Let me know if you need any help with that

@github-actions github-actions bot added the enhancement New feature or request label Nov 2, 2024
Copy link

codspeed-hq bot commented Nov 2, 2024

CodSpeed Performance Report

Merging #3165 will not alter performance

Comparing kevin/azure-infer-storage-account (218d55f) with main (3cef614)

Summary

✅ 17 untouched benchmarks

@jaychia jaychia requested review from raunakab and removed request for samster25 and jaychia November 2, 2024 01:02
Copy link

codecov bot commented Nov 2, 2024

Codecov Report

Attention: Patch coverage is 30.15873% with 44 lines in your changes missing coverage. Please review.

Project coverage is 78.99%. Comparing base (3cef614) to head (218d55f).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/daft-io/src/azure_blob.rs 0.00% 43 Missing ⚠️
src/daft-io/src/lib.rs 93.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3165      +/-   ##
==========================================
- Coverage   79.00%   78.99%   -0.02%     
==========================================
  Files         634      634              
  Lines       76943    76958      +15     
==========================================
+ Hits        60789    60790       +1     
- Misses      16154    16168      +14     
Files with missing lines Coverage Δ
src/daft-io/src/python.rs 87.09% <100.00%> (ø)
src/daft-io/src/lib.rs 72.19% <93.33%> (ø)
src/daft-io/src/azure_blob.rs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@anilmenon14
Copy link
Contributor

anilmenon14 commented Nov 3, 2024

Hi @kevinzwang , the changes look great to me! I did a quick build of this branch on my laptop and ran some tests and they passed.
After the make build and make .venv steps on this branch, I ran the below commands in the Python REPL:

# This is the ideal set of steps for Azure
import os
import daft # Using version 0.3.9
from daft.unity_catalog import UnityCatalog

DATABRICKS_HOST = os.environ.get('DATABRICKS_HOST')
PAT_TOKEN_AZURE = os.environ.get('PAT_TOKEN_AZURE') 

unity = UnityCatalog(endpoint=DATABRICKS_HOST,token=PAT_TOKEN_AZURE)
unity_table_ext = unity.load_table("ucx_migrated.ucx_dst_external.external_dbfs_mounted") # This is an external table
df_ext = daft.read_deltalake(unity_table_ext)
df_ext.show()

This worked perfectly,by materializing the expected results of the Dataframe! 🙌

I also did a quick regression test using an AWS environment to confirm there has been no unintended impact seen elsewhere and it still works well there too.
If I can help with any additional manual testing on Unity Catalog , before merging, feel free to let me know and I can definitely do that.

@kevinzwang
Copy link
Member Author

kevinzwang commented Nov 4, 2024

@anilmenon14 thanks for testing it! One final thing I'd like to confirm is that with your setup, the script fails without these changes, AKA that the Azure storage account was not set elsewhere in your testing, and that it is properly determined by Daft with this PR.

@anilmenon14
Copy link
Contributor

anilmenon14 commented Nov 4, 2024

Hi @kevinzwang , your statements are correct. With the code in this PR, run on a shell session without any pre-set environment variables for the Azure storage account, it is now able to determine the storage account.
Just to be extra sure, I did a comparison test with a virtual environment with the code from this PR versus the v0.3.9 on separate shell sessions initiated with same environment variables of access token and Host URL.
The code snippet only successfully works for the DataFrame .show() API in the code version from this PR.

@kevinzwang
Copy link
Member Author

That's great to hear! Thank you again for such thorough testing. @raunakab please give this a review whenever you can

Copy link
Contributor

@raunakab raunakab left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@kevinzwang kevinzwang merged commit 944c6da into main Nov 5, 2024
41 of 42 checks passed
@kevinzwang kevinzwang deleted the kevin/azure-infer-storage-account branch November 5, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure storage account not properly set for Unity Catalog
3 participants