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

fix: boolean and/or expressions with null #3544

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

kevinzwang
Copy link
Member

@kevinzwang kevinzwang commented Dec 11, 2024

Resolves #3512

A fun truth table ($V_{x}$ is the validity $x$, $L$ is left, and $R$ is right):

$L$ $V_{L}$ $R$ $V_{R}$ $∧$ $V_{∧}$ $∨$ $V_{∨}$
⬜️ ⬜️ ⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️ ⬜️ ⬜️
⬜️ ⬜️
⬜️ ⬜️ ⬜️
⬜️ ⬜️
⬜️ ⬜️

Copy link

codspeed-hq bot commented Dec 11, 2024

CodSpeed Performance Report

Merging #3544 will degrade performances by 10.05%

Comparing kevin/boolean-comparison-null (54f9e66) with main (e5ea73f)

Summary

⚡ 2 improvements
❌ 1 regressions
✅ 14 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main kevin/boolean-comparison-null Change
test_count[1 Small File] 4.1 ms 3.5 ms +17.59%
test_iter_rows_first_row[100 Small Files] 191.2 ms 166.1 ms +15.15%
test_show[100 Small Files] 16.1 ms 17.9 ms -10.05%

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 only touched this file to update test values but Ruff wanted to reformat it as well

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 92.20779% with 6 lines in your changes missing coverage. Please review.

Project coverage is 77.69%. Comparing base (c8f8490) to head (54f9e66).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/daft-core/src/array/ops/comparison.rs 92.20% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3544   +/-   ##
=======================================
  Coverage   77.69%   77.69%           
=======================================
  Files         710      710           
  Lines       86896    86938   +42     
=======================================
+ Hits        67511    67550   +39     
- Misses      19385    19388    +3     
Files with missing lines Coverage Δ
src/daft-core/src/array/ops/comparison.rs 76.59% <92.20%> (+0.42%) ⬆️

... and 2 files with indirect coverage changes

src/daft-core/src/array/ops/comparison.rs Outdated Show resolved Hide resolved
),
))
}

match (self.len(), rhs.len()) {
(x, y) if x == y => {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe better names than x and y?

Copy link
Member Author

@kevinzwang kevinzwang Dec 11, 2024

Choose a reason for hiding this comment

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

This naming seems to exist across all of the ops so I think I will just leave it be. Don't want to make this PR too big or stray away from convention

src/daft-core/src/array/ops/comparison.rs Show resolved Hide resolved
src/daft-core/src/array/ops/comparison.rs Show resolved Hide resolved
@kevinzwang
Copy link
Member Author

@andrewgazelka could you give this a second look?

@kevinzwang kevinzwang enabled auto-merge (squash) December 11, 2024 01:12
@kevinzwang kevinzwang merged commit d103573 into main Dec 11, 2024
40 of 41 checks passed
@kevinzwang kevinzwang deleted the kevin/boolean-comparison-null branch December 11, 2024 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

daft.Expression.__or__ and daft.Expression.__and__ should not propagate nulls
2 participants