Skip to content

[Data] Make Azure UC Parquet reads work, and fail clearly on old pyarrow - #66274

Merged
sampan-s-nayak merged 1 commit into
uc/vend-credsfrom
uc/parquet-read
Oct 8, 2026
Merged

sampan-s-nayak merged 1 commit into
uc/vend-credsfrom
uc/parquet-read

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?

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

@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 upgrades the minimum supported version of pyarrow from 17.0.0 to 20.0.0 across the codebase, updating dependencies, lockfiles, and CI build configurations. It also introduces support for reading Azure-backed Parquet tables through Unity Catalog, utilizing the sas_token parameter introduced in pyarrow 20.0.0. Feedback on the changes suggests normalizing the extracted Azure storage account name to lowercase to ensure robustness against casing variations.

Comment on lines +115 to +116
container, _, host = parsed.netloc.partition("@")
account = host.split(".")[0]

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.

medium

Azure storage account names are strictly lowercase (3-24 characters, numbers and lowercase letters only). To ensure robustness against any potential casing variations in the host or netloc, it is safer to normalize the extracted account name to lowercase.

Suggested change
container, _, host = parsed.netloc.partition("@")
account = host.split(".")[0]
container, _, host = parsed.netloc.partition("@")
account = host.split(".")[0].lower()

@ray-gardener ray-gardener Bot added the data Ray Data-related issues label Sep 18, 2026
@NightWing1998
NightWing1998 removed request for a team, edoakes and richardliaw September 22, 2026 08:25

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread python/ray/data/tests/test_catalog.py Resolved
@NightWing1998 NightWing1998 added the go add ONLY when ready to merge, run all tests label Sep 30, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread python/ray/data/catalog.py Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fd4798d. Configure here.

Comment thread python/ray/data/catalog.py Resolved
`read_parquet` is filesystem-only -- it ignores `storage_options` entirely -- so
Azure `resolve()` returning no filesystem left a vended SAS no route to it. That
failed badly rather than clearly: pyarrow reports a missing Azure credential by
falling through to `DefaultAzureCredential`, which stalls on the
instance-metadata endpoint or, over plain HTTP, aborts the process with SIGABRT.

Build a `pyarrow.fs.AzureFileSystem` carrying the SAS. It needs pyarrow >=
20.0.0 (apache/arrow#45705); below that, resolution raises ImportError naming
the requirement.

Two details, each of which fails as a bare unauthenticated 404:

- the `sas_token` keeps its leading `?`. pyarrow appends it to the service URL
  verbatim, so a bare token is taken as a path segment. deltalake's
  `storage_options` and AZURE_STORAGE_SAS_TOKEN both want it stripped, so the
  two channels genuinely disagree on format.
- the `<container>@<account>.dfs.core.windows.net` authority comes off the path.
  pyarrow parses that Hadoop-style form only when it builds the filesystem from
  the URI itself; handed one, it treats the authority as part of the path.

Delta keeps no pyarrow floor: its SAS goes to deltalake's object_store, which
carries its own Azure client. Also adds the bazel target for the new test file.

Testing:

    pytest python/ray/data/tests/datasource/test_catalog_azure.py  # real Azure
    4 passed, 2 skipped

    pytest python/ray/data/tests/datasource/test_catalog_azure.py \
           python/ray/data/tests/test_catalog.py                   # Azurite
    51 passed, 1 skipped

Run on pyarrow 23.0.1; the version boundary is asserted by pinning the reported
version, so the < 20 side is covered by those tests rather than by this install.

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 33b82df into master Oct 8, 2026
7 checks passed
@sampan-s-nayak
sampan-s-nayak deleted the uc/parquet-read 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
…t them (#66273)

## 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

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