Deduplicate the daily export

Python · Python · beginner · greenfield

Deduplicates the export by order_id, keeping the latest row per id using pandas' built-in dedupe with a recency preference. Returns the cleaned frame.

Requirements

Files touched

--- etl/dedupe.py
+import pandas as pd
+
+
+def dedupe_orders(df: pd.DataFrame) -> pd.DataFrame:
+    return df.drop_duplicates(subset="order_id", keep="latest")

Review this PR

Python practice