refactor(rust/sedona-schema): centralize SedonaType CRS helpers#705
Merged
Kontinuation merged 1 commit intoapache:mainfrom Mar 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes CRS extraction and item-level CRS wrapper detection on SedonaType in sedona-schema, then updates downstream crates (raster/functions/expr/testing + Python wrapper) to use those helpers to remove duplicated matching logic.
Changes:
- Added
SedonaType::crs()andSedonaType::is_item_crs()plus schema-level tests for both helpers. - Replaced repeated
SedonaTypematching logic across raster execution, expression parsing, and testing utilities with the new helpers. - Simplified the Python schema wrapper CRS getter to rely on
SedonaType::crs().
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rust/sedona-schema/src/datatypes.rs | Adds crs() / is_item_crs() on SedonaType and tests covering the new helpers. |
| rust/sedona-schema/src/matchers.rs | Switches CRS extraction and item_crs detection to the new SedonaType helpers. |
| rust/sedona-raster-functions/src/executor.rs | Removes local CRS/item_crs helpers and uses SedonaType::crs() / is_item_crs() during argument handling. |
| rust/sedona-functions/src/executor.rs | Uses SedonaType::is_item_crs() to dispatch iteration logic for item-level CRS arrays. |
| rust/sedona-expr/src/item_crs.rs | Replaces struct-field-name matching with SedonaType::is_item_crs() in item_crs parsing helpers. |
| rust/sedona-testing/src/create.rs | Updates test value constructors to recognize item_crs via SedonaType::is_item_crs(). |
| rust/sedona-testing/src/testers.rs | Updates geometry/geography scalar literal handling to use SedonaType::is_item_crs(). |
| python/sedonadb/src/schema.rs | Uses SedonaType::crs() to implement the Python crs getter consistently. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This is a follow-up of #615 (comment).
Summary
SedonaType::crs()andSedonaType::is_item_crs()insedona-schemaso CRS extraction anditem_crsdetection live on the type itselfSedonaTypehelpersTesting
cargo test -p sedona-schema -p sedona-expr -p sedona-functions -p sedona-raster-functions -p sedona-testingcargo clippy -p sedona-schema -p sedona-expr -p sedona-functions -p sedona-raster-functions -p sedona-testing