diff --git a/models/dim_dbt__current_models.sql b/models/dim_dbt__current_models.sql index cb935256..d63ab5b3 100644 --- a/models/dim_dbt__current_models.sql +++ b/models/dim_dbt__current_models.sql @@ -1,14 +1,16 @@ with base as ( - select * + select + * from {{ ref('stg_dbt__models') }} ) , model_executions as ( - select * + select + * from {{ ref('stg_dbt__model_executions') }} ) @@ -16,7 +18,8 @@ with , latest_models as ( /* Retrieves the models present in the most recent run */ - select * + select + * from base where run_started_at = (select max(run_started_at) from base) diff --git a/tox.ini b/tox.ini index 8add76ba..0b4e2403 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = lint_all [sqlfluff] dialect = snowflake templater = dbt -rules = LT01,LT02,LT03,CP01,AL01,AL02,CP02,ST08,LT06,LT07,AM01,LT08,AL05,RF02,RF03,CP03,ST01,LT09,AM03,CP04,LT10,ST05,ST03,JJ01,AM05,CV08 +rules = LT01,LT03,CP01,AL01,AL02,CP02,ST08,LT06,LT07,AM01,LT08,AL05,RF02,RF03,CP03,ST01,LT09,AM03,CP04,LT10,ST05,ST03,JJ01,AM05,CV08 # LT01: [aliasing.table] Implicit/explicit aliasing of table. # AL02: [aliasing.column] Implicit/explicit aliasing of columns. @@ -20,7 +20,6 @@ rules = LT01,LT02,LT03,CP01,AL01,AL02,CP02,ST08,LT06,LT07,AM01,LT08,AL05,RF02,RF # CV08: [convention.left_join] Use 'LEFT JOIN' instead of 'RIGHT JOIN'. # JJ01: [jinja.padding] Jinja tags should have a single whitespace on either side. # LT01: [layout.spacing] Inappropriate Spacing. -# LT02: [layout.indent] Incorrect Indentation. # LT03: [layout.operators] Operators should follow a standard for being before/after newlines. # LT06: [layout.functions] Function name not immediately followed by parenthesis. # LT07: [layout.functions] 'WITH' clause closing bracket should be on a new line.