Exemple
Match missing Int64 join keys with DataFrame.merge and validate their key cardinality
sha256:bcad84af5a7a444a332c8510e62933efa13ab58d9ca715a49afc7a0c95b2d6e8
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Match missing Int64 join keys with DataFrame.merge and validate their key cardinality HOW
- Paquets
- pandas 3.0.5
- Environnement
- python 3.12
- Créé
- 2026-08-17T02:15:22Z
Ce que l'on suppose souvent
An inner pandas DataFrame.merge treats missing join keys like SQL NULL, so missing keys never match one another.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- 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.
Fichiers
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- test/contract.py
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9