Skip to content

refactor(rust/sedona-schema): centralize SedonaType CRS helpers#705

Merged
Kontinuation merged 1 commit intoapache:mainfrom
Kontinuation:add-crs-and-is-item_crs
Mar 11, 2026
Merged

refactor(rust/sedona-schema): centralize SedonaType CRS helpers#705
Kontinuation merged 1 commit intoapache:mainfrom
Kontinuation:add-crs-and-is-item_crs

Conversation

@Kontinuation
Copy link
Member

@Kontinuation Kontinuation commented Mar 10, 2026

This is a follow-up of #615 (comment).

Summary

  • add SedonaType::crs() and SedonaType::is_item_crs() in sedona-schema so CRS extraction and item_crs detection live on the type itself
  • replace duplicated matching logic in raster functions, expression handling, testing helpers, and the Python schema wrapper with the new SedonaType helpers
  • add schema-level coverage for the new helper methods

Testing

  • cargo test -p sedona-schema -p sedona-expr -p sedona-functions -p sedona-raster-functions -p sedona-testing
  • cargo clippy -p sedona-schema -p sedona-expr -p sedona-functions -p sedona-raster-functions -p sedona-testing

@Kontinuation Kontinuation marked this pull request as ready for review March 10, 2026 17:05
@Kontinuation Kontinuation requested a review from Copilot March 10, 2026 17:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() and SedonaType::is_item_crs() plus schema-level tests for both helpers.
  • Replaced repeated SedonaType matching 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.

Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Kontinuation Kontinuation merged commit 2080845 into apache:main Mar 11, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants