Skip to content

Commit

Permalink
fix: Fix Int128 dtype serialization (#20629)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemanley authored Jan 9, 2025
1 parent f3da50f commit 323b88c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions crates/polars-core/src/datatypes/_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ enum SerializableDataType {
Int16,
Int32,
Int64,
Int128,
Float32,
Float64,
String,
Expand Down Expand Up @@ -130,6 +131,7 @@ impl From<&DataType> for SerializableDataType {
Int16 => Self::Int16,
Int32 => Self::Int32,
Int64 => Self::Int64,
Int128 => Self::Int128,
Float32 => Self::Float32,
Float64 => Self::Float64,
String => Self::String,
Expand Down Expand Up @@ -186,6 +188,7 @@ impl From<SerializableDataType> for DataType {
Int16 => Self::Int16,
Int32 => Self::Int32,
Int64 => Self::Int64,
Int128 => Self::Int128,
Float32 => Self::Float32,
Float64 => Self::Float64,
String => Self::String,
Expand Down
7 changes: 6 additions & 1 deletion py-polars/tests/unit/io/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ def test_pickle() -> None:


def test_pickle_expr() -> None:
for e in [pl.all(), pl.len(), pl.duration(weeks=10, days=20, hours=3)]:
for e in [
pl.all(),
pl.len(),
pl.duration(weeks=10, days=20, hours=3),
pl.col("a").cast(pl.Int128),
]:
f = io.BytesIO()
pickle.dump(e, f)

Expand Down

0 comments on commit 323b88c

Please sign in to comment.