chore: Raise on primary key dtype mimsatch - #56
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 1140 1138 -2
=========================================
- Hits 1140 1138 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Copilot started reviewing on behalf of
Marius Merkle (MariusMerkleQC)
August 31, 2026 14:03
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Pull request overview
This PR changes Diffly’s primary-key validation behavior to fail fast when the left/right primary key column dtypes are incompatible, instead of warning and silently disabling the primary key. This makes dtype mismatches explicit and prevents comparisons from continuing in an unintended “no primary key” mode.
Changes:
- Replace the previous
UserWarning+primary_key = Nonefallback with raisingPrimaryKeyErrorwhen join-key dtypes are incompatible. - Update the corresponding unit test to assert the new exception-based behavior.
File summaries
| File | Description |
|---|---|
diffly/comparison.py |
Converts primary key dtype incompatibility handling from a warning-and-fallback to raising PrimaryKeyError. |
tests/test_dataframe_comparison.py |
Updates the dtype-mismatch test to expect PrimaryKeyError instead of a warning. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Marius Merkle (MariusMerkleQC)
marked this pull request as ready for review
August 31, 2026 14:55
Marius Merkle (MariusMerkleQC)
requested review from
EgeKaraismailogluQC and
Oliver Borchert (borchero)
as code owners
August 31, 2026 14:55
Oliver Borchert (borchero)
approved these changes
Aug 31, 2026
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.
Motivation
Solves #52.
Changes
Instead of silently ignoring an invalid primary key (e.g. due to data type mismatch), I suggest raising a
PrimaryKeyErroras we do for other instances where the passedprimary_keyis in fact not a valid primary key.