Skip to content

Support all xarray coordinate types in ScalarBound #121

@alxmrs

Description

@alxmrs

Problem

The ScalarBound enum in src/lib.rs (marked TODO at line ~78) only handles three coordinate types:

  • Int64 (integer coordinates)
  • Float64 (lat/lon coordinates)
  • TimestampNanos (datetime64[ns] coordinates)

xarray supports a much wider range of coordinate types. Unrecognized types silently fall through with no partition pruning.

Missing types

  • UInt8, UInt16, UInt32, UInt64 (unsigned integers)
  • Int8, Int16, Int32 (smaller integer widths)
  • Float32 (single-precision float)
  • Timedelta / duration types
  • String / categorical coordinates (e.g. station names, model names)
  • Boolean coordinates

Work required

  1. Extend ScalarBound with variants for the missing types
  2. Update compare_to_scalar to handle each new variant against matching DataFusion ScalarValue types
  3. Update python_to_scalar_bound to extract these types from Python objects
  4. Add partition_metadata() conversion in df.py for new types
  5. Add tests covering each new coordinate type

Acceptance criteria

  • Partition pruning works correctly for each supported xarray coordinate dtype
  • Unsupported types degrade gracefully (no pruning, no error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions