fix(spark): S3/GCS PyArrow filesystem resolution for staging paths#6442
Open
abhijeet-dhumal wants to merge 2 commits into
Open
fix(spark): S3/GCS PyArrow filesystem resolution for staging paths#6442abhijeet-dhumal wants to merge 2 commits into
abhijeet-dhumal wants to merge 2 commits into
Conversation
5 tasks
611bc8c to
2bf6136
Compare
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
7c3fe0f to
394f421
Compare
ntkathole
reviewed
May 28, 2026
| ) | ||
| kwargs["scheme"] = "https" if endpoint.startswith("https") else "http" | ||
| fs = pafs.S3FileSystem(**kwargs) | ||
| stripped = [p.replace("s3a://", "").replace("s3://", "") for p in paths] |
Member
There was a problem hiding this comment.
better use p.removeprefix("s3a://").removeprefix("s3://"), same for https/http and other paths
ntkathole
reviewed
May 28, 2026
| return fs, stripped | ||
|
|
||
| if sample.startswith("gs://"): | ||
| import pyarrow.fs as pafs |
franciscojavierarceo
approved these changes
May 30, 2026
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.
What this PR does / why we need it
Staging parquet reads fail on S3-compatible stores (MinIO, Ceph, custom AWS endpoints) because raw
s3:///s3a://URIs are passed directly topyarrow.dataset:Replaces
_normalize_staging_pathswith_resolve_staging_filesystemwhich builds the correctpyarrow.fs.S3FileSystemorpyarrow.fs.GcsFileSystemfrom the URI scheme. Picks upAWS_ENDPOINT_URL_S3for MinIO/LocalStack andAWS_DEFAULT_REGIONfrom the environment. Local andfile://paths pass through unchanged.Which issue(s) this PR fixes
Enables staging path reads for on-prem / private cloud Spark deployments (MinIO, Ceph, LocalStack).
Checks
git commit -s)Testing Strategy
file://, MinIO, region fallback