fix(user_tools): honor AWS profile S3 endpoints - #2106
Open
WilliamK112 wants to merge 2 commits into
Open
Conversation
Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
…ofile-s3-endpoint Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
WilliamK112
marked this pull request as ready for review
August 22, 2026 19:01
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
Add a shared S3 endpoint resolver used by both the Python
S3Fshandler and local Hadoop job argument construction. Existing explicit and environment behavior is preserved, with AWS profile configuration consulted only when no endpoint environment variable is set.Endpoint precedence is:
endpoint_overrideargument forS3FsAWS_ENDPOINT_URL_S3AWS_ENDPOINT_URLAWS_CONFIG_FILEor~/.aws/configProfile lookup considers
AWS_PROFILE,AWS_DEFAULT_PROFILE, anddefault. It supports profile-levelendpoint_url, service-section S3 endpoints, and nested S3 endpoint configuration. Missing or invalid config files are ignored, and AWS config values are parsed without Python percent interpolation so percent-encoded URLs remain intact.For local Java jobs, a resolved custom endpoint is also passed as the Hadoop S3A endpoint with path-style access enabled.
Fixes #2087.
Validation
PYTHONPATH=src python -m pytest -q tests/spark_rapids_tools_ut/test_csppath.py(19 passed)PYTHONPATH=src python -m pytest -q tests/spark_rapids_tools_ut/test_cluster.py tests/spark_rapids_tools_ut/tools/eventlog_detector/test_detector.py tests/spark_rapids_tools_ut/tools/eventlog_detector/test_resolver.py tests/spark_rapids_tools_ut/tools/eventlog_detector/test_scanner.py tests/spark_rapids_tools_ut/tools/eventlog_detector/test_stream.py(48 passed)python -m pylint -d fixme --load-plugins pylint_pydantic --rcfile=../.pylintrc src/spark_rapids_tools/storagelib/s3/aws_config.py src/spark_rapids_tools/storagelib/s3/s3fs.py src/spark_rapids_pytools/cloud_api/sp_types.py tests/spark_rapids_tools_ut/test_csppath.py(10.00/10)python -m flake8 src/spark_rapids_tools/storagelib/s3/aws_config.py src/spark_rapids_tools/storagelib/s3/s3fs.py src/spark_rapids_pytools/cloud_api/sp_types.py tests/spark_rapids_tools_ut/test_csppath.pypython -m py_compile src/spark_rapids_tools/storagelib/s3/aws_config.py src/spark_rapids_tools/storagelib/s3/s3fs.py src/spark_rapids_pytools/cloud_api/sp_types.py tests/spark_rapids_tools_ut/test_csppath.pygit diff --check upstream/dev...HEAD