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

Replace some of our use of polars #4801

Merged
merged 7 commits into from
Jan 15, 2024
Merged

Replace some of our use of polars #4801

merged 7 commits into from
Jan 15, 2024

Conversation

emilk
Copy link
Member

@emilk emilk commented Jan 12, 2024

What

We're using polars for some tests.
This PR replaces polars with our own data tables for the tests.

https://github.com/rerun-io/rerun/blob/main/crates/re_data_store/tests/data_store.rs is left, and a pain in the ass.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@emilk emilk added dependencies concerning crates, pip packages etc 🚜 refactor Change the code, not the functionality exclude from changelog PRs with this won't show up in CHANGELOG.md labels Jan 12, 2024
_ = _store.to_dataframe(); // simple way of checking that everything is still readable
}
fn check_still_readable(store: &DataStore) {
store.to_data_table().unwrap(); // simple way of checking that everything is still readable
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% sure what the comment means by "readable"

Copy link
Member

Choose a reason for hiding this comment

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

It's a simple sanity check that it is still possible to iterate through the entire store and get all the data out in a table.
Pretty basic but has failed quite a few times 😇

Comment on lines +142 to +147
{
// We use a RowSet instead of a DataTable to handle duplicate RowIds.
let mut row_set = RowSet::default();
row_set.insert_tables(store1.to_data_tables(None));
row_set.insert_into(store2);
sanity_unwrap(store2);
Copy link
Member Author

Choose a reason for hiding this comment

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

The old code would use "retrying" to generate new row-ids, which mean the resulting DataTables weren't the same anymore, hence the new RowSet test struct.

The old test worked because to_dataframe ignored rowids

@teh-cmc teh-cmc self-requested a review January 15, 2024 07:40
crates/re_data_store/tests/dump.rs Show resolved Hide resolved
Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
@emilk emilk merged commit d8569ee into main Jan 15, 2024
40 checks passed
@emilk emilk deleted the emilk/replace-polars branch January 15, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies concerning crates, pip packages etc exclude from changelog PRs with this won't show up in CHANGELOG.md 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants