Skip to content

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

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.24%. Comparing base (d37f845) to head (827081d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #327   +/-   ##
=======================================
  Coverage   87.23%   87.24%           
=======================================
  Files          52       52           
  Lines        4537     4538    +1     
  Branches     1279     1279           
=======================================
+ Hits         3958     3959    +1     
  Misses        369      369           
  Partials      210      210           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hossenlopp hossenlopp self-requested a review March 30, 2025 23:09
Copy link
Contributor

@hossenlopp hossenlopp left a comment

Choose a reason for hiding this comment

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

Looks good and I don't foresee any issues with this after a rebase.

@elsaperelli elsaperelli self-requested a review March 31, 2025 14:24
@elsaperelli elsaperelli self-assigned this Mar 31, 2025
@hossenlopp hossenlopp self-assigned this Mar 31, 2025
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.
@cmoesel cmoesel force-pushed the fix-tuple-equality branch from 3a4c785 to a752e2b Compare March 31, 2025 17:52
@hossenlopp hossenlopp self-requested a review March 31, 2025 17:58
Copy link
Contributor

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

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

Lgtm!

Copy link
Contributor

@hossenlopp hossenlopp left a comment

Choose a reason for hiding this comment

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

A few more suggested tests from when I attempted to "break" the code.

cmoesel and others added 2 commits March 31, 2025 15:07
Co-authored-by: hossenlopp <hossenlopp@mitre.org>
Co-authored-by: hossenlopp <hossenlopp@mitre.org>
@cmoesel
Copy link
Member Author

cmoesel commented Mar 31, 2025

@hossenlopp - I accepted your suggestions so this is ready for your approval!

@hossenlopp hossenlopp self-requested a review March 31, 2025 19:15
Copy link
Contributor

@hossenlopp hossenlopp left a comment

Choose a reason for hiding this comment

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

👍

@cmoesel cmoesel merged commit e113d9b into master Mar 31, 2025
8 checks passed
@cmoesel cmoesel deleted the fix-tuple-equality branch March 31, 2025 19:18
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.

5 participants