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

Minor: reduce code duplication in PruningPredicate test #8441

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 6, 2023

Which issue does this PR close?

Follow on to #8440

Rationale for this change

I made a function that was more concise and easier to understand than current tests which have substantial duplication, as part of #8440, but wanted to keep that PR as small as possible to make review easier.

What changes are included in this PR?

  1. refactor other tests to use prune_with_expr to reduce code duplication

Are these changes tested?

all tests

Are there any user-facing changes?

@github-actions github-actions bot added physical-expr Physical Expressions core Core DataFusion crate labels Dec 6, 2023
@alamb alamb force-pushed the alamb/cleanup_pruning_tests branch from cd9a6ef to 1a352dd Compare December 23, 2023 12:21
@github-actions github-actions bot removed the physical-expr Physical Expressions label Dec 23, 2023
@alamb alamb marked this pull request as ready for review December 23, 2023 12:23
vec![Some(0), Some(4), None, Some(3)], // min
vec![Some(5), Some(6), Some(4), None], // max

prune_with_expr(
Copy link
Contributor Author

@alamb alamb Dec 23, 2023

Choose a reason for hiding this comment

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

The idea is to reduce the boiler plate required to setup the test / prune the expression, and simply list the data and expected results. It may not be many less lines, but the logic is significantly less dense in my opinion

@alamb
Copy link
Contributor Author

alamb commented Jan 1, 2024

cc @yahoNanJing

@crepererum do you have time to review this PR?

@alamb
Copy link
Contributor Author

alamb commented Jan 3, 2024

@Ted-Jiang I wonder if you have some time to review this PR?

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

I think the good about prune_with_expr is it makes the test more readable, thought the lines are not reduced.

Copy link
Member

@Ted-Jiang Ted-Jiang left a comment

Choose a reason for hiding this comment

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

👍

@alamb alamb merged commit e5036d0 into apache:main Jan 4, 2024
22 checks passed
@alamb
Copy link
Contributor Author

alamb commented Jan 4, 2024

Thank you @viirya and @Ted-Jiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants