Skip to content

fix: enforce triplets string-or-null invariant in tools#56

Merged
Haigutus merged 1 commit into
mainfrom
fix/triplets-string-invariant
Jun 12, 2026
Merged

fix: enforce triplets string-or-null invariant in tools#56
Haigutus merged 1 commit into
mainfrom
fix/triplets-string-invariant

Conversation

@Haigutus

Copy link
Copy Markdown
Owner

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.

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

Enforce triplets invariant: ID/KEY/VALUE are always strings (or null), never mixed types

1 participant