SnowflakeIntervalCheckOperator

Snowflake

Checks that the values of metrics given as SQL expressions are within a certain tolerance of the ones from days_back before.

View on GitHub

Last Updated: Jul. 29, 2022

Access Instructions

Install the Snowflake provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

tableRequiredthe table name
days_backnumber of days between ds and the ds we want to check against. Defaults to 7 days
metrics_thresholdsRequireda dictionary of ratios indexed by metrics, for example ‘COUNT(*)’: 1.5 would require a 50 percent or less difference between the current day, and the prior days_back.
snowflake_conn_idReference to Snowflake connection id
autocommitif True, each command is automatically committed. (default value: True)
parameters(optional) the parameters to render the SQL query with.
warehousename of warehouse (will overwrite any warehouse defined in the connection’s extra JSON)
databasename of database (will overwrite database defined in connection)
schemaname of schema (will overwrite schema defined in connection)
rolename of role (will overwrite any role defined in connection’s extra JSON)
authenticatorauthenticator for Snowflake. ‘snowflake’ (default) to use the internal Snowflake authenticator ‘externalbrowser’ to authenticate using your web browser and Okta, ADFS or any other SAML 2.0-compliant identify provider (IdP) that has been defined for your account ‘https://.okta.com’ to authenticate through native Okta.
session_parametersYou can set session-level parameters at the time you connect to Snowflake

Documentation

Checks that the values of metrics given as SQL expressions are within a certain tolerance of the ones from days_back before.

This method constructs a query like so

SELECT {metrics_threshold_dict_key} FROM {table}
WHERE {date_filter_column}=<date>

Was this page helpful?