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

DM-42324: Fix min/max rows logic for Deduplication. #11

Merged
merged 2 commits into from Jan 8, 2024

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Jan 3, 2024

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes (not user-visible)

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7fe8783) 99.50% compared to head (3d10fe9) 99.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          15       15           
  Lines        1216     1224    +8     
  Branches      102      102           
=======================================
+ Hits         1210     1218    +8     
  Misses          4        4           
  Partials        2        2           

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

def applied_max_rows(self, target: Relation) -> int | None:
# Docstring inherited.
if not target.columns:
return 1 if target.max_rows is None or target.max_rows >= 1 else 0
Copy link

Choose a reason for hiding this comment

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

Out of curiosity why can this ever be '1' instead of '0'? Doesn't no columns also imply no rows?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not quite; if you think of it as a list of dict rows it's the difference between [] and [{}]. But where it really matters is actually in what happens when you join a relation like this to a regular one with nonzero numbers of rows and columns: [{}] is the "join identity" - a join between it and any other relation is the other relation, while [] is the "join zero" relation - a join between it and any other relation yields a relation with no rows (but the other relation's columns).

@TallJimbo TallJimbo merged commit b0a325e into main Jan 8, 2024
12 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-42324 branch January 8, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants