Skip to content

Relax SorbetColumnDescriptors and add ChunkColumnDescriptors #9934

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

Merged
merged 10 commits into from
May 9, 2025

Conversation

emilk
Copy link
Member

@emilk emilk commented May 8, 2025

Related

What

SorbetColumnDescriptors no longer enforces the order of columns. Instead there is a new ChunkColumnDescriptors that enforces this.

@emilk emilk added 🚜 refactor Change the code, not the functionality exclude from changelog PRs with this won't show up in CHANGELOG.md feat-dataframe-view Everything related to the dataframe view feat-dataframe-api Everything related to the dataframe API labels May 8, 2025
@emilk
Copy link
Member Author

emilk commented May 8, 2025

@rerun-bot full-check

@emilk emilk added the 🔩 data model Sorbet label May 8, 2025
Copy link

github-actions bot commented May 8, 2025

Copy link

github-actions bot commented May 8, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
916ed63 https://rerun.io/viewer/pr/9934 +nightly +main

Note: This comment is updated whenever you push a commit.

@emilk
Copy link
Member Author

emilk commented May 8, 2025

@rerun-bot full-check

Copy link

github-actions bot commented May 8, 2025

Copy link
Member

@abey79 abey79 left a comment

Choose a reason for hiding this comment

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

Much needed changes, thanks!

Comment on lines +31 to +38
impl std::ops::Deref for SorbetColumnDescriptors {
type Target = [ColumnDescriptor];

#[inline]
fn deref(&self) -> &Self::Target {
&self.columns
}
}
Copy link
Member

Choose a reason for hiding this comment

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

In general, I dislike Deref in any other context than smart pointer (as per the documentation). In this particular case, I'm afraid in potential method name collisions down the line. I'd much rather have a as_slice() method, which happens to be rather standard in std.

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case I disagree - SorbetColumnDescriptors is just a Vec<ColumnDescriptor> with some helper methods on it, and I think that is a perfect use of Deref

Copy link
Member

Choose a reason for hiding this comment

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

I'll note that there is already an ambiguity with IntoInterator, since both SorbetColumnDescriptors and its deref target implements it, but that's not a hill i'm willing to die on.

@emilk emilk merged commit 54ddc8c into main May 9, 2025
37 checks passed
@emilk emilk deleted the emilk/sorbet-chunk-column-split branch May 9, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔩 data model Sorbet exclude from changelog PRs with this won't show up in CHANGELOG.md feat-dataframe-api Everything related to the dataframe API feat-dataframe-view Everything related to the dataframe view 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SorbetColumnDescriptors requires that Schema's be in a particular order
2 participants