Skip to content

Expose the dtype of a dynamic comparison's value - #11551

Open
wbeckler wants to merge 1 commit into
vortex-data:developfrom
wbeckler:wbeckler/dynamic-comparison-dtype
Open

wbeckler wants to merge 1 commit into
vortex-data:developfrom
wbeckler:wbeckler/dynamic-comparison-dtype

Conversation

@wbeckler

Copy link
Copy Markdown

Summary

DynamicComparisonExpr exposes its operator, its default and the current value, but not the dtype of the value, and scalar() returns None until a value is known. Code outside vortex-array therefore cannot tell which dtype a dynamic comparison expects.

#11523 needs this: the DuckDB converter gives a dynamic comparison the dtype of the zoned timestamp column it filters, and without the accessor it rebuilds every such comparison instead of only the ones that differ.

Changes

  • DynamicComparisonExpr::dtype() returns the dtype of the dynamic value.
  • A test reads it from a comparison that has no value yet.

This PR does not change vortex-duckdb. Using the accessor there depends on #11523, so I will follow up once both are in.

Tests

cargo test -p vortex-array --lib filtered to scalar_fn::fns::dynamic (8 passed), clippy with -D warnings on vortex-array, and fmt on the pinned nightly. I did not run the whole vortex-array suite.

AI assistance

Written by Claude Code (Claude Fable 5.2), an AI coding agent, working at my direction. It also ran the checks listed above and opened this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SMtfpBcKnfP3CkWWQL6mit

DynamicComparisonExpr::scalar() returns None until the value is known,
so code outside vortex-array could not tell which dtype a dynamic
comparison expects. Add DynamicComparisonExpr::dtype().

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMtfpBcKnfP3CkWWQL6mit
Signed-off-by: William Beckler <wbeckler@gmail.com>

This branch has not been deployed

No deployments
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.

1 participant