Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ with
from mb_transactions
)

/* do this to prevent and db errors in case we can't self reference ...*/
{# do this to prevent and db errors in case we can't self reference ...#}
, transaction_time_today as (
select
transaction_id,
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_results/get_column_name_lists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@

{% else %}

/* No column list available */
{# No column list available #}
{% endif %}

{%- endmacro %}
Expand Down
14 changes: 7 additions & 7 deletions models/dim_dbt__current_models.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ with
model_executions as (select * from {{ ref("stg_dbt__model_executions") }}),
latest_models as (

/* Retrieves the models present in the most recent run */
{# Retrieves the models present in the most recent run #}
select * from base where run_started_at = (select max(run_started_at) from base)

),

latest_models_runs as (

/* Retreives all successful run information for the models present in the most
recent run and ranks them based on query completion time */
{# Retreives all successful run information for the models present in the most
recent run and ranks them based on query completion time #}
select
model_executions.node_id,
model_executions.was_full_refresh,
model_executions.query_completed_at,
model_executions.total_node_runtime,
model_executions.rows_affected
{% if target.type == "bigquery" %}, model_executions.bytes_processed {% endif %},
/* Row number by refresh and node ID */
{# Row number by refresh and node ID #}
row_number() over (
partition by latest_models.node_id, model_executions.was_full_refresh
order by model_executions.query_completed_at desc /* most recent ranked first */
order by model_executions.query_completed_at desc {# most recent ranked first #}
) as run_idx,
/* Row number by node ID */
{# Row number by node ID #}
row_number() over (
partition by latest_models.node_id order by model_executions.query_completed_at desc /* most recent ranked first */
partition by latest_models.node_id order by model_executions.query_completed_at desc {# most recent ranked first #}
) as run_idx_id_only
from model_executions
inner join latest_models on model_executions.node_id = latest_models.node_id
Expand Down
2 changes: 1 addition & 1 deletion models/sources/exposures.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with
dummy_cte as (

Expand Down
2 changes: 1 addition & 1 deletion models/sources/invocations.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with
dummy_cte as (

Expand Down
2 changes: 1 addition & 1 deletion models/sources/model_executions.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/models.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/seed_executions.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/seeds.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/snapshot_executions.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/snapshots.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/sources.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with dummy_cte as (select 1 as foo)

select
Expand Down
2 changes: 1 addition & 1 deletion models/sources/test_executions.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with
dummy_cte as (

Expand Down
2 changes: 1 addition & 1 deletion models/sources/tests.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Bigquery won't let us `where` without `from` so we use this workaround */
{# Bigquery won't let us `where` without `from` so we use this workaround #}
with
dummy_cte as (

Expand Down
Loading