Skip to main content
scripts/compare_stream_batch.py · chapter Comparing the answers, file 2 · 69 lines · open in the repository

What it does

Streaming vs batch: does the stream reproduce the batch event study’s answer key? (task #9) Joins the streaming job’s event CARs (data/stream/event_car/) to the batch study’s (data/results/batch_event_car.parquet) on ticker, event_type and event_date, and compares every column. Decisions 0004 and 0006 expect equal values, so any difference beyond rounding error is a failure. See streaming/compare.py for the rules. Run from anywhere, after the streaming job and the batch study:
—stream is the job’s output folder (the one holding signals/ and event_car/). Exits with code 1 if the two disagree.

Connections

Uses: src/common/contracts.py, src/common/settings.py, src/common/study.py, src/eventstudy/car.py, src/streaming/compare.py

Source

scripts/compare_stream_batch.py