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 tuple equality with null values #327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cmoesel
Copy link
Member

@cmoesel cmoesel commented Oct 23, 2024

Previously, if tuples had the same fields, and at least one field had a null value on one tuple and a non-null value on the other, then:

  • if the null/non-null field came after a field with different values, it returned false (which is correct)
  • if the null/non-null field came before a field with different values, it returned null (which is incorrect)

Now it will return the correct answer regardless of where the null/non-null field is.

NOTE: This PR does not fix npm audit issues or the codecov issue, as those have already been fixed in #326. As a result, this should be merged after #326.

Submitter:

  • This pull request describes why these changes were made
  • Code diff has been done and been reviewed (it does not contain: additional white space, not applicable code changes, debug statements, etc.)
  • Tests are included and test edge cases
  • Tests have been run locally and pass
  • Code coverage has not gone down and all code touched or added is covered.
  • Code passes lint and prettier (hint: use npm run test:plus to run tests, lint, and prettier)
  • All dependent libraries are appropriately updated or have a corresponding PR related to this change - N/A
  • cql4browsers.js built with npm run build:browserify if source changed.

Reviewer:

Name:

  • Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose
  • The tests appropriately test the new code, including edge cases
  • You have tried to break the code

Previously, if tuples had the same fields, and at least one field had a null value on one tuple and a non-null value on the other, then:
* if the null/non-null field came after a field with different values, it returned false (which is correct)
* if the null/non-null field came before a field with different values, it returned null (which is incorrect)

Now it will return the correct answer regardless of where the null/non-null field is.
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.

1 participant