feat: Add protocol aliases for IOConfig#6252
Open
universalmind303 wants to merge 1 commit intomainfrom
Open
Conversation
Allow user-defined mappings from custom scheme names to existing schemes (e.g., "my-s3" -> "s3") so organizations can use domain-specific protocol names that route to any backend including native S3, Azure, GCS, and OpenDAL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR adds protocol alias support to Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User calls daft.read_parquet with aliased URL] --> B[IOClient receives request]
B --> C{protocol_aliases empty?}
C -->|Yes| D[Use URL as-is]
C -->|No| E[resolve_url_alias checks scheme]
E --> F{Scheme matches alias?}
F -->|Yes| G[Rewrite scheme to target]
F -->|No| H[Return original URL]
G --> I[parse_url extracts SourceType and path]
H --> I
D --> I
I --> J[get_source_and_path creates ObjectSource]
J --> K{SourceType?}
K -->|S3| L[S3LikeSource]
K -->|GCS| M[GCSSource]
K -->|OpenDAL| N[OpenDALSource]
K -->|Other| O[Other sources]
L --> P[Perform I/O operation]
M --> P
N --> P
O --> P
Last reviewed commit: 287272c |
Contributor
Additional Comments (1)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6252 +/- ##
=======================================
Coverage 73.44% 73.44%
=======================================
Files 1001 1001
Lines 133163 133261 +98
=======================================
+ Hits 97798 97875 +77
- Misses 35365 35386 +21
🚀 New features to boost your workflow:
|
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.
Changes Made
Adds protocol aliases to
IOConfig: user-defined mappings from custom scheme names to existing schemes. For example,"my-s3" -> "s3"lets organizations use domain-specific protocol names that route to standard backends (including native S3, Azure, GCS — not just OpenDAL).Python API:
Implementation
src/common/io-config/src/config.rs— Addedprotocol_aliases: BTreeMap<String, String>field toIOConfig, display support, andvalidate_protocol_aliases()that rejects alias keys matching built-in schemes.src/daft-io/src/lib.rs— Addedresolve_url_alias()usingCowfor zero-allocation on the common (no-alias) path. Integrated intoget_source_and_path(),single_url_get(),single_url_put(), andsingle_url_get_size(). Added 7 Rust unit tests.src/common/io-config/src/python.rs— Addedprotocol_aliasesparameter toIOConfig::new()andreplace()with case normalization and validation. Added getter.daft/daft/__init__.pyi— Updated type stubs.tests/io/test_protocol_aliases.py— 9 config tests + 2 integration tests using OpenDALfsbackend.Design Decisions
s3,gcs, etc. as keys is rejected at construction timeparse_url()which already lowercases schemesparse_url()and its 17+ external callers remain untouched; alias resolution happens inIOClientmethods before callingparse_url()Related Issues
Builds on PR #6177 (OpenDAL support).
🤖 Generated with Claude Code