<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Data-Contracts on 每日拍拍</title>
    <link>https://dailypypy.org/tags/data-contracts/</link>
    <description>Recent content in Data-Contracts on 每日拍拍</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-tw</language>
    <copyright>© 2026 每日拍拍</copyright>
    <lastBuildDate>Thu, 22 Oct 2026 11:14:00 +0800</lastBuildDate><atom:link href="https://dailypypy.org/tags/data-contracts/index.xml" rel="self" type="application/rss+xml" />
    <follow_challenge>
      <feedId>155076163427069952</feedId>
      <userId>154825760438254592</userId>
    </follow_challenge>
    
    
    <item>
      <title>Polars Join 資料契約：Key 唯一性、Cardinality 與 Null 對帳</title>
      <link>https://dailypypy.org/learn/polars-join-cardinality-validation/</link>
      <pubDate>Thu, 22 Oct 2026 11:14:00 +0800</pubDate>
      
      <guid>https://dailypypy.org/learn/polars-join-cardinality-validation/</guid>
      <description>&lt;!---
1440x768
prompt: masterpiece, best quality, highres, clean anime illustration, japanese anime style, soft shading, flat color design, 1girl, black hair, green eyes, white off-shoulder shirt, black short skirt, three-quarter cowboy shot with slight dutch angle, standing with one hand gently touching her chin and the other resting on her hip, inquisitive thoughtful closed-mouth smile, looking at viewer, pastel pale apricot background, neat composition, detailed eyes, cute and smart vibe, minimal background, polished illustration, no text
negative prompt: worst quality, bad eye, bad hand, extra limbs, manga, multiple views, monochrome, text, signature
dedup note: Focused relational-contract follow-up to ../python-polars/. ../pandas-data-cleaning/ has one many_to_one merge example; this is not its Polars translation. This article centers composite-key identity, multiplicative cardinality, explicit null policy, bidirectional anti-join reconciliation, matched-versus-null-attribute provenance, fail-closed enrichment and negative fixtures. ../polars-nested-json-ndjson/ owns nested expansion; ../polars-lazyframe-query-optimization/ owns execution plans. Strict 198-post current-source inventory checked before drafting.
source check: Official Polars DataFrame.join API and join guide reviewed 2026-10-22; executable examples target Python 3.12 / Polars 2.0.0. Policies below are fictional application contracts, not universal customer-data rules.
verification: Eight Python blocks parsed and sequential demo passed; 33 pytest cases passed on Python 3.12 / Polars 2.0.0, including native cardinality modes, Null policy, composite-key scope, empty inputs, schema drift and fail-closed gate. Current-source maximum character 5-gram Jaccard 0.066691 versus nested JSON; manual review confirms distinct relation-contract scope. Cover prompt 17999725-bcd3-448f-9cc0-0a44a1df08c2 produced DAILYPYPY_00143_.png, PNG 1440x768 verified and visually inspected for text, face, hands and artifacts.
publication note: date keeps the required random 10:00–13:00 time; publishDate permits the scheduled morning release with buildFuture=false.
---&gt;

&lt;h2 class=&#34;relative group&#34;&gt;一. 前言：Join 沒報錯，營收卻變多了 
    &lt;div id=&#34;一-前言join-沒報錯營收卻變多了&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
    
    &lt;span
        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
        &lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
            style=&#34;text-decoration-line: none !important;&#34; href=&#34;#%e4%b8%80-%e5%89%8d%e8%a8%80join-%e6%b2%92%e5%a0%b1%e9%8c%af%e7%87%9f%e6%94%b6%e5%8d%bb%e8%ae%8a%e5%a4%9a%e4%ba%86&#34; aria-label=&#34;定位點&#34;&gt;#&lt;/a&gt;
    &lt;/span&gt;        
    
&lt;/h2&gt;
&lt;p&gt;嗨，我是拍拍君。今天的任務很單純：替訂單補上客戶名稱。
五筆訂單進去，七筆資料出來，程式還笑咪咪地正常結束。
不是業績突然變好，是右表同一個客戶出現兩次。&lt;/p&gt;</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://dailypypy.org/learn/polars-join-cardinality-validation/featured.png" />
    </item>
    
  </channel>
</rss>
