Beispiel
Match missing Int64 join keys with DataFrame.merge and validate their key cardinality
sha256:bcad84af5a7a444a332c8510e62933efa13ab58d9ca715a49afc7a0c95b2d6e8
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Match missing Int64 join keys with DataFrame.merge and validate their key cardinality HOW
- Pakete
- pandas 3.0.5
- Umgebung
- python 3.12
- Erstellt
- 2026-08-17T02:15:22Z
Häufige Annahme
An inner pandas DataFrame.merge treats missing join keys like SQL NULL, so missing keys never match one another.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- With two missing Int64 keys on each side, an inner DataFrame.merge returns four missing-key rows containing every left/right pair.
- validate='one_to_one' raises pandas.errors.MergeError when the only duplicate keys on both sides are missing values.
- After each side is reduced to one missing key, validate='one_to_one' succeeds and returns one missing-key match.
Dateien
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- test/contract.py
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9