Repository navigation
DataRanger v0.8.0 #118
akshaysharma1088
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A fix to the hash-total check from 0.7.0, the first two of four steps toward safe apply on Snowflake, and two contributions from @areebaf29: Discord alerts and an Airflow example. If your control totals carry a
hash_total, upgrade: 0.7.0 could miss a two-row swap on days with more than about 200 rows.Fix: the hash total now decides the day (hash_total does not catch a two-row swap on days with more than about 200 rows #113). In 0.7.0 a
hash_totalin the control totals was compared as a fraction of its own value, so two amounts swapped between rows moved it by about one row's worth and stayed under the gate's threshold on any day with more than about 200 rows; a patrol reported such days as "no action needed". When a day's row count and amount match the control totals exactly, its hash total must now match exactly too. A swap on a day that is also short of late rows still cannot be seen.Fix: optional control measures on warehouse sources (hash_total does not catch a two-row swap on days with more than about 200 rows #113). Snowflake, BigQuery, Postgres and dbt sources selected only
nandamountfrom the control totals, sohash_total,min_amount,max_amountanddistinct_<column>were ignored there. The control totals are now read whole. Adistinct_<column>measure also follows your own column name (distinct_cust_idwith--reference cust_id) instead of being skipped.Check the Snowflake clone before any swap (Safe apply 2/4: check the clone against control totals in the warehouse #98, second part of safe apply, Safe apply on Snowflake: clone, verify, swap, undo #96).
snowflake_apply.verify_clonereads the fixed days back from the clone and holds them to the control totals with the same gap rule and threshold as the patrol's gate. Given the patrol's fixed table, it also requires each day to hold exactly the rows the gate approved. A failed check drops the clone. Two read-only queries; nothing inpatrolcalls it yet.Write a proven fix to a Snowflake clone (Safe apply 1/4: write fixed partitions to a zero-copy clone #97, first part of safe apply, Safe apply on Snowflake: clone, verify, swap, undo #96).
dataranger.connectors.snowflake_apply.write_fix_to_cloneclones the patrolled table and replays the fix on the clone as row-level statements, so columns the patrol never read stay as they were. The patrolled table is never written to, and nothing inpatrolcalls this yet: a patrol is still threeSELECTstatements. Fixes that reload rows from the source, and duplicate copies that differ only in a column the patrol did not read, are refused with a clear message.--notify-webhooksupports Discord webhooks: the summary is sent as{"content": ...}and cut to Discord's 2,000 character limit. Contributed by @areebaf29.Example: a daily patrol as an Airflow DAG, in
examples/airflow. Contributed by @areebaf29.This discussion was created from the release DataRanger v0.8.0.
All reactions