Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recency tag and conditionally enable recency tests #97

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/project_evaluator_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
DBT_JOB_TIMEOUT: 300
DBT_THREADS: 1
DBT_JOB_RETRIES: 1
IS_RECENCY_AIRFLOW_TASK: "false"

jobs:
dbt-project-evaluator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: Aggregate table for the history operations
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: Aggregate table for the history operations, taking only the soroban operations
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/fee_stats_agg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("fee_stats") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: day
field: cast(day_agg as timestamp)
interval: 2
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/history_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("history_assets") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: day
field: cast(batch_run_date as timestamp)
interval: 2
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("account_signers_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/ledger_current_state/accounts_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("accounts_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("claimable_balances_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/ledger_current_state/contract_code_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("contract_code_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: day
field: closed_at
interval: 7
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/ledger_current_state/contract_data_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("contract_data_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("liquidity_pools_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 24
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/ledger_current_state/offers_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("offers_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/ledger_current_state/trust_lines_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("trust_lines_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/ledger_current_state/ttl_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("ttl_current") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: hour
field: closed_at
interval: 12
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
2 changes: 2 additions & 0 deletions models/marts/trade_agg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ models:
description: '{{ doc("trade_agg") }}'
tests:
- dbt_utils.recency:
tags: [recency]
datepart: day
field: cast(day_agg as timestamp)
interval: 2
config:
enabled: '{{ target.name == "ci" or env_var("IS_RECENCY_AIRFLOW_TASK") == "true" }}'
severity: '{{ "error" if target.name == "prod" else "warn" }}'
meta:
description: "Monitors the freshness of your table over time, as the expected time between data updates."
Expand Down
Loading