Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement serde for Null columns #17218

Merged
merged 3 commits into from
Jun 26, 2024
Merged

feat: Implement serde for Null columns #17218

merged 3 commits into from
Jun 26, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Jun 26, 2024

This was previously unimplemented, which led to a panic. Now it works!

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Jun 26, 2024
let mut state = serializer.serialize_map(Some(3))?;
state.serialize_entry("name", self.name())?;
state.serialize_entry("datatype", self.dtype())?;
state.serialize_entry("values", &IterSer::new(std::iter::once(self.len())))?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels slightly hacky to encode the length under "values", but hey... it works!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Luckily we don't serialize to human readable anymore. 😉

@stinodego stinodego marked this pull request as ready for review June 26, 2024 14:50
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.83%. Comparing base (3115865) to head (389ccfc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17218      +/-   ##
==========================================
+ Coverage   80.81%   80.83%   +0.01%     
==========================================
  Files        1466     1466              
  Lines      192229   192249      +20     
  Branches     2745     2745              
==========================================
+ Hits       155355   155403      +48     
+ Misses      36371    36343      -28     
  Partials      503      503              

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

@ritchie46 ritchie46 merged commit 053765b into main Jun 26, 2024
27 checks passed
@ritchie46 ritchie46 deleted the serde-null branch June 26, 2024 15:25
@c-peters c-peters added the accepted Ready for implementation label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants