Repository navigation
Preserve Chemical Comparison Semantics - #36
Merged
Merged
Conversation
…rove type hinting in helper functions
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
- Coverage 82.27% 81.92% -0.35%
==========================================
Files 24 25 +1
Lines 1709 1826 +117
Branches 41 62 +21
==========================================
+ Hits 1406 1496 +90
- Misses 294 315 +21
- Partials 9 15 +6 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes comparator behavior for Bingo and RDKit SQLAlchemy columns so Python operators preserve expected chemical semantics without breaking SQL NULL handling or SQLAlchemy internals.
Key Changes
!=on molecule and reaction columns now delegates literal values to chemical negative exact matching via.not_equals(...).==with a column RHS now preserves chemical exact matching instead of falling back to raw SQL equality.== Noneand!= Nonepreserve SQLAlchemy NULL behavior asIS NULLandIS NOT NULL.== Nonefor molecule and reaction columns now preserves SQLAlchemyIS NULLbehavior.Why This Matters
Raw SQL string equality is not chemically equivalent for molecules represented in different notations, such as
CCOandOCC. Bingo column-to-column equality must therefore compile to Bingo exact search:At the same time, common NULL filters must remain standard SQL: