Skip to content

Snowflake integration

pip install "dataranger[snowflake]"
dataranger patrol --snowflake --table ANALYTICS.GOLD.PAYMENTS --ref-table ANALYTICS.GOLD.CUSTOMERS \
    --manifest-table ANALYTICS.OPS.CONTROL_TOTALS --key payment_id --reference customer_id \
    --date booking_date --segment channel --amount amount --days 45

DataRanger runs three SELECT statements and nothing else, so a read-only role is enough and the warehouse is never modified. It selects only the mapped columns, and --days limits both the facts and the control totals, so a patrol costs a few seconds of a small warehouse. Use at least 30 days so the checks have a baseline. Queries carry the query tag dataranger, so they are easy to find in query history.

Credentials are read from where you already keep them; DataRanger stores nothing:

  • --snowflake uses SNOWFLAKE_ACCOUNT and SNOWFLAKE_USER, with SNOWFLAKE_PASSWORD, SNOWFLAKE_PRIVATE_KEY_PATH (and SNOWFLAKE_PRIVATE_KEY_PASSPHRASE) or SNOWFLAKE_AUTHENTICATOR, plus SNOWFLAKE_ROLE, SNOWFLAKE_WAREHOUSE, SNOWFLAKE_DATABASE and SNOWFLAKE_SCHEMA. With multi-factor login, set SNOWFLAKE_AUTHENTICATOR=username_password_mfa and put the current code from your authenticator app in SNOWFLAKE_PASSCODE. For scheduled jobs, use a key pair.
  • --snowflake prod uses the connection named prod in ~/.snowflake/connections.toml, the file the Snowflake CLI uses.

Column names are matched without regard to case, so --key payment_id finds PAYMENT_ID. To try it on a trial account with demo data, follow examples/snowflake.