Skip to content

fix(rust): Fix ser/de PlSmallStr error#19060

Merged
orlp merged 3 commits intopola-rs:mainfrom
kgv:main
Oct 1, 2024
Merged

fix(rust): Fix ser/de PlSmallStr error#19060
orlp merged 3 commits intopola-rs:mainfrom
kgv:main

Conversation

@kgv
Copy link
Contributor

@kgv kgv commented Oct 1, 2024

0.42.0 - ser/de - OK
0.43.1 - ser/de - Err: SpannedError { code: ExpectedMapColon, position: Position { line: 1, col: 19 } }

PlSmallStr is tuple struct, but deserialize doesn't expect it
serde(transparent) fix this

let data_frame = df! {
    "STRING" => &["1", "2"],
}
.unwrap();
let string = ron::ser::to_string(&data_frame).unwrap();
println!("string: {string}");
// 0.42.0: string: (columns:[{"name":"STRING","datatype":String,"bit_settings":"","values":[Some("1"),Some("2")]}])
// 0.43.1: string: (columns:[{"name":("STRING"),"datatype":String,"bit_settings":"","values":[Some("1"),Some("2")]}])
let data_frame = ron::from_str::<DataFrame>(&string).unwrap();
println!("data_frame: {data_frame}");

@kgv kgv changed the title Fix ser/de PlSmallStr error fix(rust): Fix ser/de PlSmallStr error Oct 1, 2024
@github-actions github-actions bot added fix Bug fix rust Related to Rust Polars and removed title needs formatting labels Oct 1, 2024
@codecov
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.76%. Comparing base (a2d00f1) to head (411e0f6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19060      +/-   ##
==========================================
- Coverage   79.77%   79.76%   -0.01%     
==========================================
  Files        1531     1531              
  Lines      208487   208487              
  Branches     2913     2913              
==========================================
- Hits       166320   166304      -16     
- Misses      41616    41632      +16     
  Partials      551      551              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orlp orlp merged commit da8f358 into pola-rs:main Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants