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 tags to models #16

Merged
merged 10 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion models/intermediate/trades/int_trade_agg_day.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
cluster_by =["asset_a", "asset_b"]
tags = ["trade_agg"]
, cluster_by =["asset_a", "asset_b"]
)
}}

Expand Down
3 changes: 2 additions & 1 deletion models/intermediate/trades/int_trade_agg_month.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
cluster_by =["asset_a", "asset_b"]
tags = ["trade_agg"]
, cluster_by =["asset_a", "asset_b"]
)
}}

Expand Down
3 changes: 2 additions & 1 deletion models/intermediate/trades/int_trade_agg_week.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
cluster_by =["asset_a", "asset_b"]
tags = ["trade_agg"]
, cluster_by =["asset_a", "asset_b"]
)
}}

Expand Down
3 changes: 2 additions & 1 deletion models/intermediate/trades/int_trade_agg_year.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
cluster_by =["asset_a", "asset_b"]
tags = ["trade_agg"]
, cluster_by =["asset_a", "asset_b"]
)
}}

Expand Down
2 changes: 1 addition & 1 deletion models/marts/enriched_history_operations.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ config(
tags = ["partnership_assets", "asset_stats"],
tags = ["enriched_history_operations"],
materialized='incremental',
unique_key=["op_id"],
partition_by={
Expand Down
11 changes: 0 additions & 11 deletions models/marts/enriched_history_operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ models:
meta:
description:
"Monitors the freshness of your table over time, as the expected time between data updates."
- elementary.dimension_anomalies:
timestamp_column: closed_at
backfill_days: 90
dimensions:
- "type"
time_bucket:
period: day
count: 1
meta:
description:
"Monitors the frequency of values in the type column over time."
columns:
- name: op_id
description: '{{ doc("operation_id") }}'
Expand Down
3 changes: 2 additions & 1 deletion models/marts/fee_stats_agg.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ config(
tags=["fee_stats_agg"],
materialized='incremental',
unique_key=["day_agg"],
partition_by={
Expand Down Expand Up @@ -164,4 +165,4 @@ with
)

select distinct *
from renaming
from renaming
5 changes: 3 additions & 2 deletions models/marts/history_assets.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ config(
materialized='incremental'
tags = ["history_assets", "trade_agg"]
sydneynotthecity marked this conversation as resolved.
Show resolved Hide resolved
, materialized='incremental'
, unique_key=["asset_id"]
, cluster_by= ["asset_id"]
)
Expand Down Expand Up @@ -81,4 +82,4 @@
{% endif %}

select *
from add_assets
from add_assets
7 changes: 4 additions & 3 deletions models/marts/trade_agg.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{ config(
materialized='incremental',
partition_by={
tags = ["trade_agg"],
materialized = 'incremental',
partition_by = {
"field": "day_agg"
, "data_type": "date"
, "granularity": "month"}
Expand Down Expand Up @@ -117,4 +118,4 @@ with
)

select *
from join_trades
from join_trades
11 changes: 1 addition & 10 deletions models/sources/src_accounts_signers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ sources:
meta:
description:
"Monitors the freshness of your table over time, as the expected time between data updates."
- elementary.volume_anomalies:
timestamp_column: batch_run_date
backfill_days: 90
time_bucket:
period: day
count: 1
meta:
description:
"Monitors the row count of your table over time."
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- account_id
Expand Down Expand Up @@ -88,4 +79,4 @@ sources:
tests:
- not_null:
config:
where: batch_run_date > current_datetime - interval 2 day
where: batch_run_date > current_datetime - interval 2 day
5 changes: 5 additions & 0 deletions models/staging/stg_account_signers.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["current_state"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_accounts.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["current_state"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_claimable_balances.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["claimable_balances"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_history_assets.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["history_assets", "trade_agg"]
)
}}

/* This query prepares the assets of each load for deduplication,
in order to guarantee a new asset won't be loaded twice */
with
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_history_effects.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["history_effects"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_history_ledgers.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["enriched_history_operations"]
sydneynotthecity marked this conversation as resolved.
Show resolved Hide resolved
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_history_operations.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["enriched_history_operations"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_history_trades.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["trade_agg"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_history_transactions.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["enriched_history_operations"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_liquidity_pools.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["current_state"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_offers.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["current_state"]
)
}}

with
raw_table as (
select *
Expand Down
5 changes: 5 additions & 0 deletions models/staging/stg_trust_lines.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ config(
tags = ["current_state"]
)
}}

with
raw_table as (
select *
Expand Down