Skip string coordinates in partition bound computation#153
Merged
alxmrs merged 2 commits intoMar 22, 2026
Conversation
alxmrs
approved these changes
Mar 22, 2026
alxmrs
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. I'm sorry, I introduced a merge conflict here by merging #155. But, that should be a quick fix, then I think this would be good to merge into main.
I really you filing the bug and making the fix! Welcome to the project.
Comment on lines
+326
to
+327
| if len(coord_values) == 0: | ||
| continue |
Collaborator
There was a problem hiding this comment.
Thanks, this is a good idea.
| @@ -192,3 +193,21 @@ def test_cross_join(air_and_stations): | |||
| "SELECT COUNT(*) AS total FROM air_data CROSS JOIN stations" | |||
| ).to_pandas() | |||
| assert result["total"].iloc[0] > 0 | |||
|
|
|||
|
|
|||
| def test_string_coordinates(): | |||
Collaborator
There was a problem hiding this comment.
Thanks, good to have this test, and it's clear to read.
Contributor
Author
There was a problem hiding this comment.
Thanks for the review!!
String-typed coordinates (dtype U, S, O) crash in _block_metadata() because numpy min/max ufuncs do not support string comparison. Since ScalarBound only supports Int64/Float64/TimestampNanos, skip string coordinates so the Rust pruning logic treats the dimension conservatively (never prunes on it). Partial fix for xqlsystems#121.
The project uses pyink-use-majority-quotes = true, which enforces double quotes. Single quotes in the string dtype check caused the lint CI to fail.
ghostiee-11
force-pushed
the
fix/string-coord-partition-bounds
branch
from
March 22, 2026 04:50
f5c5414 to
e57a2b4
Compare
Contributor
Author
|
Fixed the conflicts.. |
alxmrs
approved these changes
Mar 22, 2026
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.
Description
String-typed coordinates (e.g. station IDs, model names) crash during dataset registration because
_block_metadata()callsnp.min()/np.max()on the coordinate array, and numpy'sminimumufunc does not support string dtypes.Fix
Skip coordinates with string/object dtypes (
kind in ('U', 'S', 'O')) before computing min/max bounds. The RustScalarBoundenum only supportsInt64/Float64/TimestampNanos, so string bounds would fail downstream regardless. Skipping makes the pruning logic treat the dimension conservatively (never prunes on it).Also flattened the indentation by converting the
if len > 0block to an earlycontinue.Tests
Added
test_string_coordinates. All 11 tests pass.Partial fix for #121.