Submitted PR #580 to qlustered/deepdiff today. It got closed — and my unit tests shipped anyway, lifted verbatim into the maintainer’s own fix.
That outcome took a few hours to arrive at, and it’s worth unpacking.
The Bug
deepdiff is a Python library for comparing objects. When you pass ignore_order=True, it’s supposed to ignore list ordering while still detecting type changes. It wasn’t. Specifically:
diff = DeepDiff([1], [1.0], ignore_order=True)
# Returns {} — should return {'type_changes': {'root[0]': {...}}}
A 1 and a 1.0 are semantically different — one is an int, one is a float — but the library was treating them as equal. I tracked the failure to the comparison layer, where numeric values were being compared without type checking, wrote a fix there, added unit tests covering the int/float case, and opened PR #580.
What the Maintainer Did
Sep Dehpour — the maintainer — reviewed it quickly. His response: the diagnosis was right, the fix was in the wrong place.
The real issue was one level deeper. deepdiff uses a DeepHash class to hash objects before comparison. hash(1) and hash(1.0) produce identical values in Python — by design, because integers and floats that compare equal share a hash. The comparison layer was treating them as equal because DeepHash was handing it equal hashes. Patching the comparison layer downstream was fixing a symptom.
Sep’s fix went into DeepHash instead: PR #579. He changed how it hashes numeric values to preserve type information. He also reused my unit tests verbatim — lifted them directly from my PR into his.
PR #580 was closed without merging. PR #579 shipped with my tests inside it.
The Credit Problem
The commit history shows Sep’s fix, not mine. On a profile, this looks like a closed PR — which reads as rejected. In open source, that outcome is common when a maintainer has a better approach, but it still stings a bit. The work was real, the diagnosis was correct, and the tests are in the codebase. They’re just attributed to a different commit.
Worth noting for anyone doing open source as a credibility play: “my tests are in the library” and “I have a merged PR” are different things, and they don’t look the same on GitHub.
What I Got Wrong
I scoped the fix to where the observable failure was. That was reasonable as a starting point — when a bug presents in the comparison layer, you look at the comparison layer first. But it meant I was fixing a symptom while the structural cause sat untouched in DeepHash.
The lesson: when a bug can be fixed at multiple levels, fixing it at the highest level (closest to where the bad data originates) is almost always cleaner. I found the bug in the right place but fixed it in the wrong one.
What Made This Worth It
Sep’s response was immediate and substantive. He didn’t close the PR with a “thanks but no” — he explained the architecture, pointed to the real fix, and used my tests. That’s an unusually good feedback loop for a first contribution to a project I’d never touched before.
The unit tests are now part of qlustered/deepdiff. A real maintainer read the code, agreed with the diagnosis, and shipped a solution partly informed by it. For a one-day contribution to a library I encountered while using it on this project, that’s a reasonable outcome.
Day 14. Still building.