Skip to content

[Data] Vend Azure UC credentials via storage_options so read tasks get them - #66273

Merged
sampan-s-nayak merged 1 commit into
uc/azure-testsfrom
uc/vend-creds
Oct 8, 2026
Merged

sampan-s-nayak merged 1 commit into
uc/azure-testsfrom
uc/vend-creds

Conversation

@NightWing1998

@NightWing1998 NightWing1998 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Why

Unity Catalog credential vending is covered for AWS, but the Azure path was only
tested as far as resolve(): the Databricks SDK is mocked, the assertions check
that AZURE_STORAGE_SAS_TOKEN lands in os.environ, and no byte is ever read.
Once tests actually read data through a vended Azure SAS, two real bugs showed
up — and a third, unrelated to Azure, turned up on the way.

Verified against a real Azure Databricks workspace with a Unity Catalog managed
Delta table (12,000 rows, 4 log versions, 24 Parquet files) throughout.

What does this PR achieve

Fix the Azure credential vending to allow non-driver node task/actor operators
to read delta tables from Unity Catalog.

Links

PR is a part of stacked PRs. Chain: #66272 > #66273 > #66274 > #66275 > #66276

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Ray Data catalog to pass Azure SAS tokens via storage_options in addition to environment variables, ensuring credentials can pickle into read tasks for deltalake's object_store even when Ray is already initialized. The review feedback suggests adding a warning for read_parquet on Azure when Ray is already initialized, as it is filesystem-only and pyarrow's AzureFileSystem does not support SAS tokens. Additionally, it recommends keeping helper methods as @staticmethod rather than @classmethod to maintain consistency with the rest of the class.

Comment thread python/ray/data/catalog.py Resolved
Comment thread python/ray/data/catalog.py Resolved
@ray-gardener ray-gardener Bot added the data Ray Data-related issues label Sep 18, 2026
@NightWing1998
NightWing1998 force-pushed the uc/vend-creds branch 2 times, most recently from 9b6087f to 6bfe855 Compare September 29, 2026 17:56
@NightWing1998 NightWing1998 added the go add ONLY when ready to merge, run all tests label Sep 30, 2026
…t them

A catalog-backed read of an Azure-backed Delta table failed in the read tasks:

    OSError: Generic MicrosoftAzure error
      -> Error performing GET http://169.254.169.254/metadata/identity/oauth2/token

That address is the Azure instance-metadata endpoint: the worker had no
credential and fell back to "maybe I am on an Azure VM with an attached
identity". `_apply_env` folds credentials into the cluster `runtime_env` only
while Ray is still uninitialized, and any case with an existing Dataset is past
that, so the SAS stopped at the driver. AWS survives this because its vended
`S3FileSystem` pickles into the read tasks; Azure got no filesystem.

Return the SAS in `storage_options` instead -- a plain dict, so it pickles with
the read plan and each worker authenticates with the vended credential.
`read_delta` already merges it under any user-supplied options.

`test_resolve_azure_sets_env` asserted `storage_options is None`, which encoded
exactly the bug; renamed and re-pointed at the credential now travelling.

Testing:

    pytest python/ray/data/tests/datasource/test_catalog_azure.py \
           python/ray/data/tests/test_catalog.py
    38 passed

    pytest python/ray/data/tests/datasource/test_write_delta.py
    92 passed

AI assistance was used for this change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Dhruvil Shah <[email protected]>
@sampan-s-nayak
sampan-s-nayak merged commit b6a8529 into master Oct 8, 2026
7 checks passed
@sampan-s-nayak
sampan-s-nayak deleted the uc/vend-creds branch October 8, 2026 15:15
sampan-s-nayak pushed a commit that referenced this pull request Oct 8, 2026
…6272)

## Why

Unity Catalog credential vending is covered for AWS, but the Azure path
was only
tested as far as resolve(): the Databricks SDK is mocked, the assertions
check
that AZURE_STORAGE_SAS_TOKEN lands in os.environ, and no byte is ever
read.
Once tests actually read data through a vended Azure SAS, two real bugs
showed
up — and a third, unrelated to Azure, turned up on the way.

Verified against a real Azure Databricks workspace with a Unity Catalog
managed
Delta table (12,000 rows, 4 log versions, 24 Parquet files) throughout.

## What does this PR achieve?

This PR is solely focused in improving the test coverage around azure
unity catalog.
Some tests added in the PR actually fail in CI but are fixed in later PR
part of the stack.

## Links

PR is a part of `stacked PRs`. Chain: #66272 > #66273 > #66274 > #66275
> #66276

---------

Signed-off-by: Dhruvil Shah <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
sampan-s-nayak pushed a commit that referenced this pull request Oct 8, 2026
…row (#66274)

## Why

Unity Catalog credential vending is covered for AWS, but the Azure path
was only
tested as far as resolve(): the Databricks SDK is mocked, the assertions
check
that AZURE_STORAGE_SAS_TOKEN lands in os.environ, and no byte is ever
read.
Once tests actually read data through a vended Azure SAS, two real bugs
showed
up — and a third, unrelated to Azure, turned up on the way.

Verified against a real Azure Databricks workspace with a Unity Catalog
managed
Delta table (12,000 rows, 4 log versions, 24 Parquet files) throughout.

## What does this PR achieve?

PyArrow v20.0.0 or above is required to support UC Parquet file based
tables.
Bump the minimum pyarrow version required so that users with older
pyarrow
version don't see exception during pipeline execution.

## Links

PR is a part of stacked PRs. Chain: #66272 > #66273 > #66274 > #66275 >
#66276

Signed-off-by: Dhruvil Shah <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
sampan-s-nayak pushed a commit that referenced this pull request Oct 8, 2026
## Why

Unity Catalog credential vending is covered for AWS, but the Azure path
was only
tested as far as resolve(): the Databricks SDK is mocked, the assertions
check
that AZURE_STORAGE_SAS_TOKEN lands in os.environ, and no byte is ever
read.
Once tests actually read data through a vended Azure SAS, two real bugs
showed
up — and a third, unrelated to Azure, turned up on the way.

Verified against a real Azure Databricks workspace with a Unity Catalog
managed
Delta table (12,000 rows, 4 log versions, 24 Parquet files) throughout.

## What does this PR achieve

Deltalake python SDK does not support reading tables with deletion
vectors. Current
error message requests to update the `deltalake` library version but no
version so
released so far has this support. Correct the exception message raised
to show that.

## Links

PR is a part of stacked PRs. Chain: #66272 > #66273 > #66274 > #66275 >
#66276

Signed-off-by: Dhruvil Shah <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
sampan-s-nayak pushed a commit that referenced this pull request Oct 8, 2026
…#66276)

## Why
Unity Catalog credential vending is covered for AWS, but the Azure path
was only
tested as far as resolve(): the Databricks SDK is mocked, the assertions
check
that AZURE_STORAGE_SAS_TOKEN lands in os.environ, and no byte is ever
read.
Once tests actually read data through a vended Azure SAS, two real bugs
showed
up — and a third, unrelated to Azure, turned up on the way.

Verified against a real Azure Databricks workspace with a Unity Catalog
managed
Delta table (12,000 rows, 4 log versions, 24 Parquet files) throughout.

## What does this PR achieve

Add azurite to CI so that we can actively test UC code path against mock
azure.

## Links

PR is a part of stacked PRs. Chain: #66272 > #66273 > #66274 > #66275 >
#66276

---------

Signed-off-by: Dhruvil Shah <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants