Repository navigation
[cherry-pick][2.60.1][Data] Stop writing Unity Catalog vended AWS credentials to the environment (#67899) - #68232
Merged
sai-miduthuri merged 1 commit intoNov 18, 2026
Conversation
…onment (ray-project#67899) Backport of ray-project#67899 to 2.60.1, AWS part only. releases/2.60.1 doesn't have the Azure Unity Catalog changes ray-project#67899 edits (ray-project#66272-ray-project#66276), so on this branch Azure still delivers its SAS through the environment. - AWS: an explicit S3FileSystem for every reader and mode, plus the AWS keys and region in `storage_options` for Delta. Nothing is written to `os.environ` and Ray isn't started. - GCS: unchanged (it never used the environment). - Azure: unchanged (still `_apply_env`). - `_creds_to_env` is removed; an unknown credential type still raises. (cherry picked from commit 596241a) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abhishek Verma <[email protected]>
abhishekverma-ray
marked this pull request as ready for review
November 17, 2026 04:00
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors how vended credentials are handled in the Databricks Unity Catalog integration. Specifically, AWS and GCP credentials are no longer written to the environment or cluster runtime_env (which could override instance roles for other cloud accesses); instead, they are passed directly via explicit pyarrow filesystems and storage_options for deltalake. Azure credentials continue to be propagated via environment variables. The unit tests have been updated to ensure that environment variables remain unchanged for AWS and GCP, and to verify the correct population of storage_options. I have no feedback to provide as there are no review comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #67899 (master commit 596241a) onto
releases/2.60.1, AWS part only. It's based directly onreleases/2.60.1and is independent of #68213 / #68214 and the #67898 pick; all of them merge with it without conflicts.On this branch,
DatabricksUnityCatalog.resolve()writes vended AWS credentials into the driver'sos.environand, if Ray isn't running yet, starts Ray with them inruntime_env. AWS env vars take precedence over the instance role, so after one Unity Catalog read the driver and every worker use a short-lived credential scoped to that one table. Writes to the job's own buckets (checkpoints, logs) then fail withACCESS_DENIED.With this PR, AWS credentials travel only in the objects that use them, which pickle into the read and write tasks:
S3FileSystemfor every reader and mode. Before, AWS Parquet reads used the environment.storage_options, for deltalake's log read and thewrite_deltacommit.read_delta,write_deltaand the datasink's credential refresh already mergeresolved.storage_optionson this branch.GCS was already environment-free and is unchanged. A response with no known credential type still raises
ValueError.Behavior changes worth a release note (the same as on master):
region, which theDatabricksUnityCatalogdocstring already lists as required for AWS.Related issues
Related to #67899.
Additional information
How this differs from #67899
releases/2.60.1doesn't have the Azure Unity Catalog work #67899 edits (#66272–#66276: Azure SAS instorage_options,AzureFileSystemfor Parquet, Azurite tests). Sogit cherry-pickconflicts incatalog.pyandtest_catalog.pyand tries to bring in that Azure code and the Gravitino catalog. I ported the AWS change by hand instead:_apply_env(the environment plusruntime_env), because nothing else delivers it on this branch. Removing that would break Azure reads._creds_to_envis gone: Azure calls_parse_azure_credsdirectly, and the unknown-typeValueErrormoved into_resolve_storage, as on master.delta_datasink.pyandtest_write_delta.pychanges. They're comment-only and say Unity Catalog never touches the environment, which is still false for Azure here.test_catalog_azure.pydoesn't exist on this branch.isolated_envfixture (environment must come back unchanged,ray.initfails if called) covers every AWS and GCSresolve()test. The two Azure tests keep the old lenient fixture, renamedazure_env. Master deletedtest_resolve_initializes_ray_with_runtime_env; here it becomestest_resolve_azure_initializes_ray_with_runtime_env, since Azure still does that. As on master,test_resolve_aws_requires_regioncovers both readers, andtest_resolve_rejects_unknown_credential_typeand thestorage_optionsasserts in thewrite_deltatest are added.Not a duplicate: no open or merged PR against
releases/2.60.1picks #67899.Testing
test_catalog.pyskips the whole module withoutdatabricks-sdk, and this branch's Data CI locks don't include it, so CI doesn't run these tests here. I ran them locally:pytest test_catalog.py(databricks-sdk 0.143.0)releases/2.60.1: 34releases/2.60.1'scatalog.pyresolve()test, the Parquet region check, and thewrite_deltastorage_optionsassertspytest datasource/test_write_delta.pypytest datasource/test_delta.pypytest unit/datasource/Each file ran in its own pytest process. Environment: Python 3.12.10 with the Ray 2.60.0 release wheel, this branch's
python/ray/dataandpython/ray/testslinked over it, and the CI lock pins: pyarrow 23.0.1, pandas 2.3.3, numpy 2.2.6, deltalake 1.5.0, pytest 7.4.4.Not checked on a real Databricks workspace, as with #67899 on master.
AI assistance was used to prepare this backport; every line has been reviewed by the submitter.
🤖 Generated with Claude Code