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

Added equals macro that handles null value comparison #394

Merged
merged 14 commits into from
Dec 23, 2024

Conversation

adrianburusdbt
Copy link
Contributor

@adrianburusdbt adrianburusdbt commented Dec 19, 2024

resolves #
dbt-labs/dbt-core#7873
#159

Problem

Null comparison was not handled properly in the base adapter. While some value comparisons were missing this case altogether, others were fixed but not in a repeatable, organized way.

Solution

Based loosely on #110, but ultimately it's following the suggestions made here: dbt-labs/dbt-core#6997 (comment)
Extracted the logic that was in the test fixture into an 'equals.sql' macro that can be reused and replaced all other usages with this utility macro.

Integration tests with the proposed changes:
https://github.com/dbt-labs/dbt-postgres/actions/runs/12412018685

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development, and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX

@adrianburusdbt adrianburusdbt requested a review from a team as a code owner December 19, 2024 12:17
@cla-bot cla-bot bot added the cla:yes label Dec 19, 2024
Copy link
Contributor

@VersusFacit VersusFacit left a comment

Choose a reason for hiding this comment

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

@VersusFacit VersusFacit merged commit a035cd9 into main Dec 23, 2024
32 checks passed
@VersusFacit VersusFacit deleted the fix_null_equality_110 branch December 23, 2024 03:09
VersusFacit added a commit that referenced this pull request Dec 23, 2024
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.

2 participants