fix: enforce triplets string-or-null invariant in tools#56
Merged
Conversation
Closes #55 ID/KEY/VALUE columns are always strings or null — never raw numbers or stringified None. Three leaks fixed: - pandas tableview_to_triplets: astype(str) made melt's NaN holes into literal "nan" strings (older pandas) or left float nan objects mixed in (pandas 3). Now casts to nullable "string" dtype — numbers become text, nulls stay null, matching the polars engine's Utf8 cast. - pandas set_triplets_value_by_key(_and_id): raw value assignment let ints into VALUE (and crashes on pandas 3 str-dtype columns). Values normalize via str(), None stays null. - polars set_triplets_value_by_key(_and_id): str(None) stored the literal string "None"; now a typed null literal. Engine-parity tests for roundtrip null handling, number stringification and set-value normalization.
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.
Closes #55
ID/KEY/VALUE columns are always strings or null — never raw numbers or
stringified None. Three leaks fixed:
literal "nan" strings (older pandas) or left float nan objects mixed
in (pandas 3). Now casts to nullable "string" dtype — numbers become
text, nulls stay null, matching the polars engine's Utf8 cast.
ints into VALUE (and crashes on pandas 3 str-dtype columns). Values
normalize via str(), None stays null.
literal string "None"; now a typed null literal.
Engine-parity tests for roundtrip null handling, number stringification
and set-value normalization.