惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
小众软件
小众软件
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
Microsoft Security Blog
Microsoft Security Blog
Last Week in AI
Last Week in AI
H
Help Net Security
爱范儿
爱范儿
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
腾讯CDC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop adding print statements to debug your data pipeline ...
Abinesh N · 2026-05-21 · via DEV Community

Abinesh N

I built a Python decorator that watches your DataFrame pipelines automatically

You know this moment:

Input rows  : 1,000,000
Output rows :   263,979

Enter fullscreen mode Exit fullscreen mode

Somewhere in your pipeline, 736k rows disappeared.

Which step caused it?

A bad merge?
A silent dropna()?
A duplicate join key?
A dtype issue?
A filter you forgot existed?

So you start adding:

print(df.shape)
print(df.columns)
print(df.isnull().sum())

Enter fullscreen mode Exit fullscreen mode

…everywhere.

Then rerun the entire pipeline again.

That frustration is why I built dfwatcher.


What is dfwatcher?

dfwatcher is a lightweight decorator for pandas pipelines that automatically tracks:

  • row count changes
  • null deltas
  • schema drift
  • dtype changes
  • join explosions
  • memory usage
  • pipeline summaries

with zero config.

Just decorate your functions.

from watcher import watch

@watch
def clean(df):
    return df.dropna()

Enter fullscreen mode Exit fullscreen mode

That’s it.


Example

@watch
def merge_orders(df):
    return df.merge(orders, on="customer_id", how="left")

Enter fullscreen mode Exit fullscreen mode

Output:

merge_orders()  964,203 → 1,069,104  ▲ +104,901 rows (+10.9%) ⚠

  columns added : +tier

  💥 join explosion · duplication ratio 10.9%

  key column     top value    repeat count
  customer_id    9182               184

Enter fullscreen mode Exit fullscreen mode

Instead of just telling you rows increased…

…it tells you why.


Why I built it

Most pipeline bugs are not syntax bugs.

They’re data drift bugs.

The code runs successfully.
The tests pass.
The pipeline completes.

But the data quietly changes shape somewhere in the middle.

Those are the hardest bugs to debug because:

  • they’re silent
  • they propagate downstream
  • and they’re usually discovered hours later

I wanted something that behaves like:

“git diff for DataFrames”

but automatically during execution.


Features

Row tracking

clean()  1,000,000 → 964,203  ▼ -35,797 rows

Enter fullscreen mode Exit fullscreen mode

Null tracking

nulls -35,797  status  (35,797 → 0)

Enter fullscreen mode Exit fullscreen mode

Schema drift detection

columns added : +revenue_band

Enter fullscreen mode Exit fullscreen mode

Dtype change detection

dtype change : customer_id  int64 → object

Enter fullscreen mode Exit fullscreen mode

Join explosion detection

💥 join explosion

Enter fullscreen mode Exit fullscreen mode

Threshold guards

@watch(
    warn_on_loss=0.05,
    raise_on_loss=0.20
)

Enter fullscreen mode Exit fullscreen mode

Turn silent data corruption into CI failures.


Session summaries

with session("nightly ETL"):
    df = clean(df)
    df = merge(df)
    df = score(df)

Enter fullscreen mode Exit fullscreen mode

At the end you get a full pipeline summary automatically.


What surprised me while building it

The hardest part wasn’t row tracking.

It was making the output useful without becoming noisy.

A debugging tool that prints too much becomes another thing developers ignore.

So I focused heavily on:

  • readable terminal formatting
  • meaningful warnings
  • showing only the most important changes
  • zero-config defaults

The goal was:

install → decorate → immediately useful


Roadmap

Currently:

  • pandas support
  • memory tracking
  • custom handlers
  • CI-friendly summaries

Planned:

  • Polars backend
  • DuckDB backend
  • HTML / notebook renderer
  • structured JSON logging
  • global config system

Install

pip install dfwatcher

Enter fullscreen mode Exit fullscreen mode

GitHub:
https://github.com/Abineshabee/watcher

PyPI:
https://pypi.org/project/dfwatcher/


I’d genuinely love feedback from data engineers, ML engineers, analytics engineers, and pandas users.

Especially:

  • features you wish pipeline tools had
  • debugging pain points
  • weird merge bugs you’ve experienced
  • ideas for Polars / DuckDB support