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

refactor: Remove debug asserts on scratch space #20224

Merged
merged 7 commits into from
Dec 9, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Dec 9, 2024

Always clear() instead

  • Also adds a change to skip checking projections when there is no slice for with_columns()

@nameexhaustion nameexhaustion changed the title refactor(internal): Remove debug asserts on scratch space refactor(rust): Remove debug asserts on scratch space Dec 9, 2024
@nameexhaustion nameexhaustion added the skip changelog Do not include in changelog label Dec 9, 2024
@github-actions github-actions bot added internal An internal refactor or improvement rust Related to Rust Polars and removed title needs formatting labels Dec 9, 2024
@nameexhaustion nameexhaustion marked this pull request as ready for review December 9, 2024 08:45
@nameexhaustion nameexhaustion marked this pull request as draft December 9, 2024 08:56
@nameexhaustion nameexhaustion changed the title refactor(rust): Remove debug asserts on scratch space refactor: Remove debug asserts on scratch space Dec 9, 2024
@github-actions github-actions bot added the python Related to Python Polars label Dec 9, 2024
@@ -45,7 +45,8 @@ mod inner {
}
}

pub(super) fn nodes_scratch_mut(&mut self) -> &mut UnitVec<Node> {
/// Returns shared scratch space after clearing.
pub(super) fn empty_nodes_scratch_mut(&mut self) -> &mut UnitVec<Node> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rename and add doc

@@ -146,7 +146,6 @@ pub fn pushdown_eligibility(
expr_arena: &mut Arena<AExpr>,
scratch: &mut UnitVec<Node>,
) -> PolarsResult<(PushdownEligibility, PlHashMap<PlSmallStr, PlSmallStr>)> {
debug_assert!(scratch.is_empty());
Copy link
Collaborator Author

@nameexhaustion nameexhaustion Dec 9, 2024

Choose a reason for hiding this comment

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

removed assert here

@@ -50,7 +51,6 @@ fn can_pushdown_slice_past_projections(
arena: &Arena<AExpr>,
scratch: &mut UnitVec<Node>,
) -> (bool, bool) {
debug_assert!(scratch.is_empty());
Copy link
Collaborator Author

@nameexhaustion nameexhaustion Dec 9, 2024

Choose a reason for hiding this comment

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

removed assert here

m @(Select {..}, None) |
m @ (SimpleProjection {..}, _)
m @ (Select {..}, None)
| m @ (HStack {..}, None)
Copy link
Collaborator Author

@nameexhaustion nameexhaustion Dec 9, 2024

Choose a reason for hiding this comment

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

The original MRE of the panic didn't actually contain a slice() - I realized this was because we were always checking the projections even when we didn't need to for with_columns()

@nameexhaustion nameexhaustion marked this pull request as ready for review December 9, 2024 09:18
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.63%. Comparing base (1cd807f) to head (2ebabe4).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
...rs-plan/src/plans/optimizer/slice_pushdown_expr.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20224      +/-   ##
==========================================
- Coverage   79.63%   79.63%   -0.01%     
==========================================
  Files        1565     1565              
  Lines      218192   218190       -2     
  Branches     2475     2475              
==========================================
- Hits       173749   173745       -4     
- Misses      43876    43878       +2     
  Partials      567      567              

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

@ritchie46 ritchie46 merged commit 4163fd3 into pola-rs:main Dec 9, 2024
26 checks passed
@c-peters c-peters added the accepted Ready for implementation label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars skip changelog Do not include in changelog
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants