diff --git a/.docker/dagster/Dockerfile b/.docker/dagster/Dockerfile index a7fbc35df..ccc6c90af 100644 --- a/.docker/dagster/Dockerfile +++ b/.docker/dagster/Dockerfile @@ -30,7 +30,7 @@ COPY analytics/dagster/dagster.yaml analytics/dagster/workspace.yaml $DAGSTER_HO COPY analytics/dagster/src $DAGSTER_HOME/src -COPY analytics/dbt/ /opt/dagster/dbt/ +COPY analytics/dbt /opt/dagster/dbt COPY analytics/dbt/target/manifest.json /opt/dagster/dbt/target/manifest.json WORKDIR $DAGSTER_HOME diff --git a/analytics/dbt/target/manifest.json b/analytics/dbt/target/manifest.json new file mode 100644 index 000000000..4a4b370a2 --- /dev/null +++ b/analytics/dbt/target/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.8.1", "generated_at": "2025-01-09T14:57:38.477788Z", "invocation_id": "1d8fb497-454a-490b-bd31-ef161d37f1e1", "env": {}, "project_name": "zlv_dbt_project", "project_id": "90846df22f107691fe136e12b7570ff5", "user_id": "21b741a1-0ed3-4565-8a7c-468d9e923bf0", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.zlv_dbt_project.stg_common_fusions": {"database": "database_name", "schema": "main_stg", "name": "stg_common_fusions", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_fusions.sql", "original_file_path": "models/staging/common/stg_common_fusions.sql", "unique_id": "model.zlv_dbt_project.stg_common_fusions", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_fusions"], "alias": "stg_common_fusions", "checksum": {"name": "sha256", "checksum": "605a01f8242f427c09c073bdca10d1845ea89f2f36d3c7f0d143bba654a63a96"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.103563, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_fusions\"", "raw_code": "SELECT\n ANNEE_MODIF AS YEAR,\n CAST(COM_INI AS VARCHAR) AS GEO_CODE_SOURCE,\n CAST(COM_FIN AS VARCHAR) AS GEO_CODE_DESTINATION,\n LIB_COM_INI AS LIBELLE_SOURCE,\n LIB_COM_FIN AS LIBELLE_DESTINATION\nFROM {{ ref ('fusions') }}", "language": "sql", "refs": [{"name": "fusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.fusions"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_departements_france": {"database": "database_name", "schema": "main_stg", "name": "stg_common_departements_france", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_departements_france.sql", "original_file_path": "models/staging/common/stg_common_departements_france.sql", "unique_id": "model.zlv_dbt_project.stg_common_departements_france", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_departements_france"], "alias": "stg_common_departements_france", "checksum": {"name": "sha256", "checksum": "8d9de8c8cdd796a1411a12b29e0f3eadcc99075a85c2e95c29cee4a543454372"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.103402, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_departements_france\"", "raw_code": "SELECT\n code_departement,\n nom_departement,\n code_region,\n nom_region\nFROM {{ ref ('departements_france') }}", "language": "sql", "refs": [{"name": "departements_france", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.departements_france"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_cities": {"database": "database_name", "schema": "main_stg", "name": "stg_common_cities", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_cities.sql", "original_file_path": "models/staging/common/stg_common_cities.sql", "unique_id": "model.zlv_dbt_project.stg_common_cities", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_cities"], "alias": "stg_common_cities", "checksum": {"name": "sha256", "checksum": "d200aab203cf60b6895305d87a1ac2e6b7035724990f857eecf2fb89ec254e03"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.102129, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_cities\"", "raw_code": "SELECT *\nFROM {{ ref ('cities') }}", "language": "sql", "refs": [{"name": "cities", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.cities"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_scissions": {"database": "database_name", "schema": "main_stg", "name": "stg_common_scissions", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_scissions.sql", "original_file_path": "models/staging/common/stg_common_scissions.sql", "unique_id": "model.zlv_dbt_project.stg_common_scissions", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_scissions"], "alias": "stg_common_scissions", "checksum": {"name": "sha256", "checksum": "2e71c13222cd1ee09c760ca52f9971ef191cc16feff68c50c8fe130914d32cb9"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.103722, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_scissions\"", "raw_code": "SELECT\n ANNEE_MODIF AS YEAR,\n CAST(COM_INI AS VARCHAR) AS GEO_CODE_SOURCE,\n CAST(COM_FIN AS VARCHAR) AS GEO_CODE_DESTINATION,\n LIB_COM_INI AS LIBELLE_SOURCE,\n LIB_COM_FIN AS LIBELLE_DESTINATION\nFROM {{ ref ('scissions') }}", "language": "sql", "refs": [{"name": "scissions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.scissions"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_com_epci_dep_region": {"database": "database_name", "schema": "main_stg", "name": "stg_common_com_epci_dep_region", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_com_epci_dep_region.sql", "original_file_path": "models/staging/common/stg_common_com_epci_dep_region.sql", "unique_id": "model.zlv_dbt_project.stg_common_com_epci_dep_region", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_com_epci_dep_region"], "alias": "stg_common_com_epci_dep_region", "checksum": {"name": "sha256", "checksum": "1ed4b3d7d17703888129278f4b3f15f553415ecef2080a02752933b6c0bd7568"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.103242, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_com_epci_dep_region\"", "raw_code": "SELECT\n com_code AS geo_code,\n com_siren,\n com_name,\n epci_siren,\n epci_name,\n dep_siren,\n dep_name,\n reg_siren,\n reg_name,\n ept_siren,\n ept_name\n\nFROM {{ ref ('com_epci_dep_reg') }}", "language": "sql", "refs": [{"name": "com_epci_dep_reg", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.com_epci_dep_reg"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_table_appartenance": {"database": "database_name", "schema": "main_stg", "name": "stg_common_table_appartenance", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_table_appartenance.sql", "original_file_path": "models/staging/common/stg_common_table_appartenance.sql", "unique_id": "model.zlv_dbt_project.stg_common_table_appartenance", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_table_appartenance"], "alias": "stg_common_table_appartenance", "checksum": {"name": "sha256", "checksum": "345287a84805166a40af5875dc16330534f3b307965477962575fba3db23dbe6"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.103977, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_table_appartenance\"", "raw_code": "SELECT\n CODGEO AS GEO_CODE,\n UU_CODE,\n UU_NAME,\n EPCI_CODE,\n EPCI_NAME\nFROM {{ ref ('table_appartenance_geo_communes_2024') }}", "language": "sql", "refs": [{"name": "table_appartenance_geo_communes_2024", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.table_appartenance_geo_communes_2024"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_opah": {"database": "database_name", "schema": "main_stg", "name": "stg_common_opah", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_opah.sql", "original_file_path": "models/staging/common/stg_common_opah.sql", "unique_id": "model.zlv_dbt_project.stg_common_opah", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_opah"], "alias": "stg_common_opah", "checksum": {"name": "sha256", "checksum": "e857efa18798ab51d32dda375c37555a4ff6fd1c08f82497a2fe8eee8a0da9a2"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1029272, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_opah\"", "raw_code": "SELECT *\nFROM {{ ref ('opah') }}", "language": "sql", "refs": [{"name": "opah", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.opah"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_ort": {"database": "database_name", "schema": "main_stg", "name": "stg_common_ort", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_ort.sql", "original_file_path": "models/staging/common/stg_common_ort.sql", "unique_id": "model.zlv_dbt_project.stg_common_ort", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_ort"], "alias": "stg_common_ort", "checksum": {"name": "sha256", "checksum": "7e710ef7afa91c4e3f8617bdc812daf3adbc5d2cd51a28385123ef614a014b60"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.103085, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_ort\"", "raw_code": "SELECT\n \"Code commune\" AS geo_code,\n \"Sign\u00e9e ?\" AS signed,\n \"Si sign\u00e9e, date de signature\" AS signed_at\nFROM {{ ref ('ort') }}", "language": "sql", "refs": [{"name": "ort", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.ort"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023": {"database": "database_name", "schema": "main_stg", "name": "stg_common_ngeo_anct_cog_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_ngeo_anct_cog_2023.sql", "original_file_path": "models/staging/common/stg_common_ngeo_anct_cog_2023.sql", "unique_id": "model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_ngeo_anct_cog_2023"], "alias": "stg_common_ngeo_anct_cog_2023", "checksum": {"name": "sha256", "checksum": "360b40f7d86f7b4c44eb995cf2ad45e18d1794ed78484dcdf51d849ea7f96c67"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1027598, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_ngeo_anct_cog_2023\"", "raw_code": "SELECT * FROM {{ ref ('ngeo-anct-cog2023') }}", "language": "sql", "refs": [{"name": "ngeo-anct-cog2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.ngeo-anct-cog2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_article_232_1": {"database": "database_name", "schema": "main_stg", "name": "stg_common_article_232_1", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_article_232_1.sql", "original_file_path": "models/staging/common/stg_common_article_232_1.sql", "unique_id": "model.zlv_dbt_project.stg_common_article_232_1", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_article_232_1"], "alias": "stg_common_article_232_1", "checksum": {"name": "sha256", "checksum": "ec1cf8b0fa1e30ac532d3518a00e237b069b4643c07824df403b1a127f2706a7"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.102376, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_article_232_1\"", "raw_code": "SELECT geo_code, TRUE AS is_in\nFROM {{ ref ('article_232_1') }}", "language": "sql", "refs": [{"name": "article_232_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.article_232_1"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_common_article_232_2": {"database": "database_name", "schema": "main_stg", "name": "stg_common_article_232_2", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/common/stg_common_article_232_2.sql", "original_file_path": "models/staging/common/stg_common_article_232_2.sql", "unique_id": "model.zlv_dbt_project.stg_common_article_232_2", "fqn": ["zlv_dbt_project", "staging", "common", "stg_common_article_232_2"], "alias": "stg_common_article_232_2", "checksum": {"name": "sha256", "checksum": "e509a5cf7a77aeecdaa4a5654ebe3ec817aae0036652dbc444138c2f81248b3c"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1025841, "relation_name": "\"database_name\".\"main_stg\".\"stg_common_article_232_2\"", "raw_code": "SELECT geo_code, TRUE AS is_in\nFROM {{ ref ('article_232_2') }}", "language": "sql", "refs": [{"name": "article_232_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.zlv_dbt_project.article_232_2"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_users": {"database": "database_name", "schema": "main_stg", "name": "stg_production_users", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_users.sql", "original_file_path": "models/staging/production/stg_production_users.sql", "unique_id": "model.zlv_dbt_project.stg_production_users", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_users"], "alias": "stg_production_users", "checksum": {"name": "sha256", "checksum": "7d0d21f54e48613e4fed68d49c8a1a9a0398ececc527e791437e9730610da4fc"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.105004, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_users\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'users') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "users"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_campaigns_housing": {"database": "database_name", "schema": "main_stg", "name": "stg_production_campaigns_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_campaigns_housing.sql", "original_file_path": "models/staging/production/stg_production_campaigns_housing.sql", "unique_id": "model.zlv_dbt_project.stg_production_campaigns_housing", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_campaigns_housing"], "alias": "stg_production_campaigns_housing", "checksum": {"name": "sha256", "checksum": "171eb4af083d5ac6b40790136edd8049df82ced3c0f480f7a12c018cee875428"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418959.626154, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_campaigns_housing\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'campaigns_housing') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "campaigns_housing"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.campaigns_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_groups_housing_events": {"database": "database_name", "schema": "main_stg", "name": "stg_production_groups_housing_events", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_groups_housing_events.sql", "original_file_path": "models/staging/production/stg_production_groups_housing_events.sql", "unique_id": "model.zlv_dbt_project.stg_production_groups_housing_events", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_groups_housing_events"], "alias": "stg_production_groups_housing_events", "checksum": {"name": "sha256", "checksum": "3d91fa0646c1446613756aebbc1aab089030bcea5128170783a04cd250ab801d"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418959.6270468, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_groups_housing_events\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'group_housing_events') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "group_housing_events"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.group_housing_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_establishments": {"database": "database_name", "schema": "main_stg", "name": "stg_production_establishments", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_establishments.sql", "original_file_path": "models/staging/production/stg_production_establishments.sql", "unique_id": "model.zlv_dbt_project.stg_production_establishments", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_establishments"], "alias": "stg_production_establishments", "checksum": {"name": "sha256", "checksum": "d4455a464c25b07645efd50c8f76bbe1d36e3bf829f43333205e11e9bb80febe"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418959.627925, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_establishments\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'establishments') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "establishments"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_groups": {"database": "database_name", "schema": "main_stg", "name": "stg_production_groups", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_groups.sql", "original_file_path": "models/staging/production/stg_production_groups.sql", "unique_id": "model.zlv_dbt_project.stg_production_groups", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_groups"], "alias": "stg_production_groups", "checksum": {"name": "sha256", "checksum": "9a4284aa0bfa823800d74adb6d19919963dc00694580bddf5b3e0df99ff86ddd"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.105155, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_groups\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'groups') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "groups"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.groups"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_groups_housing": {"database": "database_name", "schema": "main_stg", "name": "stg_production_groups_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_groups_housing.sql", "original_file_path": "models/staging/production/stg_production_groups_housing.sql", "unique_id": "model.zlv_dbt_project.stg_production_groups_housing", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_groups_housing"], "alias": "stg_production_groups_housing", "checksum": {"name": "sha256", "checksum": "a59469a4acceb1c9cbc0ee5b8552c5c0683c13d69b1ea2cf68f083201f21ac20"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1053078, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_groups_housing\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'groups_housing') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "groups_housing"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.groups_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_": {"database": "database_name", "schema": "main_stg", "name": "stg_production_", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_.sql", "original_file_path": "models/staging/production/stg_production_.sql", "unique_id": "model.zlv_dbt_project.stg_production_", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_"], "alias": "stg_production_", "checksum": {"name": "sha256", "checksum": "7d0d21f54e48613e4fed68d49c8a1a9a0398ececc527e791437e9730610da4fc"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418959.630624, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'users') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "users"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_owners_housing": {"database": "database_name", "schema": "main_stg", "name": "stg_production_owners_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_owners_housing.sql", "original_file_path": "models/staging/production/stg_production_owners_housing.sql", "unique_id": "model.zlv_dbt_project.stg_production_owners_housing", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_owners_housing"], "alias": "stg_production_owners_housing", "checksum": {"name": "sha256", "checksum": "4f4e02893edc33de7073032d5d777516cd228591edea0f9ab4a899d0ca7551e1"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418959.631495, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_owners_housing\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'owners_housing') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "owners_housing"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.owners_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_campaigns": {"database": "database_name", "schema": "main_stg", "name": "stg_production_campaigns", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_campaigns.sql", "original_file_path": "models/staging/production/stg_production_campaigns.sql", "unique_id": "model.zlv_dbt_project.stg_production_campaigns", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_campaigns"], "alias": "stg_production_campaigns", "checksum": {"name": "sha256", "checksum": "ae2f0043a3b6161eb0f98ac28438699da3c916826672a6c439be4f5bd1ee6a2d"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418959.6323662, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_campaigns\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'campaigns') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "campaigns"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.campaigns"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_old_events": {"database": "database_name", "schema": "main_stg", "name": "stg_production_old_events", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_old_events.sql", "original_file_path": "models/staging/production/stg_production_old_events.sql", "unique_id": "model.zlv_dbt_project.stg_production_old_events", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_old_events"], "alias": "stg_production_old_events", "checksum": {"name": "sha256", "checksum": "b827d1ad7401c7344c06d2da66958ff59b63a70cf4c0574ea031999d9b7359d4"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.104386, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_old_events\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'old_events') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "old_events"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.old_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_housing_events": {"database": "database_name", "schema": "main_stg", "name": "stg_production_housing_events", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_housing_events.sql", "original_file_path": "models/staging/production/stg_production_housing_events.sql", "unique_id": "model.zlv_dbt_project.stg_production_housing_events", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_housing_events"], "alias": "stg_production_housing_events", "checksum": {"name": "sha256", "checksum": "6744c3a5c2e4d06d67fe05d11b77420ff22681f94fd3ce5e9ebf436fd68626dc"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.104543, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_housing_events\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'housing_events') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "housing_events"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.housing_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_housing": {"database": "database_name", "schema": "main_stg", "name": "stg_production_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_housing.sql", "original_file_path": "models/staging/production/stg_production_housing.sql", "unique_id": "model.zlv_dbt_project.stg_production_housing", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_housing"], "alias": "stg_production_housing", "checksum": {"name": "sha256", "checksum": "4070d671ec12c2447a499268cfdb75c1740947ab9860ee227644d3af6e6237c2"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.104852, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_housing\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'housing') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "housing"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_events": {"database": "database_name", "schema": "main_stg", "name": "stg_production_events", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_events.sql", "original_file_path": "models/staging/production/stg_production_events.sql", "unique_id": "model.zlv_dbt_project.stg_production_events", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_events"], "alias": "stg_production_events", "checksum": {"name": "sha256", "checksum": "d12f3ad6c54b2fc2844fab1f9fe244f24b458c8956ab99e3b697eb0e7b088aef"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.104217, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_events\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'events') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "events"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_owners": {"database": "database_name", "schema": "main_stg", "name": "stg_production_owners", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_owners.sql", "original_file_path": "models/staging/production/stg_production_owners.sql", "unique_id": "model.zlv_dbt_project.stg_production_owners", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_owners"], "alias": "stg_production_owners", "checksum": {"name": "sha256", "checksum": "15f6d1d62068974c2cc759556472685b932bac0a71a0f4951e83edf01f07f7da"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1046999, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_owners\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'owners') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "owners"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.owners"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_production_geo_perimeters": {"database": "database_name", "schema": "main_stg", "name": "stg_production_geo_perimeters", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/production/stg_production_geo_perimeters.sql", "original_file_path": "models/staging/production/stg_production_geo_perimeters.sql", "unique_id": "model.zlv_dbt_project.stg_production_geo_perimeters", "fqn": ["zlv_dbt_project", "staging", "production", "stg_production_geo_perimeters"], "alias": "stg_production_geo_perimeters", "checksum": {"name": "sha256", "checksum": "65113fc9addb11de98af4644c0d105653798800dcdaf1028ccf1e771c5bf5bd9"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/production/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.105482, "relation_name": "\"database_name\".\"main_stg\".\"stg_production_geo_perimeters\"", "raw_code": "SELECT * FROM {{ source ('duckdb_production_raw', 'geo_perimeters') }}", "language": "sql", "refs": [], "sources": [["duckdb_production_raw", "geo_perimeters"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_production_raw.geo_perimeters"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_ff_owners": {"database": "database_name", "schema": "main_stg", "name": "stg_ff_owners", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/ff/stg_ff_owners.sql", "original_file_path": "models/staging/ff/stg_ff_owners.sql", "unique_id": "model.zlv_dbt_project.stg_ff_owners", "fqn": ["zlv_dbt_project", "staging", "ff", "stg_ff_owners"], "alias": "stg_ff_owners", "checksum": {"name": "sha256", "checksum": "e8c40d5be2662bb61d661f4e5290f259f53f65a8bdcdac6557e4b0b8fa4d1396"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1077492, "relation_name": "\"database_name\".\"main_stg\".\"stg_ff_owners\"", "raw_code": "SELECT\n idpersonne AS ff_owner_idpersonne,\n idprodroit AS ff_owner_idprodroit,\n idprocpte AS ff_owner_idprocpte,\n dlign3 AS ff_owner_address_1,\n dlign4 AS ff_owner_address_2,\n dlign5 AS ff_owner_address_3,\n dlign6 AS ff_owner_address_4,\n try_strptime(cast(jdatnss AS VARCHAR), '{{ var(\"dateFormat\") }}')\n AS ff_owner_birth_date,\n dnomus AS ff_owner_lastname,\n dprnus AS ff_owner_firstname,\n dprnlp AS ff_owner_firstnames,\n dnomlp AS ff_owner_birth_lastname,\n locprop AS ff_locprop,\n locproptxt AS ff_locproptxt,\n dlign6 AS ff_owner_city,\n regexp_extract(dlign6, '\\d{5}') AS ff_owner_postal_code,\n ddenom AS ff_owner_fullname,\n dsiren AS ff_owner_siren,\n catpro3 AS ff_owner_category,\n {{ process_owner_kind ('catpro3') }} AS ff_owner_category_text,\n {{ process_owner_code_droit ('ccodro') }} AS ff_owner_code_droit\nFROM {{ source ('duckdb_raw', 'raw_ff_owners') }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_ff_owners"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.process_owner_kind", "macro.zlv_dbt_project.process_owner_code_droit"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_owners"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_ff_ext_2019": {"database": "database_name", "schema": "main_stg", "name": "stg_ff_ext_2019", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/ff/stg_ff_ext_2019.sql", "original_file_path": "models/staging/ff/stg_ff_ext_2019.sql", "unique_id": "model.zlv_dbt_project.stg_ff_ext_2019", "fqn": ["zlv_dbt_project", "staging", "ff", "stg_ff_ext_2019"], "alias": "stg_ff_ext_2019", "checksum": {"name": "sha256", "checksum": "601b2e4b60e9def02c7768996e643199d9d90603e56e844064628f5558f5c417"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.108601, "relation_name": "\"database_name\".\"main_stg\".\"stg_ff_ext_2019\"", "raw_code": "SELECT\n ff_idcom AS geo_code, *\nFROM {{ source ('duckdb_raw', 'raw_ff_2019') }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_ff_2019"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_ff_ext_2022": {"database": "database_name", "schema": "main_stg", "name": "stg_ff_ext_2022", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/ff/stg_ff_ext_2022.sql", "original_file_path": "models/staging/ff/stg_ff_ext_2022.sql", "unique_id": "model.zlv_dbt_project.stg_ff_ext_2022", "fqn": ["zlv_dbt_project", "staging", "ff", "stg_ff_ext_2022"], "alias": "stg_ff_ext_2022", "checksum": {"name": "sha256", "checksum": "f8d3b7fd2dad484b1bc5078e1abbc71e2ad2afa1b899423d9c993aa0273d3441"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.108133, "relation_name": "\"database_name\".\"main_stg\".\"stg_ff_ext_2022\"", "raw_code": "SELECT\n ff_idcom AS geo_code, *\nFROM {{ source ('duckdb_raw', 'raw_ff_2022') }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_ff_2022"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2022"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_ff_ext_2023": {"database": "database_name", "schema": "main_stg", "name": "stg_ff_ext_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/ff/stg_ff_ext_2023.sql", "original_file_path": "models/staging/ff/stg_ff_ext_2023.sql", "unique_id": "model.zlv_dbt_project.stg_ff_ext_2023", "fqn": ["zlv_dbt_project", "staging", "ff", "stg_ff_ext_2023"], "alias": "stg_ff_ext_2023", "checksum": {"name": "sha256", "checksum": "ee7c65dd94af37ebe23ad236a13d7199dc1ebc2eca18131fbc4ff082505cf93c"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.10797, "relation_name": "\"database_name\".\"main_stg\".\"stg_ff_ext_2023\"", "raw_code": "SELECT\n ff_idcom AS geo_code, *\nFROM {{ source ('duckdb_raw', 'raw_ff_2023') }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_ff_2023"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_ff_ext_2021": {"database": "database_name", "schema": "main_stg", "name": "stg_ff_ext_2021", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/ff/stg_ff_ext_2021.sql", "original_file_path": "models/staging/ff/stg_ff_ext_2021.sql", "unique_id": "model.zlv_dbt_project.stg_ff_ext_2021", "fqn": ["zlv_dbt_project", "staging", "ff", "stg_ff_ext_2021"], "alias": "stg_ff_ext_2021", "checksum": {"name": "sha256", "checksum": "c80bc39e54ae5a91d2e2fb6ae5ffaa43141320ab8f0a356c2d5ee0284478a9d3"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.108288, "relation_name": "\"database_name\".\"main_stg\".\"stg_ff_ext_2021\"", "raw_code": "SELECT\n ff_idcom AS geo_code, *\nFROM {{ source ('duckdb_raw', 'raw_ff_2021') }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_ff_2021"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2021"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_ff_ext_2020": {"database": "database_name", "schema": "main_stg", "name": "stg_ff_ext_2020", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/ff/stg_ff_ext_2020.sql", "original_file_path": "models/staging/ff/stg_ff_ext_2020.sql", "unique_id": "model.zlv_dbt_project.stg_ff_ext_2020", "fqn": ["zlv_dbt_project", "staging", "ff", "stg_ff_ext_2020"], "alias": "stg_ff_ext_2020", "checksum": {"name": "sha256", "checksum": "34e23139bfe976d74efb7087db1fe2c517787290058795af6311b67b5d0bc749"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.108444, "relation_name": "\"database_name\".\"main_stg\".\"stg_ff_ext_2020\"", "raw_code": "SELECT\n ff_idcom AS geo_code, *\nFROM {{ source ('duckdb_raw', 'raw_ff_2020') }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_ff_2020"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_lovac_2019": {"database": "database_name", "schema": "main_stg", "name": "stg_lovac_2019", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/lovac/stg_lovac_2019.sql", "original_file_path": "models/staging/lovac/stg_lovac_2019.sql", "unique_id": "model.zlv_dbt_project.stg_lovac_2019", "fqn": ["zlv_dbt_project", "staging", "lovac", "stg_lovac_2019"], "alias": "stg_lovac_2019", "checksum": {"name": "sha256", "checksum": "7a3d1f71ebbce04e23601343c817ef127ca969de41ad3df7d52ddca58e88f704"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/lovac/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.109837, "relation_name": "\"database_name\".\"main_stg\".\"stg_lovac_2019\"", "raw_code": "with source as (\nSELECT * FROM {{ source ('duckdb_raw', 'raw_lovac_2019') }}\n),\n{{ handle_lovac_different_years () }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_lovac_2019"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.handle_lovac_different_years"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_lovac_2024": {"database": "database_name", "schema": "main_stg", "name": "stg_lovac_2024", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/lovac/stg_lovac_2024.sql", "original_file_path": "models/staging/lovac/stg_lovac_2024.sql", "unique_id": "model.zlv_dbt_project.stg_lovac_2024", "fqn": ["zlv_dbt_project", "staging", "lovac", "stg_lovac_2024"], "alias": "stg_lovac_2024", "checksum": {"name": "sha256", "checksum": "53f08282e14d83b4cc86c84dc9525d656b4bbaffdd454740a5cf7067746318ae"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/lovac/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.11071, "relation_name": "\"database_name\".\"main_stg\".\"stg_lovac_2024\"", "raw_code": "with source as (\nSELECT * FROM {{ source ('duckdb_raw', 'raw_lovac_2024') }}\n),\n{{ handle_lovac_different_years() }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_lovac_2024"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.handle_lovac_different_years"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2024"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_lovac_2020": {"database": "database_name", "schema": "main_stg", "name": "stg_lovac_2020", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/lovac/stg_lovac_2020.sql", "original_file_path": "models/staging/lovac/stg_lovac_2020.sql", "unique_id": "model.zlv_dbt_project.stg_lovac_2020", "fqn": ["zlv_dbt_project", "staging", "lovac", "stg_lovac_2020"], "alias": "stg_lovac_2020", "checksum": {"name": "sha256", "checksum": "18fed0cfe57975776ea799a5e63ea0936e3bb274d51d1873d8320721fb937985"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/lovac/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1100721, "relation_name": "\"database_name\".\"main_stg\".\"stg_lovac_2020\"", "raw_code": "with source as (\nSELECT * FROM {{ source ('duckdb_raw', 'raw_lovac_2020') }}\n),\n{{ handle_lovac_different_years () }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_lovac_2020"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.handle_lovac_different_years"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_lovac_2021": {"database": "database_name", "schema": "main_stg", "name": "stg_lovac_2021", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/lovac/stg_lovac_2021.sql", "original_file_path": "models/staging/lovac/stg_lovac_2021.sql", "unique_id": "model.zlv_dbt_project.stg_lovac_2021", "fqn": ["zlv_dbt_project", "staging", "lovac", "stg_lovac_2021"], "alias": "stg_lovac_2021", "checksum": {"name": "sha256", "checksum": "417d5cd764665eab9e481811f16987eaaa37f9c9b81d3512ab4a81ec7c82d129"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/lovac/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.110237, "relation_name": "\"database_name\".\"main_stg\".\"stg_lovac_2021\"", "raw_code": "with source as (\nSELECT * FROM {{ source ('duckdb_raw', 'raw_lovac_2021') }}\n),\n{{ handle_lovac_different_years () }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_lovac_2021"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.handle_lovac_different_years"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2021"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_lovac_2023": {"database": "database_name", "schema": "main_stg", "name": "stg_lovac_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/lovac/stg_lovac_2023.sql", "original_file_path": "models/staging/lovac/stg_lovac_2023.sql", "unique_id": "model.zlv_dbt_project.stg_lovac_2023", "fqn": ["zlv_dbt_project", "staging", "lovac", "stg_lovac_2023"], "alias": "stg_lovac_2023", "checksum": {"name": "sha256", "checksum": "5ff5e6e53cc5d2beb59c45d1a33330c2a11b7bef5497c90ddbfc4c174d269f9a"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/lovac/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.110555, "relation_name": "\"database_name\".\"main_stg\".\"stg_lovac_2023\"", "raw_code": "with source as (\nSELECT * FROM {{ source ('duckdb_raw', 'raw_lovac_2023') }}\n),\n{{ handle_lovac_different_years () }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_lovac_2023"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.handle_lovac_different_years"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.stg_lovac_2022": {"database": "database_name", "schema": "main_stg", "name": "stg_lovac_2022", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "staging/lovac/stg_lovac_2022.sql", "original_file_path": "models/staging/lovac/stg_lovac_2022.sql", "unique_id": "model.zlv_dbt_project.stg_lovac_2022", "fqn": ["zlv_dbt_project", "staging", "lovac", "stg_lovac_2022"], "alias": "stg_lovac_2022", "checksum": {"name": "sha256", "checksum": "68db4be02f696db1c2d46b10ea2ba5605da15043471119722116ba857ca4cda2"}, "config": {"enabled": true, "alias": null, "schema": "stg", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/staging/lovac/schemas.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "stg", "materialized": "view"}, "created_at": 1736418960.1103969, "relation_name": "\"database_name\".\"main_stg\".\"stg_lovac_2022\"", "raw_code": "with source as (\nSELECT * FROM {{ source ('duckdb_raw', 'raw_lovac_2022') }}\n),\n{{ handle_lovac_different_years () }}", "language": "sql", "refs": [], "sources": [["duckdb_raw", "raw_lovac_2022"]], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.handle_lovac_different_years"], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2022"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_common_cities": {"database": "database_name", "schema": "main_marts", "name": "marts_common_cities", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/common/marts_common_cities.sql", "original_file_path": "models/marts/common/marts_common_cities.sql", "unique_id": "model.zlv_dbt_project.marts_common_cities", "fqn": ["zlv_dbt_project", "marts", "common", "marts_common_cities"], "alias": "marts_common_cities", "checksum": {"name": "sha256", "checksum": "de52ca357b0428ebcf9647731c359c661036a59b1b97a2fd429a8e870b63ca07"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418960.111737, "relation_name": "\"database_name\".\"main_marts\".\"marts_common_cities\"", "raw_code": "SELECT\n ccm.city_code,\n MIN(label) AS label, -- Si le label est le m\u00eame pour tous les arrondissements, sinon utiliser GROUP_CONCAT\n MIN(zip_code) AS zip_code, -- Pour prendre un code postal repr\u00e9sentatif, sinon utiliser GROUP_CONCAT\n AVG(latitude) AS avg_latitude,\n AVG(longitude) AS avg_longitude,\n MIN(department_name) AS department_name, -- M\u00eame remarque que pour le label\n MIN(department_number) AS department_number,\n MIN(region_name) AS region_name,\n MIN(region_geojson_name) AS region_geojson_name,\n MAX(ca1.is_in) AS tlv1, -- Prend 1 s'il y a au moins un arrondissement o\u00f9 la valeur est 1\n MAX(ca2.is_in) AS tlv2, -- Idem\n MAX(action_coeur_de_ville) AS action_coeur_de_ville,\n MAX(action_coeur_de_ville_1) AS action_coeur_de_ville_1,\n MAX(petite_ville_de_demain) AS petite_ville_de_demain,\n MAX(village_davenir) AS village_davenir,\n MAX(opah) AS opah,\n MIN(type_opah) AS type_opah, -- Supposant que type_opah soit le m\u00eame pour tous les arrondissements\n MAX(pig) AS pig,\n MAX(cort.signed) as ort_signed,\n MAX(cort.signed_at) as ort_signed_at,\n MAX(UU_name) as uu_name,\n MAX(UU_code) as uu_code,\n MAX(EPCI_code) as epci_code,\n MAX(EPCI_name) as epci_name, \n MAX(inscrit_zlv_direct) AS inscrit_zlv_direct,\n MAX(inscrit_zlv_via_intercommunalit\u00e9) AS inscrit_zlv_via_intercommunalit\u00e9,\n MAX(nom_intercommunalit\u00e9) AS nom_intercommunalit\u00e9,\n MAX(type_intercommunalit\u00e9 ) AS type_intercommunalit\u00e9,\n MAX(couverte_via_service_etat) AS couverte_via_service_etat,\n MAX(department_state_service_name) AS nom_service_etat_departemental,\n MAX(region_state_service_name) AS nom_service_etat_r\u00e9gional\nFROM \n {{ ref('int_common_cities') }} cc\nLEFT JOIN {{ ref('int_common_cities_mapping') }} ccm ON ccm.geo_code = cc.geo_code\nLEFT JOIN {{ ref('int_common_article_232_1') }} ca1 ON ca1.geo_code = ccm.city_code -- les donn\u00e9es des articles 1 et 2 sont bas\u00e9 sur les codes insee des villes et non des arrondissements\nLEFT JOIN {{ ref('int_common_article_232_2') }} ca2 ON ca2.geo_code = ccm.city_code -- les donn\u00e9es des articles 1 et 2 sont bas\u00e9 sur les codes insee des villes et non des arrondissements\nLEFT JOIN {{ ref('int_common_ngeo_anct_cog_2023') }} ncac ON ncac.geo_code = cc.geo_code\nLEFT JOIN {{ ref('int_common_table_appartenance') }} cta ON cta.geo_code = cc.geo_code\nLEFT JOIN {{ ref('int_common_opah') }} co ON co.geo_code = cc.geo_code\nLEFT JOIN {{ ref('int_common_ort') }} cort ON ccm.city_code = cort.geo_code\nLEFT JOIN {{ ref('int_production_geo_code_establishments') }} gce ON gce.geo_code = cc.geo_code\nGROUP BY\n ccm.city_code\nORDER BY\n ccm.city_code", "language": "sql", "refs": [{"name": "int_common_cities", "package": null, "version": null}, {"name": "int_common_cities_mapping", "package": null, "version": null}, {"name": "int_common_article_232_1", "package": null, "version": null}, {"name": "int_common_article_232_2", "package": null, "version": null}, {"name": "int_common_ngeo_anct_cog_2023", "package": null, "version": null}, {"name": "int_common_table_appartenance", "package": null, "version": null}, {"name": "int_common_opah", "package": null, "version": null}, {"name": "int_common_ort", "package": null, "version": null}, {"name": "int_production_geo_code_establishments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_common_cities", "model.zlv_dbt_project.int_common_cities_mapping", "model.zlv_dbt_project.int_common_article_232_1", "model.zlv_dbt_project.int_common_article_232_2", "model.zlv_dbt_project.int_common_ngeo_anct_cog_2023", "model.zlv_dbt_project.int_common_table_appartenance", "model.zlv_dbt_project.int_common_opah", "model.zlv_dbt_project.int_common_ort", "model.zlv_dbt_project.int_production_geo_code_establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_common_morphology": {"database": "database_name", "schema": "main_marts", "name": "marts_common_morphology", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/common/marts_common_morphology.sql", "original_file_path": "models/marts/common/marts_common_morphology.sql", "unique_id": "model.zlv_dbt_project.marts_common_morphology", "fqn": ["zlv_dbt_project", "marts", "common", "marts_common_morphology"], "alias": "marts_common_morphology", "checksum": {"name": "sha256", "checksum": "1f5470941c4a4d3c12d8d91841c1ba50bf74e7c73f4d55cae15cb29efb80cb9b"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.670372, "relation_name": "\"database_name\".\"main_marts\".\"marts_common_morphology\"", "raw_code": "WITH all_lovac AS (\n SELECT\n 2024 AS year,\n local_id,\n geo_code,\n vacancy_start_year,\n data_year,\n ff_ccthp,\n housing_kind,\n aff,\n groupe\n FROM {{ ref (\"stg_lovac_2024\") }}\n UNION ALL\n SELECT\n 2023 AS year,\n local_id,\n geo_code,\n vacancy_start_year,\n data_year,\n ff_ccthp,\n housing_kind,\n aff,\n groupe\n FROM {{ ref (\"stg_lovac_2023\") }}\n UNION ALL\n SELECT\n 2022 AS year,\n local_id,\n geo_code,\n vacancy_start_year,\n data_year,\n ff_ccthp,\n housing_kind,\n aff,\n groupe\n FROM {{ ref (\"stg_lovac_2022\") }}\n UNION ALL\n SELECT\n 2021 AS year,\n local_id,\n geo_code,\n vacancy_start_year,\n data_year,\n ff_ccthp,\n housing_kind,\n aff,\n groupe\n FROM {{ ref (\"stg_lovac_2021\") }}\n UNION ALL\n SELECT\n 2020 AS year,\n local_id,\n geo_code,\n vacancy_start_year,\n data_year,\n ff_ccthp,\n housing_kind,\n aff,\n groupe\n FROM {{ ref (\"stg_lovac_2020\") }}\n UNION ALL\n SELECT\n 2019 AS year,\n local_id,\n geo_code,\n vacancy_start_year,\n data_year,\n ff_ccthp,\n housing_kind,\n aff,\n groupe\n FROM {{ ref (\"stg_lovac_2019\") }}\n),\n\nall_ff AS (\n SELECT\n 2024 AS year, ff_idlocal, geo_code, ff_ccogrm, ff_ccthp, ff_dteloc\n FROM {{ ref (\"stg_ff_ext_2023\") }}\n UNION ALL -- todo: change to 2024 when its available\n SELECT\n 2023 AS year, ff_idlocal, geo_code, ff_ccogrm, ff_ccthp, ff_dteloc\n FROM {{ ref (\"stg_ff_ext_2023\") }}\n UNION ALL\n SELECT\n 2022 AS year, ff_idlocal, geo_code, ff_ccogrm, ff_ccthp, ff_dteloc\n FROM {{ ref (\"stg_ff_ext_2022\") }}\n UNION ALL\n SELECT\n 2021 AS year, ff_idlocal, geo_code, ff_ccogrm, ff_ccthp, ff_dteloc\n FROM {{ ref (\"stg_ff_ext_2021\") }}\n UNION ALL\n SELECT\n 2020 AS year, ff_idlocal, geo_code, ff_ccogrm, ff_ccthp, ff_dteloc\n FROM {{ ref (\"stg_ff_ext_2020\") }}\n UNION ALL\n SELECT\n 2019 AS year, ff_idlocal, geo_code, ff_ccogrm, ff_ccthp, ff_dteloc\n FROM {{ ref (\"stg_ff_ext_2019\") }}\n),\n\nlovac AS (\n SELECT\n local_id\n , year\n , geo_code\n , CASE\n WHEN\n (housing_kind IN ('APPART', 'MAISON') AND aff = 'H')\n THEN 1\n ELSE 0\n END AS is_housing\n , CASE\n WHEN\n (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe IS NULL)\n THEN 1\n ELSE 0\n END AS is_private\n , CASE WHEN vacancy_start_year < data_year - 2 THEN 1 ELSE 0 END\n AS is_vacant_fil\n , CASE\n WHEN\n (ff_ccthp IN ('V') AND vacancy_start_year < data_year - 2)\n THEN 1\n ELSE 0\n END AS is_vacant_fil_ccthp\n FROM all_lovac\n),\n\nlovac_geo_code_year AS (\n SELECT\n year\n , geo_code\n , COUNT(*) AS count_vacant_premisses\n , SUM(is_housing) AS count_vacant_housing\n , SUM(CASE WHEN is_housing = 1 AND is_private = 1 THEN 1 ELSE 0 END)\n AS count_vacant_housing_private\n , SUM(\n CASE\n WHEN\n is_housing = 1 AND is_private = 1 AND is_vacant_fil = 1\n THEN 1\n ELSE 0\n END\n ) AS count_vacant_housing_private_fil\n , SUM(\n CASE\n WHEN\n is_housing = 1\n AND is_private = 1\n AND is_vacant_fil_ccthp = 1\n THEN 1\n ELSE 0\n END\n ) AS count_vacant_housing_private_fil_ccthp\n FROM lovac\n GROUP BY year, geo_code\n),\n\nff AS (\n SELECT\n year\n , geo_code\n , CASE\n WHEN\n (\n ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9')\n OR ff_ccogrm IS NULL\n )\n THEN 1\n ELSE 0\n END AS is_private\n , CASE WHEN ff_ccthp = 'L' THEN 1 ELSE 0 END AS is_rented\n FROM all_ff\n WHERE ff_dteloc IN ('1', '2')\n),\n\nff_geo_code_year AS (\n SELECT\n year, geo_code\n , COUNT(*) AS count_housing\n , SUM(is_private) AS count_housing_private\n , SUM(IF(is_private = 1 AND is_rented = 1, 1, 0))\n AS count_housing_private_rented\n FROM ff\n GROUP BY year, geo_code\n),\n\nproduction AS (\n SELECT\n geo_code,\n COUNT(h.id) AS housing_count,\n 2024 AS year\n FROM {{ ref (\"int_production_housing\") }} as h\n WHERE list_contains(data_file_years, 'lovac-2024')\n GROUP BY geo_code\n)\nSELECT\n year\n , geo_code\n , city_code\n , production.housing_count AS count_housing_production\n , lovac.count_vacant_premisses\n , lovac.count_vacant_housing\n , lovac.count_vacant_housing_private\n , lovac.count_vacant_housing_private_fil\n , lovac.count_vacant_housing_private_fil_ccthp\n , ff.count_housing\n , ff.count_housing_private\n , ff.count_housing_private_rented\n , CASE WHEN (merged.geo_code_destination IS NOT NULL) THEN 1 ELSE 0 END\n AS merged_this_year\n , CASE WHEN (splited.geo_code_destination IS NOT NULL) THEN 1 ELSE 0 END\n AS split_this_year\n , merged.geo_code_destination AS merged_destionation_geocode\n , merged.libelle_destination AS merged_destination_label\n , splited.geo_code_destination AS split_destination_geocode\n , splited.libelle_destination AS split_destination_label\n , com_name AS city_label\n , code_departement AS dep_code\n , nom_departement AS dep_label\n , code_region AS region_code\n , nom_region AS region_label\n , epci_siren\n , epci_name AS epci_label\nFROM lovac_geo_code_year lovac\nLEFT OUTER JOIN ff_geo_code_year ff USING (year, geo_code)\nLEFT JOIN production USING (year, geo_code)\nLEFT JOIN {{ ref (\"int_common_cities_mapping\") }} USING (geo_code)\nLEFT JOIN {{ ref (\"int_common_com_epci_dep_region\") }} USING (geo_code)\nLEFT JOIN {{ ref (\"int_common_departements_france\") }} ON code_departement = geo_code [1: 2]\nLEFT JOIN {{ ref (\"stg_common_fusions\") }} merged ON geo_code = merged.geo_code_source AND merged.year = year\nLEFT JOIN {{ ref (\"stg_common_scissions\") }} splited ON geo_code = splited.geo_code_source AND splited.year = year\nORDER BY geo_code", "language": "sql", "refs": [{"name": "stg_lovac_2024", "package": null, "version": null}, {"name": "stg_lovac_2023", "package": null, "version": null}, {"name": "stg_lovac_2022", "package": null, "version": null}, {"name": "stg_lovac_2021", "package": null, "version": null}, {"name": "stg_lovac_2020", "package": null, "version": null}, {"name": "stg_lovac_2019", "package": null, "version": null}, {"name": "stg_ff_ext_2023", "package": null, "version": null}, {"name": "stg_ff_ext_2023", "package": null, "version": null}, {"name": "stg_ff_ext_2022", "package": null, "version": null}, {"name": "stg_ff_ext_2021", "package": null, "version": null}, {"name": "stg_ff_ext_2020", "package": null, "version": null}, {"name": "stg_ff_ext_2019", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_common_cities_mapping", "package": null, "version": null}, {"name": "int_common_com_epci_dep_region", "package": null, "version": null}, {"name": "int_common_departements_france", "package": null, "version": null}, {"name": "stg_common_fusions", "package": null, "version": null}, {"name": "stg_common_scissions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_lovac_2024", "model.zlv_dbt_project.stg_lovac_2023", "model.zlv_dbt_project.stg_lovac_2022", "model.zlv_dbt_project.stg_lovac_2021", "model.zlv_dbt_project.stg_lovac_2020", "model.zlv_dbt_project.stg_lovac_2019", "model.zlv_dbt_project.stg_ff_ext_2023", "model.zlv_dbt_project.stg_ff_ext_2022", "model.zlv_dbt_project.stg_ff_ext_2021", "model.zlv_dbt_project.stg_ff_ext_2020", "model.zlv_dbt_project.stg_ff_ext_2019", "model.zlv_dbt_project.int_production_housing", "model.zlv_dbt_project.int_common_cities_mapping", "model.zlv_dbt_project.int_common_com_epci_dep_region", "model.zlv_dbt_project.int_common_departements_france", "model.zlv_dbt_project.stg_common_fusions", "model.zlv_dbt_project.stg_common_scissions"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_public_establishments_morphology": {"database": "database_name", "schema": "main_marts", "name": "marts_public_establishments_morphology", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/public/marts_public_establishments_morphology.sql", "original_file_path": "models/marts/public/marts_public_establishments_morphology.sql", "unique_id": "model.zlv_dbt_project.marts_public_establishments_morphology", "fqn": ["zlv_dbt_project", "marts", "public", "marts_public_establishments_morphology"], "alias": "marts_public_establishments_morphology", "checksum": {"name": "sha256", "checksum": "e8b3b41da37ce5708b1be0801bb82f25189dc8985514a7c9e6ec7648491508f4"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.6715698, "relation_name": "\"database_name\".\"main_marts\".\"marts_public_establishments_morphology\"", "raw_code": "SELECT\n CAST(pe.id AS VARCHAR) AS establishment_id,\n year,\n SUM(count_vacant_premisses) AS count_vacant_premisses,\n SUM(count_vacant_housing) AS count_vacant_housing,\n SUM(count_vacant_housing_private) AS count_vacant_housing_private,\n SUM(count_vacant_housing_private_fil) AS count_vacant_housing_private_fil,\n SUM(count_vacant_housing_private_fil_ccthp)\n AS count_vacant_housing_private_fil_ccthp,\n SUM(count_housing) AS count_housing,\n SUM(count_housing_private) AS count_housing_private,\n SUM(count_housing_private_rented) AS count_housing_private_rented,\n SUM(count_housing_production) AS count_housing_production\n\nFROM {{ ref ('int_production_establishments') }} pe\nLEFT JOIN {{ ref ('int_production_establishments_localities') }} pel ON pe.id = pel.establishment_id\nLEFT JOIN {{ ref ('marts_common_morphology') }} mcm ON pel.geo_code = mcm.geo_code\nGROUP by pe.id, year\nORDER BY pe.id, year", "language": "sql", "refs": [{"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_establishments_localities", "package": null, "version": null}, {"name": "marts_common_morphology", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.marts_common_morphology"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_public_establishments_morphology_unpivoted": {"database": "database_name", "schema": "main_marts", "name": "marts_public_establishments_morphology_unpivoted", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/public/marts_public_establishments_morphology_unpivoted.sql", "original_file_path": "models/marts/public/marts_public_establishments_morphology_unpivoted.sql", "unique_id": "model.zlv_dbt_project.marts_public_establishments_morphology_unpivoted", "fqn": ["zlv_dbt_project", "marts", "public", "marts_public_establishments_morphology_unpivoted"], "alias": "marts_public_establishments_morphology_unpivoted", "checksum": {"name": "sha256", "checksum": "87934e6188221d1015e0e0903bd3765cd0c30e8d8ce0d69355b6c7bda019e38e"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.672587, "relation_name": "\"database_name\".\"main_marts\".\"marts_public_establishments_morphology_unpivoted\"", "raw_code": "WITH base_data AS (\n SELECT * FROM {{ ref ('marts_public_establishments_morphology') }}\n)\n, unpivoted_data AS (\n SELECT\n establishment_id,\n year,\n 'count_vacant_premisses' AS count_type,\n count_vacant_premisses AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_vacant_housing' AS count_type,\n count_vacant_housing AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_vacant_housing_private' AS count_type,\n count_vacant_housing_private AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_vacant_housing_private_fil' AS count_type,\n count_vacant_housing_private_fil AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_vacant_housing_private_fil_ccthp' AS count_type,\n count_vacant_housing_private_fil_ccthp AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_housing' AS count_type,\n count_housing AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_housing_private' AS count_type,\n count_housing_private AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_housing_private_rented' AS count_type,\n count_housing_private_rented AS count_value\n FROM base_data\n UNION ALL\n SELECT\n establishment_id,\n year,\n 'count_housing_production' AS count_type,\n count_housing_production AS count_value\n FROM base_data\n)\n, pivoted_data AS (\n SELECT\n establishment_id,\n count_type,\n CASE\n WHEN count_type = 'count_vacant_premisses' THEN 'Locaux Vacants'\n WHEN count_type = 'count_vacant_housing' THEN 'Logements Vacants'\n WHEN\n count_type = 'count_vacant_housing_private'\n THEN 'Logements Vacants du Parc Priv\u00e9'\n WHEN\n count_type = 'count_vacant_housing_private_fil'\n THEN 'Logements Vacants du Parc Priv\u00e9 (FIL)'\n WHEN\n count_type = 'count_vacant_housing_private_fil_ccthp'\n THEN 'Logements Vacants du Parc Priv\u00e9 (FIL+CCTHP)'\n WHEN count_type = 'count_housing' THEN 'Logements Totaux'\n WHEN\n count_type = 'count_housing_private'\n THEN 'Logements du Parc Priv\u00e9'\n WHEN\n count_type = 'count_housing_private_rented'\n THEN 'Logements du Parc Priv\u00e9 Lou\u00e9s'\n WHEN\n count_type = 'count_housing_production'\n THEN 'Logements vacants >2 ans - ZLV'\n END AS count_label,\n MAX(CASE WHEN year = 2019 THEN count_value END) AS \"2019\",\n MAX(CASE WHEN year = 2020 THEN count_value END) AS \"2020\",\n MAX(CASE WHEN year = 2021 THEN count_value END) AS \"2021\",\n MAX(CASE WHEN year = 2022 THEN count_value END) AS \"2022\",\n MAX(CASE WHEN year = 2023 THEN count_value END) AS \"2023\",\n MAX(CASE WHEN year = 2024 THEN count_value END) AS \"2024\"\n FROM unpivoted_data\n GROUP BY establishment_id, count_type\n)\nSELECT\n establishment_id,\n count_type,\n count_label,\n \"2019\",\n \"2020\",\n \"2021\",\n \"2022\",\n \"2023\",\n \"2024\",\n (\"2024\" - \"2023\") AS var_2024_2023,\n CASE\n WHEN\n \"2023\" != 0\n THEN ROUND(((\"2024\" - \"2023\") / \"2023\") * 100, 2)\n ELSE NULL\n END AS var_pct_2024_2023,\n (\"2023\" - \"2022\") AS var_2023_2022,\n CASE\n WHEN\n \"2022\" != 0\n THEN ROUND(((\"2023\" - \"2022\") / \"2022\") * 100, 2)\n ELSE NULL\n END AS var_pct_2023_2022,\n (\"2022\" - \"2021\") AS var_2022_2021,\n CASE\n WHEN\n \"2021\" != 0\n THEN ROUND(((\"2022\" - \"2021\") / \"2021\") * 100, 2)\n ELSE NULL\n END AS var_pct_2022_2021,\n (\"2021\" - \"2020\") AS var_2021_2020,\n CASE\n WHEN\n \"2020\" != 0\n THEN ROUND(((\"2021\" - \"2020\") / \"2020\") * 100, 2)\n ELSE NULL\n END AS var_pct_2021_2020,\n (\"2020\" - \"2019\") AS var_2020_2019,\n CASE\n WHEN\n \"2019\" != 0\n THEN ROUND(((\"2020\" - \"2019\") / \"2019\") * 100, 2)\n ELSE NULL\n END AS var_pct_2020_2019\nFROM pivoted_data\nORDER BY establishment_id, count_type", "language": "sql", "refs": [{"name": "marts_public_establishments_morphology", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.marts_public_establishments_morphology"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_groups": {"database": "database_name", "schema": "main_marts", "name": "marts_production_groups", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/marts_production_groups.sql", "original_file_path": "models/marts/production/marts_production_groups.sql", "unique_id": "model.zlv_dbt_project.marts_production_groups", "fqn": ["zlv_dbt_project", "marts", "production", "marts_production_groups"], "alias": "marts_production_groups", "checksum": {"name": "sha256", "checksum": "7bdf4a318c88703a0b48a0e64c0017ea5987b321f267c8015ac9dac75e8c0827"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.6735082, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_groups\"", "raw_code": "SELECT\n pg.*\nFROM {{ ref ('int_production_groups') }} pg", "language": "sql", "refs": [{"name": "int_production_groups", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_groups"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_campaigns": {"database": "database_name", "schema": "main_marts", "name": "marts_production_campaigns", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/marts_production_campaigns.sql", "original_file_path": "models/marts/production/marts_production_campaigns.sql", "unique_id": "model.zlv_dbt_project.marts_production_campaigns", "fqn": ["zlv_dbt_project", "marts", "production", "marts_production_campaigns"], "alias": "marts_production_campaigns", "checksum": {"name": "sha256", "checksum": "99ab72bf4609e015f44f621fa38e1daadcb387b1a70880c798859b5d9de84432"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": "campaign_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table", "unique_key": "campaign_id"}, "created_at": 1736418960.1120892, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_campaigns\"", "raw_code": "{{\nconfig (\nmaterialized = 'table',\nunique_key = 'campaign_id',\n)\n}}\n\nSELECT\nCAST (pc.id as VARCHAR) as campaign_id,\npc.*,\npcsnc.next_campaign_sent_at,\npcsnc.time_to_next_campaign,\ncc.count_housing as housing_number_in_campaign,\npcs.return_count_3_months,\npcs.return_rate_3_months,\npcsnc.has_next_campaign_in_3_months,\npcsnc.return_count_3_months_before_next_campaign,\npcsnc.return_rate_3_months_before_next_campaign,\npcs.return_count_6_months,\npcs.return_rate_6_months,\npcsnc.has_next_campaign_in_6_months,\npcsnc.return_count_6_months_before_next_campaign,\npcsnc.return_rate_6_months_before_next_campaign,\npcs.return_count_9_months,\npcs.return_rate_9_months,\npcsnc.has_next_campaign_in_9_months,\npcsnc.return_count_9_months_before_next_campaign,\npcsnc.return_rate_9_months_before_next_campaign,\npcs.return_count_36_months,\npcs.return_rate_36_months,\npcsnc.has_next_campaign_in_36_months,\npcsnc.return_count_36_months_before_next_campaign,\npcsnc.return_rate_36_months_before_next_campaign,\npcsa.first_event_global_date,\npcsa.last_event_global_date,\npcsa.first_event_followup_date,\npcsa.last_event_followup_date,\npcsa.first_event_ownership_date,\npcsa.last_event_ownership_date\nFROM {{ ref ('int_production_campaigns') }} pc\nLEFT JOIN {{ ref ('int_production_campaigns_housing_count') }} cc ON cc.campaign_id = pc.id\nLEFT JOIN {{ ref ('int_production_campaigns_stats') }} pcs ON pcs.id = pc.id\nLEFT JOIN {{ ref ('int_production_campaigns_stats_next_campaign') }} pcsnc ON pcsnc.id = pc.id\nLEFT JOIN {{ ref ('int_production_campaigns_stats_actions') }} pcsa ON pcsa.id = pc.id", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing_count", "package": null, "version": null}, {"name": "int_production_campaigns_stats", "package": null, "version": null}, {"name": "int_production_campaigns_stats_next_campaign", "package": null, "version": null}, {"name": "int_production_campaigns_stats_actions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_campaigns_stats", "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign", "model.zlv_dbt_project.int_production_campaigns_stats_actions"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_users": {"database": "database_name", "schema": "main_marts", "name": "marts_production_users", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/marts_production_users.sql", "original_file_path": "models/marts/production/marts_production_users.sql", "unique_id": "model.zlv_dbt_project.marts_production_users", "fqn": ["zlv_dbt_project", "marts", "production", "marts_production_users"], "alias": "marts_production_users", "checksum": {"name": "sha256", "checksum": "61dc8839389bad1a3a32f7703c7f794e888e74d17ba81d97817f02783356f590"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": "user_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table", "unique_key": "user_id"}, "created_at": 1736418960.1126342, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_users\"", "raw_code": "{{\nconfig (\nmaterialized = 'table',\nunique_key = 'user_id',\n)\n}}\n\nSELECT\nCAST (pu.id AS VARCHAR) user_id,\nCAST (pe.id AS VARCHAR) establishment_id,\npu.*,\npe.*\nFROM {{ ref ('int_production_users') }} pu\nLEFT JOIN {{ ref ('int_production_establishments') }} pe ON pe.id = pu.establishment_id", "language": "sql", "refs": [{"name": "int_production_users", "package": null, "version": null}, {"name": "int_production_establishments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_users", "model.zlv_dbt_project.int_production_establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_housing": {"database": "database_name", "schema": "main_marts", "name": "marts_production_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/marts_production_housing.sql", "original_file_path": "models/marts/production/marts_production_housing.sql", "unique_id": "model.zlv_dbt_project.marts_production_housing", "fqn": ["zlv_dbt_project", "marts", "production", "marts_production_housing"], "alias": "marts_production_housing", "checksum": {"name": "sha256", "checksum": "f334c96c2b3cd71fb8d16d740135f94c0afe1ff37b8a180761389a2bdecb03d2"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": "housing_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table", "unique_key": "housing_id"}, "created_at": 1736418960.111937, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_housing\"", "raw_code": "{{\nconfig (\nmaterialized = 'table',\nunique_key = 'housing_id',\n)\n}}\nSELECT\nCAST (h.id as VARCHAR) as housing_id,\nh.* EXCLUDE (vacancy_reasons, precisions),\nhs.last_event_status_zlv_followup,\nhs.last_event_status_label_zlv_followup,\nhs.last_event_date_zlv_followup,\nhs.last_event_status_user_followup,\nhs.last_event_status_label_user_followup,\nhs.last_event_date_user_followup,\nhs.last_event_status_followup,\nhs.last_event_status_label_followup,\nhs.last_event_date_followup,\nhs.last_event_status_zlv_occupancy,\nhs.last_event_status_label_zlv_occupancy,\nhs.last_event_date_zlv_occupancy,\nhs.last_event_status_user_occupancy,\nhs.last_event_status_label_user_occupancy,\nhs.last_event_date_user_occupancy,\nhs.last_event_status_occupancy,\nhs.last_event_status_label_occupancy,\nhs.last_event_date_occupancy,\nCASE WHEN energy_consumption_bdnb IN ('F',\n'G') THEN TRUE ELSE FALSE END as energy_sieve,\nCASE WHEN vacancy_start_year < DATE_PART ('year',\nCURRENT_DATE) - 3 THEN TRUE ELSE FALSE END as vacant_two_years,\nCASE WHEN c.opah > 2 THEN TRUE ELSE FALSE END as is_in_opah_teritory,\nc.tlv1 as is_in_tlv1_teritory,\nc.tlv2 as is_in_tlv2_teritory,\nc.action_coeur_de_ville as is_in_action_coeur_de_ville_teritory,\nc.action_coeur_de_ville_1 as is_in_action_coeur_de_ville_1_teritory,\nc.petite_ville_de_demain as is_in_petite_ville_de_demain_teritory,\nc.village_davenir as is_in_village_davenir_teritory,\nc.label,\nc.zip_code,\nc.avg_latitude,\nc.avg_longitude,\nc.department_name,\nc.department_number,\nc.region_name,\nc.region_geojson_name,\nphc.*,\nphg.*,\nphe.establishment_ids,\nphe.establishment_ids_array,\nphu.has_users as is_on_user_teritory\nFROM {{ ref ('int_production_housing') }} h\nLEFT JOIN {{ ref ('int_production_housing_last_status') }} hs ON h.id = hs.housing_id\nLEFT JOIN {{ ref ('marts_common_cities') }} c ON h.city_code = c.city_code\nLEFT JOIN {{ ref ('int_production_housing_campaigns') }} phc ON phc.housing_id = h.id\nLEFT JOIN {{ ref ('int_production_housing_groups') }} phg ON phg.housing_id = h.id\nLEFT JOIN {{ ref ('int_production_housing_establishments') }} phe ON phe.housing_id = h.id\nLEFT JOIN {{ ref ('int_production_housing_users') }} phu ON phu.housing_id = h.id", "language": "sql", "refs": [{"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing_last_status", "package": null, "version": null}, {"name": "marts_common_cities", "package": null, "version": null}, {"name": "int_production_housing_campaigns", "package": null, "version": null}, {"name": "int_production_housing_groups", "package": null, "version": null}, {"name": "int_production_housing_establishments", "package": null, "version": null}, {"name": "int_production_housing_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_housing", "model.zlv_dbt_project.int_production_housing_last_status", "model.zlv_dbt_project.marts_common_cities", "model.zlv_dbt_project.int_production_housing_campaigns", "model.zlv_dbt_project.int_production_housing_groups", "model.zlv_dbt_project.int_production_housing_establishments", "model.zlv_dbt_project.int_production_housing_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_owners": {"database": "database_name", "schema": "main_marts", "name": "marts_production_owners", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/marts_production_owners.sql", "original_file_path": "models/marts/production/marts_production_owners.sql", "unique_id": "model.zlv_dbt_project.marts_production_owners", "fqn": ["zlv_dbt_project", "marts", "production", "marts_production_owners"], "alias": "marts_production_owners", "checksum": {"name": "sha256", "checksum": "a8b0c299491dfd3f010e75c0f83dbc0ccf8ef4266ba2d955bcaade2dceeb77d1"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": "owner_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table", "unique_key": "owner_id"}, "created_at": 1736418960.1124768, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_owners\"", "raw_code": "{{\nconfig (\nmaterialized = 'table',\nunique_key = 'owner_id',\n)\n}}\n\nSELECT\nCAST (po.id AS VARCHAR) as owner_id,\npo.*\nFROM {{ ref ('int_production_owners') }} po", "language": "sql", "refs": [{"name": "int_production_owners", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_owners"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_establishments": {"database": "database_name", "schema": "main_marts", "name": "marts_production_establishments", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/marts_production_establishments.sql", "original_file_path": "models/marts/production/marts_production_establishments.sql", "unique_id": "model.zlv_dbt_project.marts_production_establishments", "fqn": ["zlv_dbt_project", "marts", "production", "marts_production_establishments"], "alias": "marts_production_establishments", "checksum": {"name": "sha256", "checksum": "a8cee7fcf35344bc1e53a936ddce359b3eb7aedbd0d3c710ddc551178eb450b0"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": "establishment_id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table", "unique_key": "establishment_id"}, "created_at": 1736418960.11232, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_establishments\"", "raw_code": "{{\nconfig (\nmaterialized = 'table',\nunique_key = 'establishment_id',\n)\n}}\n\nSELECT\nCAST (pe.id as VARCHAR) AS establishment_id,\npe.*, peu.*, pec.*, peg.*, pep.*, pecc.*, pes.*\nFROM {{ ref ('int_production_establishments') }} pe\nLEFT JOIN {{ ref ('int_production_establishments_users') }} peu ON pe.id = peu.establishment_id\nLEFT JOIN {{ ref ('int_production_establishments_campaigns') }} pec ON pe.id = pec.establishment_id\nLEFT JOIN {{ ref ('int_production_establishments_groups') }} peg ON pe.id = peg.establishment_id\nLEFT JOIN {{ ref ('int_production_establishments_perimeters') }} pep ON pe.id = pep.establishment_id\nLEFT JOIN {{ ref ('int_production_establishments_campaigns_contacts') }} pecc ON pe.id = pecc.establishment_id\nLEFT JOIN {{ ref ('int_production_establishment_events_last_status') }} pes ON pe.id = pes.establishment_id", "language": "sql", "refs": [{"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_establishments_users", "package": null, "version": null}, {"name": "int_production_establishments_campaigns", "package": null, "version": null}, {"name": "int_production_establishments_groups", "package": null, "version": null}, {"name": "int_production_establishments_perimeters", "package": null, "version": null}, {"name": "int_production_establishments_campaigns_contacts", "package": null, "version": null}, {"name": "int_production_establishment_events_last_status", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_establishments_users", "model.zlv_dbt_project.int_production_establishments_campaigns", "model.zlv_dbt_project.int_production_establishments_groups", "model.zlv_dbt_project.int_production_establishments_perimeters", "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "model.zlv_dbt_project.int_production_establishment_events_last_status"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_join_owner_housing": {"database": "database_name", "schema": "main_marts", "name": "marts_production_join_owner_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/join/marts_production_join_owner_housing.sql", "original_file_path": "models/marts/production/join/marts_production_join_owner_housing.sql", "unique_id": "model.zlv_dbt_project.marts_production_join_owner_housing", "fqn": ["zlv_dbt_project", "marts", "production", "join", "marts_production_join_owner_housing"], "alias": "marts_production_join_owner_housing", "checksum": {"name": "sha256", "checksum": "57b0eaf20449d17682724f8e8b7ea28cd500207e6199e2b2045f794c7933c9d6"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.679808, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_join_owner_housing\"", "raw_code": "SELECT\n *\nFROM {{ ref ('stg_production_owners_housing') }} pc", "language": "sql", "refs": [{"name": "stg_production_owners_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_owners_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_join_establishment_housing": {"database": "database_name", "schema": "main_marts", "name": "marts_production_join_establishment_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/join/marts_production_join_establishment_housing.sql", "original_file_path": "models/marts/production/join/marts_production_join_establishment_housing.sql", "unique_id": "model.zlv_dbt_project.marts_production_join_establishment_housing", "fqn": ["zlv_dbt_project", "marts", "production", "join", "marts_production_join_establishment_housing"], "alias": "marts_production_join_establishment_housing", "checksum": {"name": "sha256", "checksum": "3d56ea4f6ce7022e3b8d8bd9ab7a1f73090cb9d5448b4d2dfd9ad768ef020023"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.680707, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_join_establishment_housing\"", "raw_code": "SELECT\n establishment_id,\n ec.geo_code,\n h.id\nFROM {{ ref ('marts_production_join_establishment_cities') }} ec\nJOIN {{ ref ('int_production_housing') }} h ON ec.geo_code = h.geo_code", "language": "sql", "refs": [{"name": "marts_production_join_establishment_cities", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.marts_production_join_establishment_cities", "model.zlv_dbt_project.int_production_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_join_housing_groups": {"database": "database_name", "schema": "main_marts", "name": "marts_production_join_housing_groups", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/join/marts_production_join_housing_groups.sql", "original_file_path": "models/marts/production/join/marts_production_join_housing_groups.sql", "unique_id": "model.zlv_dbt_project.marts_production_join_housing_groups", "fqn": ["zlv_dbt_project", "marts", "production", "join", "marts_production_join_housing_groups"], "alias": "marts_production_join_housing_groups", "checksum": {"name": "sha256", "checksum": "02e6072e6a5bd541dc2b1965d591a95facbbefb753b125ab3c80e82d3a5cd962"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.681685, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_join_housing_groups\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_production_groups_housing') }}", "language": "sql", "refs": [{"name": "stg_production_groups_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_groups_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_join_establishment_cities": {"database": "database_name", "schema": "main_marts", "name": "marts_production_join_establishment_cities", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/join/marts_production_join_establishment_cities.sql", "original_file_path": "models/marts/production/join/marts_production_join_establishment_cities.sql", "unique_id": "model.zlv_dbt_project.marts_production_join_establishment_cities", "fqn": ["zlv_dbt_project", "marts", "production", "join", "marts_production_join_establishment_cities"], "alias": "marts_production_join_establishment_cities", "checksum": {"name": "sha256", "checksum": "bc94e7a2e7ec1a1950a0a8f7669501e2b52242eb4dfd99e187bec7b24fad6d28"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.6826172, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_join_establishment_cities\"", "raw_code": "SELECT\n CAST(pe.id AS VARCHAR) AS establishment_id,\n UNNEST(pe.localities_geo_code) AS geo_code\nFROM {{ ref ('int_production_establishments') }} pe", "language": "sql", "refs": [{"name": "int_production_establishments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_production_join_campaigns_housing": {"database": "database_name", "schema": "main_marts", "name": "marts_production_join_campaigns_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/production/join/marts_production_join_campaigns_housing.sql", "original_file_path": "models/marts/production/join/marts_production_join_campaigns_housing.sql", "unique_id": "model.zlv_dbt_project.marts_production_join_campaigns_housing", "fqn": ["zlv_dbt_project", "marts", "production", "join", "marts_production_join_campaigns_housing"], "alias": "marts_production_join_campaigns_housing", "checksum": {"name": "sha256", "checksum": "74b9b27f19e3c4ef61e804868d401fa55bcbf2aee325466e279a18853aadac3e"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418959.683588, "relation_name": "\"database_name\".\"main_marts\".\"marts_production_join_campaigns_housing\"", "raw_code": "SELECT *\nFROM {{ ref ('int_production_campaigns_housing') }}", "language": "sql", "refs": [{"name": "int_production_campaigns_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_stats_monthly_campains": {"database": "database_name", "schema": "main_marts", "name": "marts_stats_monthly_campains", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/stats/marts_stats_monthly_campains.sql", "original_file_path": "models/marts/stats/marts_stats_monthly_campains.sql", "unique_id": "model.zlv_dbt_project.marts_stats_monthly_campains", "fqn": ["zlv_dbt_project", "marts", "stats", "marts_stats_monthly_campains"], "alias": "marts_stats_monthly_campains", "checksum": {"name": "sha256", "checksum": "9cb96a9a9cfa6db630d7b27e52effe861e5ce95536b0ba5f214d74005454feb2"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/stats/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418960.11284, "relation_name": "\"database_name\".\"main_marts\".\"marts_stats_monthly_campains\"", "raw_code": "WITH campaigns AS (\n SELECT * FROM {{ ref ('int_production_campaigns') }}\n),\n\nmonths AS (\n SELECT date_month AS month FROM {{ ref ('int_common_spine_months') }}\n),\n\ncampaigns_events AS (\n SELECT\n DATE_TRUNC('month', created_at) AS month,\n COUNT(*) AS total_created,\n SUM(CASE WHEN validated_at IS NOT NULL THEN 1 ELSE 0 END)\n AS total_validated,\n SUM(CASE WHEN confirmed_at IS NOT NULL THEN 1 ELSE 0 END)\n AS total_confirmed,\n SUM(CASE WHEN sent_at IS NOT NULL THEN 1 ELSE 0 END) AS total_sent\n FROM campaigns\n GROUP BY month\n),\n\nmonthly_campaigns AS (\n SELECT\n m.month,\n COALESCE(SUM(c.total_created), 0) AS total_campaigns_created,\n COALESCE(SUM(c.total_validated), 0) AS total_campaigns_validated,\n COALESCE(SUM(c.total_confirmed), 0) AS total_campaigns_confirmed,\n COALESCE(SUM(c.total_sent), 0) AS total_campaigns_sent\n FROM\n months m\n LEFT JOIN\n campaigns_events c\n ON\n m.month = c.month\n GROUP BY\n m.month\n ORDER BY\n m.month\n)\n\nSELECT\n c.*,\n SUM(total_campaigns_validated)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_validated,\n SUM(total_campaigns_created)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_created,\n SUM(total_campaigns_confirmed)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_confirmed,\n SUM(total_campaigns_sent)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_sent\nFROM monthly_campaigns c", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_common_spine_months", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_common_spine_months"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_stats_monthly_signup": {"database": "database_name", "schema": "main_marts", "name": "marts_stats_monthly_signup", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/stats/marts_stats_monthly_signup.sql", "original_file_path": "models/marts/stats/marts_stats_monthly_signup.sql", "unique_id": "model.zlv_dbt_project.marts_stats_monthly_signup", "fqn": ["zlv_dbt_project", "marts", "stats", "marts_stats_monthly_signup"], "alias": "marts_stats_monthly_signup", "checksum": {"name": "sha256", "checksum": "9699ace0b2f91ea193598f9eec2653f9769cfba43caef9f0cc52f52636ae925a"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/stats/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418960.1131442, "relation_name": "\"database_name\".\"main_marts\".\"marts_stats_monthly_signup\"", "raw_code": "WITH months AS (\n SELECT date_month AS month FROM {{ ref ('int_common_spine_months') }}\n),\n\nestablishment_data AS (\n SELECT\n DATE_TRUNC('month', first_activated_at) AS month,\n COUNT(*) AS created_establishments,\n SUM(user_number) AS created_establishments_accounts\n FROM\n {{ ref ('marts_production_establishments') }}\n WHERE\n user_number > 0\n GROUP BY\n month\n),\n\nusers_data AS (\n SELECT\n DATE_TRUNC('month', activated_at) AS month,\n COUNT(*) AS created_users\n FROM\n {{ ref ('marts_production_users') }}\n GROUP BY\n month\n)\n\nSELECT\n m.month,\n COALESCE(ed.created_establishments, 0) AS created_establishments,\n SUM(COALESCE(ed.created_establishments, 0))\n OVER (ORDER BY m.month)\n AS cumulative_created_establishments,\n COALESCE(ed.created_establishments_accounts, 0)\n AS created_establishments_accounts,\n SUM(COALESCE(ed.created_establishments_accounts, 0))\n OVER (ORDER BY m.month)\n AS cumulative_created_establishments_accounts,\n COALESCE(ud.created_users, 0) AS created_users,\n SUM(COALESCE(ud.created_users, 0))\n OVER (ORDER BY m.month)\n AS cumulative_created_users\nFROM\n months m\nLEFT JOIN\n establishment_data ed\n ON\n m.month = ed.month\nLEFT JOIN\n users_data ud\n ON\n m.month = ud.month", "language": "sql", "refs": [{"name": "int_common_spine_months", "package": null, "version": null}, {"name": "marts_production_establishments", "package": null, "version": null}, {"name": "marts_production_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_common_spine_months", "model.zlv_dbt_project.marts_production_establishments", "model.zlv_dbt_project.marts_production_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_stats_monthly_events": {"database": "database_name", "schema": "main_marts", "name": "marts_stats_monthly_events", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/stats/marts_stats_monthly_events.sql", "original_file_path": "models/marts/stats/marts_stats_monthly_events.sql", "unique_id": "model.zlv_dbt_project.marts_stats_monthly_events", "fqn": ["zlv_dbt_project", "marts", "stats", "marts_stats_monthly_events"], "alias": "marts_stats_monthly_events", "checksum": {"name": "sha256", "checksum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/stats/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418960.11345, "relation_name": "\"database_name\".\"main_marts\".\"marts_stats_monthly_events\"", "raw_code": "", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_stats_monthly_housing": {"database": "database_name", "schema": "main_marts", "name": "marts_stats_monthly_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/stats/marts_stats_monthly_housing.sql", "original_file_path": "models/marts/stats/marts_stats_monthly_housing.sql", "unique_id": "model.zlv_dbt_project.marts_stats_monthly_housing", "fqn": ["zlv_dbt_project", "marts", "stats", "marts_stats_monthly_housing"], "alias": "marts_stats_monthly_housing", "checksum": {"name": "sha256", "checksum": "9cb96a9a9cfa6db630d7b27e52effe861e5ce95536b0ba5f214d74005454feb2"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/stats/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418960.1132958, "relation_name": "\"database_name\".\"main_marts\".\"marts_stats_monthly_housing\"", "raw_code": "WITH campaigns AS (\n SELECT * FROM {{ ref ('int_production_campaigns') }}\n),\n\nmonths AS (\n SELECT date_month AS month FROM {{ ref ('int_common_spine_months') }}\n),\n\ncampaigns_events AS (\n SELECT\n DATE_TRUNC('month', created_at) AS month,\n COUNT(*) AS total_created,\n SUM(CASE WHEN validated_at IS NOT NULL THEN 1 ELSE 0 END)\n AS total_validated,\n SUM(CASE WHEN confirmed_at IS NOT NULL THEN 1 ELSE 0 END)\n AS total_confirmed,\n SUM(CASE WHEN sent_at IS NOT NULL THEN 1 ELSE 0 END) AS total_sent\n FROM campaigns\n GROUP BY month\n),\n\nmonthly_campaigns AS (\n SELECT\n m.month,\n COALESCE(SUM(c.total_created), 0) AS total_campaigns_created,\n COALESCE(SUM(c.total_validated), 0) AS total_campaigns_validated,\n COALESCE(SUM(c.total_confirmed), 0) AS total_campaigns_confirmed,\n COALESCE(SUM(c.total_sent), 0) AS total_campaigns_sent\n FROM\n months m\n LEFT JOIN\n campaigns_events c\n ON\n m.month = c.month\n GROUP BY\n m.month\n ORDER BY\n m.month\n)\n\nSELECT\n c.*,\n SUM(total_campaigns_validated)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_validated,\n SUM(total_campaigns_created)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_created,\n SUM(total_campaigns_confirmed)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_confirmed,\n SUM(total_campaigns_sent)\n OVER (ORDER BY c.month)\n AS cumulative_campaigns_sent\nFROM monthly_campaigns c", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_common_spine_months", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_common_spine_months"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.marts_stats_monthly_global": {"database": "database_name", "schema": "main_marts", "name": "marts_stats_monthly_global", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "marts/stats/marts_stats_monthly_global.sql", "original_file_path": "models/marts/stats/marts_stats_monthly_global.sql", "unique_id": "model.zlv_dbt_project.marts_stats_monthly_global", "fqn": ["zlv_dbt_project", "marts", "stats", "marts_stats_monthly_global"], "alias": "marts_stats_monthly_global", "checksum": {"name": "sha256", "checksum": "684c1621792f703e8b2cb6bd757997b52febab22e8b87dff7f2cc6e883c49041"}, "config": {"enabled": true, "alias": null, "schema": "marts", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/marts/stats/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "marts", "materialized": "table"}, "created_at": 1736418960.112993, "relation_name": "\"database_name\".\"main_marts\".\"marts_stats_monthly_global\"", "raw_code": "WITH campains_monthly_stats AS (\n SELECT * FROM {{ ref ('marts_stats_monthly_campains') }}\n),\n\nsignup_monthlys_stats AS (\n SELECT * FROM {{ ref ('marts_stats_monthly_signup') }}\n)\n\nSELECT\n campains_monthly_stats.*,\n signup_monthlys_stats.*\nFROM campains_monthly_stats\nLEFT OUTER JOIN\n signup_monthlys_stats\n ON campains_monthly_stats.month = signup_monthlys_stats.month", "language": "sql", "refs": [{"name": "marts_stats_monthly_campains", "package": null, "version": null}, {"name": "marts_stats_monthly_signup", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.marts_stats_monthly_campains", "model.zlv_dbt_project.marts_stats_monthly_signup"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_com_epci_dep_region": {"database": "database_name", "schema": "main_int", "name": "int_common_com_epci_dep_region", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_com_epci_dep_region.sql", "original_file_path": "models/intermediate/common/int_common_com_epci_dep_region.sql", "unique_id": "model.zlv_dbt_project.int_common_com_epci_dep_region", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_com_epci_dep_region"], "alias": "int_common_com_epci_dep_region", "checksum": {"name": "sha256", "checksum": "173cde32964aa949bb8c5ddafd6861684d387b379490cc40af850c4960a6f95c"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.689213, "relation_name": "\"database_name\".\"main_int\".\"int_common_com_epci_dep_region\"", "raw_code": "SELECT * FROM {{ ref ('stg_common_com_epci_dep_region') }}", "language": "sql", "refs": [{"name": "stg_common_com_epci_dep_region", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_com_epci_dep_region"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_ngeo_anct_cog_2023": {"database": "database_name", "schema": "main_int", "name": "int_common_ngeo_anct_cog_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_ngeo_anct_cog_2023.sql", "original_file_path": "models/intermediate/common/int_common_ngeo_anct_cog_2023.sql", "unique_id": "model.zlv_dbt_project.int_common_ngeo_anct_cog_2023", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_ngeo_anct_cog_2023"], "alias": "int_common_ngeo_anct_cog_2023", "checksum": {"name": "sha256", "checksum": "d743bc04f2388adf49869a5e67780f562506e38a166e7f22507ac0642a774f24"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.114414, "relation_name": "\"database_name\".\"main_int\".\"int_common_ngeo_anct_cog_2023\"", "raw_code": "SELECT\n insee_com AS geo_code,\n CASE WHEN id_acv IS NOT NULL THEN TRUE ELSE FALSE END\n AS action_coeur_de_ville,\n CASE WHEN id_acv2 IS NOT NULL THEN TRUE ELSE FALSE END\n AS action_coeur_de_ville,\n CASE WHEN id_pvd IS NOT NULL THEN TRUE ELSE FALSE END\n AS petite_ville_de_demain,\n CASE WHEN id_va IS NOT NULL THEN TRUE ELSE FALSE END AS village_davenir\nFROM {{ ref ('stg_common_ngeo_anct_cog_2023') }}", "language": "sql", "refs": [{"name": "stg_common_ngeo_anct_cog_2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_cities_mapping": {"database": "database_name", "schema": "main_int", "name": "int_common_cities_mapping", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_cities_mapping.sql", "original_file_path": "models/intermediate/common/int_common_cities_mapping.sql", "unique_id": "model.zlv_dbt_project.int_common_cities_mapping", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_cities_mapping"], "alias": "int_common_cities_mapping", "checksum": {"name": "sha256", "checksum": "bfb2218227b408d60a35cf86589289550fbec1177be420437f361be4b6322aa6"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.113803, "relation_name": "\"database_name\".\"main_int\".\"int_common_cities_mapping\"", "raw_code": "SELECT\n geo_code,\n CASE\n -- Paris\n WHEN\n geo_code IN (\n '75101',\n '75102',\n '75103',\n '75104',\n '75105',\n '75106',\n '75107',\n '75108',\n '75109',\n '75110',\n '75111',\n '75112',\n '75113',\n '75114',\n '75115',\n '75116',\n '75117',\n '75118',\n '75119',\n '75120'\n )\n THEN '75056'\n -- Marseille\n WHEN\n geo_code IN (\n '13201',\n '13202',\n '13203',\n '13204',\n '13205',\n '13206',\n '13207',\n '13208',\n '13209',\n '13210',\n '13211',\n '13212',\n '13213',\n '13214',\n '13215',\n '13216',\n )\n THEN '13055'\n -- Lyon\n WHEN\n geo_code IN (\n '69381',\n '69382',\n '69383',\n '69384',\n '69385',\n '69386',\n '69387',\n '69388',\n '69389'\n )\n THEN '69123'\n ELSE geo_code\n END AS city_code\nFROM {{ ref ('int_common_cities') }}", "language": "sql", "refs": [{"name": "int_common_cities", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_common_cities"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_spine_days": {"database": "database_name", "schema": "main_int", "name": "int_common_spine_days", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_spine_days.sql", "original_file_path": "models/intermediate/common/int_common_spine_days.sql", "unique_id": "model.zlv_dbt_project.int_common_spine_days", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_spine_days"], "alias": "int_common_spine_days", "checksum": {"name": "sha256", "checksum": "bc30a8346c67ace7c9e21d57bd918cdb2f49c5606511c1a25ffa02d2efc5d344"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.1139562, "relation_name": "\"database_name\".\"main_int\".\"int_common_spine_days\"", "raw_code": "{{ dbt_utils.date_spine (\ndatepart = \"day\",\nstart_date = \"cast('2020-01-01' as date)\",\nend_date = \"CURRENT_DATE\"\n) }}", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_ort": {"database": "database_name", "schema": "main_int", "name": "int_common_ort", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_ort.sql", "original_file_path": "models/intermediate/common/int_common_ort.sql", "unique_id": "model.zlv_dbt_project.int_common_ort", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_ort"], "alias": "int_common_ort", "checksum": {"name": "sha256", "checksum": "02d63c09a465b46b5031f5dce40bf3d3de0cf80cc85894fd11a217d9180c7d3a"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.704746, "relation_name": "\"database_name\".\"main_int\".\"int_common_ort\"", "raw_code": "SELECT\n geo_code,\n CASE WHEN signed = 'Sign\u00e9e' THEN TRUE ELSE FALSE END AS signed,\n signed_at\nFROM {{ ref ('stg_common_ort') }}", "language": "sql", "refs": [{"name": "stg_common_ort", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_ort"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_table_appartenance": {"database": "database_name", "schema": "main_int", "name": "int_common_table_appartenance", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_table_appartenance.sql", "original_file_path": "models/intermediate/common/int_common_table_appartenance.sql", "unique_id": "model.zlv_dbt_project.int_common_table_appartenance", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_table_appartenance"], "alias": "int_common_table_appartenance", "checksum": {"name": "sha256", "checksum": "d417bca583c5ddcd19d0f5493f42482280911a945c499e5401c0043ed03d03b0"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.705667, "relation_name": "\"database_name\".\"main_int\".\"int_common_table_appartenance\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_common_table_appartenance') }}", "language": "sql", "refs": [{"name": "stg_common_table_appartenance", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_table_appartenance"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_spine_months": {"database": "database_name", "schema": "main_int", "name": "int_common_spine_months", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_spine_months.sql", "original_file_path": "models/intermediate/common/int_common_spine_months.sql", "unique_id": "model.zlv_dbt_project.int_common_spine_months", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_spine_months"], "alias": "int_common_spine_months", "checksum": {"name": "sha256", "checksum": "725999282136b30ee0a2b1b8e431113b7ce3f3cbc30407c6fed656565e375125"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.114107, "relation_name": "\"database_name\".\"main_int\".\"int_common_spine_months\"", "raw_code": "{{ dbt_utils.date_spine (\ndatepart = \"month\",\nstart_date = \"cast('2020-01-01' as date)\",\nend_date = \"cast(CURRENT_DATE + INTERVAL '1 month' - INTERVAL '1 day' as date)\",\n) }}", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_spine_years": {"database": "database_name", "schema": "main_int", "name": "int_common_spine_years", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_spine_years.sql", "original_file_path": "models/intermediate/common/int_common_spine_years.sql", "unique_id": "model.zlv_dbt_project.int_common_spine_years", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_spine_years"], "alias": "int_common_spine_years", "checksum": {"name": "sha256", "checksum": "31f4de57943613b24f5b29dcb0aaeffa9d76a572a52428e8fc3a9665b0166771"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.114259, "relation_name": "\"database_name\".\"main_int\".\"int_common_spine_years\"", "raw_code": "{{ dbt_utils.date_spine (\ndatepart = \"year\",\nstart_date = \"cast('2020-01-01' as date)\",\nend_date = \"CURRENT_DATE\"\n) }}", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_opah": {"database": "database_name", "schema": "main_int", "name": "int_common_opah", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_opah.sql", "original_file_path": "models/intermediate/common/int_common_opah.sql", "unique_id": "model.zlv_dbt_project.int_common_opah", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_opah"], "alias": "int_common_opah", "checksum": {"name": "sha256", "checksum": "20688bc9c24a67902b4b9b6b9f1d994dd1fc360d0f36aef65bf2451c8f99d0ce"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.1145651, "relation_name": "\"database_name\".\"main_int\".\"int_common_opah\"", "raw_code": "SELECT\n insee_code AS geo_code,\n SUM(CASE WHEN typeprogramme LIKE '%OPAH%' THEN 1 ELSE 0 END) AS opah,\n STRING_AGG(\n DISTINCT(CASE WHEN typeprogramme LIKE '%OPAH%' THEN typeprogramme END)\n ) AS type_opah,\n SUM(CASE WHEN typeprogramme LIKE '%PIG%' THEN 1 ELSE 0 END) AS pig\nFROM {{ ref ('stg_common_opah') }}\nGROUP BY geo_code", "language": "sql", "refs": [{"name": "stg_common_opah", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_opah"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_fusions": {"database": "database_name", "schema": "main_int", "name": "int_common_fusions", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_fusions.sql", "original_file_path": "models/intermediate/common/int_common_fusions.sql", "unique_id": "model.zlv_dbt_project.int_common_fusions", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_fusions"], "alias": "int_common_fusions", "checksum": {"name": "sha256", "checksum": "4277cdf1bf164398a93eba09f586c6c6711bb787fdfb011ba16a8d85ffb3dd2f"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.712457, "relation_name": "\"database_name\".\"main_int\".\"int_common_fusions\"", "raw_code": "WITH ranked_fusions AS (\n SELECT\n *,\n ROW_NUMBER()\n OVER (PARTITION BY geo_code_destination ORDER BY year DESC)\n AS row_num\n FROM {{ ref ('stg_common_fusions') }}\n)\n\nSELECT *, TRUE AS has_fusion\nFROM ranked_fusions\nWHERE row_num = 1", "language": "sql", "refs": [{"name": "stg_common_fusions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_fusions"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_departements_france": {"database": "database_name", "schema": "main_int", "name": "int_common_departements_france", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_departements_france.sql", "original_file_path": "models/intermediate/common/int_common_departements_france.sql", "unique_id": "model.zlv_dbt_project.int_common_departements_france", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_departements_france"], "alias": "int_common_departements_france", "checksum": {"name": "sha256", "checksum": "621e00e96111b41487202f1564ee87e8933d251b51277dc47f6bd8a967d720c0"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7133482, "relation_name": "\"database_name\".\"main_int\".\"int_common_departements_france\"", "raw_code": "SELECT * FROM {{ ref ('stg_common_departements_france') }}", "language": "sql", "refs": [{"name": "stg_common_departements_france", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_departements_france"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_cities": {"database": "database_name", "schema": "main_int", "name": "int_common_cities", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_cities.sql", "original_file_path": "models/intermediate/common/int_common_cities.sql", "unique_id": "model.zlv_dbt_project.int_common_cities", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_cities"], "alias": "int_common_cities", "checksum": {"name": "sha256", "checksum": "e8adea632728366339f8cb9bb9f1cb19f8c1ee9bc12868ea1a3f3c49cf52ce0a"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.113651, "relation_name": "\"database_name\".\"main_int\".\"int_common_cities\"", "raw_code": "SELECT DISTINCT\n ON(insee_code) *,\n insee_code AS geo_code\nFROM {{ ref ('stg_common_cities') }}", "language": "sql", "refs": [{"name": "stg_common_cities", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_cities"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_article_232_1": {"database": "database_name", "schema": "main_int", "name": "int_common_article_232_1", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_article_232_1.sql", "original_file_path": "models/intermediate/common/int_common_article_232_1.sql", "unique_id": "model.zlv_dbt_project.int_common_article_232_1", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_article_232_1"], "alias": "int_common_article_232_1", "checksum": {"name": "sha256", "checksum": "9fb877b62c126ce4e87830efa219a64d0c2c74fc7f6eae69d8709bd73e99837c"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.114948, "relation_name": "\"database_name\".\"main_int\".\"int_common_article_232_1\"", "raw_code": "SELECT geo_code, TRUE AS is_in\nFROM {{ ref ('stg_common_article_232_1') }}", "language": "sql", "refs": [{"name": "stg_common_article_232_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_article_232_1"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_article_232_2": {"database": "database_name", "schema": "main_int", "name": "int_common_article_232_2", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_article_232_2.sql", "original_file_path": "models/intermediate/common/int_common_article_232_2.sql", "unique_id": "model.zlv_dbt_project.int_common_article_232_2", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_article_232_2"], "alias": "int_common_article_232_2", "checksum": {"name": "sha256", "checksum": "52237a83736c2079820d7ea3a6a0aa50703b6a9548819cf5a3e1a69a14e1d415"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/common/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.1147149, "relation_name": "\"database_name\".\"main_int\".\"int_common_article_232_2\"", "raw_code": "SELECT rtrim(geo_code) AS geo_code, TRUE AS is_in\nFROM {{ ref ('stg_common_article_232_2') }}", "language": "sql", "refs": [{"name": "stg_common_article_232_2", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_article_232_2"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_common_scissions": {"database": "database_name", "schema": "main_int", "name": "int_common_scissions", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/common/int_common_scissions.sql", "original_file_path": "models/intermediate/common/int_common_scissions.sql", "unique_id": "model.zlv_dbt_project.int_common_scissions", "fqn": ["zlv_dbt_project", "intermediate", "common", "int_common_scissions"], "alias": "int_common_scissions", "checksum": {"name": "sha256", "checksum": "c87c4607b5f89fcad5b56a75ed413d68398a046e2029e0e6975d8b33b5b925d0"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7174149, "relation_name": "\"database_name\".\"main_int\".\"int_common_scissions\"", "raw_code": "WITH ranked_scissions AS (\n SELECT\n *,\n ROW_NUMBER()\n OVER (PARTITION BY geo_code_destination ORDER BY year DESC)\n AS row_num\n FROM {{ ref ('stg_common_scissions') }}\n)\n\nSELECT *, TRUE AS has_scission\nFROM ranked_scissions\nWHERE row_num = 1", "language": "sql", "refs": [{"name": "stg_common_scissions", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_common_scissions"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_geo_perimeters": {"database": "database_name", "schema": "main_int", "name": "int_production_geo_perimeters", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_geo_perimeters.sql", "original_file_path": "models/intermediate/production/int_production_geo_perimeters.sql", "unique_id": "model.zlv_dbt_project.int_production_geo_perimeters", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_geo_perimeters"], "alias": "int_production_geo_perimeters", "checksum": {"name": "sha256", "checksum": "f63ff24d929035f95985b96e4d68ea7c097a0056af7d7fad84a5cb2a66b8210d"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.718322, "relation_name": "\"database_name\".\"main_int\".\"int_production_geo_perimeters\"", "raw_code": "SELECT\n pg.*\nFROM {{ ref ('stg_production_geo_perimeters') }} pg\nWHERE pg.created_by IS NOT NULL", "language": "sql", "refs": [{"name": "stg_production_geo_perimeters", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_geo_perimeters"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_housing_campaigns": {"database": "database_name", "schema": "main_int", "name": "int_production_housing_campaigns", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_housing_campaigns.sql", "original_file_path": "models/intermediate/production/int_production_housing_campaigns.sql", "unique_id": "model.zlv_dbt_project.int_production_housing_campaigns", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_housing_campaigns"], "alias": "int_production_housing_campaigns", "checksum": {"name": "sha256", "checksum": "a77919de778ab4cfa5682c21fdececc5f5ebed9c8cd081c9e4da4b7844b9caf7"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.719191, "relation_name": "\"database_name\".\"main_int\".\"int_production_housing_campaigns\"", "raw_code": "SELECT\n housing_id,\n MIN(pc.created_at) AS first_campaign_created,\n MAX(pc.created_at) AS last_campaign_created,\n MIN(pc.sent_at) AS first_campaign_sent,\n MAX(pc.sent_at) AS last_campaign_sent,\n SUM(pc.is_validated) AS total_validated,\n SUM(pc.is_confirmed) AS total_confirmed,\n SUM(pc.is_sent) AS total_sent\nFROM {{ ref ('stg_production_campaigns_housing') }} as pch\nJOIN {{ ref ('int_production_campaigns') }} as pc ON pch.campaign_id = pc.id\nGROUP BY housing_id", "language": "sql", "refs": [{"name": "stg_production_campaigns_housing", "package": null, "version": null}, {"name": "int_production_campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_campaigns_housing", "model.zlv_dbt_project.int_production_campaigns"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_campaigns_housing_count": {"database": "database_name", "schema": "main_int", "name": "int_production_campaigns_housing_count", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_campaigns_housing_count.sql", "original_file_path": "models/intermediate/production/int_production_campaigns_housing_count.sql", "unique_id": "model.zlv_dbt_project.int_production_campaigns_housing_count", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_campaigns_housing_count"], "alias": "int_production_campaigns_housing_count", "checksum": {"name": "sha256", "checksum": "4e3d98d80a15a2bc2b6f2fa49c2e5520a006c94b0e6b4a4f9a594b389a08eecf"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.720161, "relation_name": "\"database_name\".\"main_int\".\"int_production_campaigns_housing_count\"", "raw_code": "SELECT\n pc.id AS campaign_id,\n COUNT(DISTINCT pch.housing_id) AS count_housing\nFROM {{ ref ('int_production_campaigns') }} pc\nJOIN {{ ref ('int_production_campaigns_housing') }} pch ON pch.campaign_id = pc.id\nGROUP BY pc.id", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_perimeters": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_perimeters", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_perimeters.sql", "original_file_path": "models/intermediate/production/int_production_establishments_perimeters.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_perimeters", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_perimeters"], "alias": "int_production_establishments_perimeters", "checksum": {"name": "sha256", "checksum": "855d6dbbb412678839da9499bf86d5bc5e763460c79a15e28c5a181b203d2bb1"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.721097, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_perimeters\"", "raw_code": "SELECT\n pc.establishment_id,\n TRUE AS has_perimeters,\n COUNT(DISTINCT pc.name) AS total_perimeters,\n COUNT(*) AS total_shapes,\n COUNT(DISTINCT pc.kind) AS total_kinds\nFROM {{ ref ('int_production_geo_perimeters') }} pc\nGROUP BY pc.establishment_id", "language": "sql", "refs": [{"name": "int_production_geo_perimeters", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_geo_perimeters"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_geo_code_establishments": {"database": "database_name", "schema": "main_int", "name": "int_production_geo_code_establishments", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_geo_code_establishments.sql", "original_file_path": "models/intermediate/production/int_production_geo_code_establishments.sql", "unique_id": "model.zlv_dbt_project.int_production_geo_code_establishments", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_geo_code_establishments"], "alias": "int_production_geo_code_establishments", "checksum": {"name": "sha256", "checksum": "d92f79f619e2d1afe636435567262fa5dda899f8365e10cd4324756e895f5f76"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.722005, "relation_name": "\"database_name\".\"main_int\".\"int_production_geo_code_establishments\"", "raw_code": "WITH establishment_info AS (\n SELECT\n loc.geo_code,\n est.id AS establishment_id,\n est.name AS establishment_name,\n est.kind AS establishment_kind,\n est.establishment_kind_label,\n est.covered_by_state_service\n FROM\n {{ ref ('int_production_establishments_localities') }} loc\n LEFT JOIN {{ ref ('int_production_establishments') }} est\n ON loc.establishment_id = est.id\n LEFT JOIN {{ ref ('int_production_establishments_users') }} est_users\n ON est.id = est_users.establishment_id\n WHERE user_number > 0\n)\n\nSELECT\n geo_code,\n MAX(CASE\n WHEN establishment_kind = 'Commune' THEN TRUE\n ELSE FALSE\n END) AS inscrit_zlv_direct,\n MAX(CASE\n WHEN establishment_kind IN ('CA', 'CC', 'CU', 'ME') THEN TRUE\n ELSE FALSE\n END) AS inscrit_zlv_via_intercommunalit\u00e9,\n MAX(CASE \n WHEN establishment_kind IN ('CA', 'CC', 'CU', 'ME') THEN establishment_name\n ELSE NULL\n END) AS nom_intercommunalit\u00e9,\n MAX(CASE \n WHEN establishment_kind IN ('CA', 'CC', 'CU', 'ME') THEN establishment_kind_label\n ELSE NULL\n END) AS type_intercommunalit\u00e9,\n MAX(covered_by_state_service) AS couverte_via_service_etat,\n MAX(CASE \n WHEN establishment_kind = 'SDED' THEN establishment_name\n ELSE NULL\n END) AS department_state_service_name,\n MAX(CASE \n WHEN establishment_kind = 'SDER' THEN establishment_name\n ELSE NULL\n END) AS region_state_service_name\nFROM \n establishment_info\nGROUP BY \n geo_code\nORDER BY \n geo_code", "language": "sql", "refs": [{"name": "int_production_establishments_localities", "package": null, "version": null}, {"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_establishments_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_establishments_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_events_new": {"database": "database_name", "schema": "main_int", "name": "int_production_events_new", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_events_new.sql", "original_file_path": "models/intermediate/production/int_production_events_new.sql", "unique_id": "model.zlv_dbt_project.int_production_events_new", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_events_new"], "alias": "int_production_events_new", "checksum": {"name": "sha256", "checksum": "af8255e88ac3a1fbe7e297cc102d090b7833661e9eccc05f68c5fc88420f3a22"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7229571, "relation_name": "\"database_name\".\"main_int\".\"int_production_events_new\"", "raw_code": "SELECT\n id,\n e.created_at,\n e.created_by,\n he.housing_id,\n CASE\n WHEN\n lower(\n coalesce((e.new -> 'status')::text, '')\n ) LIKE '%jamais contact\u00e9%'\n THEN 0\n WHEN\n lower(coalesce((e.new -> 'status')::text, '')) LIKE '%non suivi%'\n THEN 0\n WHEN\n lower(\n coalesce((e.new -> 'status')::text, '')\n ) LIKE '%en attente de retour%'\n THEN 1\n WHEN\n lower(\n coalesce((e.new -> 'status')::text, '')\n ) LIKE '%premier contact%'\n THEN 2\n WHEN\n lower(\n coalesce((e.new -> 'status')::text, '')\n ) LIKE '%suivi en cours%'\n THEN 3\n WHEN\n lower(coalesce((e.new -> 'status')::text, '')) LIKE '%non-vacant%'\n THEN 4\n WHEN\n lower(\n coalesce((e.new -> 'status')::text, '')\n ) LIKE '%suivi termin\u00e9%'\n THEN 4\n WHEN\n lower(coalesce((e.new -> 'status')::text, '')) LIKE '%bloqu\u00e9%'\n THEN 5\n WHEN\n lower(\n coalesce((e.new -> 'status')::text, '')\n ) LIKE '%sortie de la vacance%'\n THEN 4\n END AS new_status,\n replace((e.new -> 'subStatus'), '\"', '')::text AS new_sub_status,\n e.name,\n CASE\n WHEN\n e.name = 'Changement de statut de suivi' THEN 'suivi'\n WHEN e.name = 'Modification du statut d''occupation' THEN 'occupation'\n WHEN e.name = 'Modification du statut' THEN 'statut'\n END AS simple_name,\n CASE\n WHEN\n (e.new -> 'status')::varchar != (e.old -> 'status')::varchar\n THEN TRUE\n ELSE FALSE\n END AS status_changed,\n replace((e.new -> 'status')::varchar, '\"', '') AS new_status_raw,\n replace((e.old -> 'status')::varchar, '\"', '') AS old_status_raw,\n CASE\n WHEN\n (e.new -> 'occupancy')::varchar != (e.old -> 'occupancy')::varchar\n THEN TRUE\n ELSE FALSE\n END AS occupancy_changed,\n replace((e.new -> 'occupancy')::varchar, '\"', '') AS new_occupancy,\n replace((e.old -> 'occupancy')::varchar, '\"', '') AS old_occupancy,\n 'new' AS version,\n category\nFROM {{ ref ('stg_production_events') }} e\nLEFT JOIN {{ ref ('stg_production_housing_events') }} he ON e.id = he.event_id", "language": "sql", "refs": [{"name": "stg_production_events", "package": null, "version": null}, {"name": "stg_production_housing_events", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_events", "model.zlv_dbt_project.stg_production_housing_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_users": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_users", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_users.sql", "original_file_path": "models/intermediate/production/int_production_establishments_users.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_users", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_users"], "alias": "int_production_establishments_users", "checksum": {"name": "sha256", "checksum": "8b356bd6f96ffa8951e8a91df91f89cdaa9958c17bb45aecb552051546c4b7cd"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.723928, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_users\"", "raw_code": "SELECT\n u.establishment_id,\n STRING_AGG(u.id) AS user_ids,\n STRING_AGG(u.email) AS user_emails,\n COUNT(*) AS user_number,\n MAX(activated_at) AS last_activated_at,\n MIN(activated_at) AS first_activated_at,\n MAX(last_authenticated_at) AS last_authenticated_at,\n CASE\n WHEN MAX(last_authenticated_at) > NOW() - INTERVAL '30 days' THEN TRUE\n ELSE FALSE\n END AS connected_last_30_days,\n CASE\n WHEN MAX(last_authenticated_at) > NOW() - INTERVAL '60 days' THEN TRUE\n ELSE FALSE\n END AS connected_last_60_days,\n CASE\n WHEN MAX(last_authenticated_at) > NOW() - INTERVAL '90 days' THEN TRUE\n ELSE FALSE\n END AS connected_last_90_days\nFROM {{ ref ('int_production_users') }} u\nGROUP BY u.establishment_id", "language": "sql", "refs": [{"name": "int_production_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishment_geo_code": {"database": "database_name", "schema": "main_int", "name": "int_production_establishment_geo_code", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishment_geo_code.sql", "original_file_path": "models/intermediate/production/int_production_establishment_geo_code.sql", "unique_id": "model.zlv_dbt_project.int_production_establishment_geo_code", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishment_geo_code"], "alias": "int_production_establishment_geo_code", "checksum": {"name": "sha256", "checksum": "fbe991ffe709fe28ff5b831de754e108ccb11c40a036400629304732e581e54d"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": "geo_code", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view", "unique_key": "geo_code"}, "created_at": 1736418959.724819, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishment_geo_code\"", "raw_code": "{{\nconfig (\nmaterialized = 'view',\nunique_key = 'geo_code',\n)\n}}\n\nSELECT\npel.geo_code,\nSUM (CASE WHEN peu.user_ids IS NOT NULL THEN 1 ELSE 0 END) as user_number,\nCOUNT (*) as establishment_number,\npel.geo_code [1: 2] as department_number,\nSTRING_AGG (DISTINCT pel.establishment_id, ', ') as establishment_ids,\n\nFROM {{ ref ('int_production_establishments_localities') }} pel\nLEFT JOIN {{ ref ('int_production_establishments_users') }} peu ON pel.establishment_id = peu.establishment_id\nGROUP BY geo_code", "language": "sql", "refs": [{"name": "int_production_establishments_localities", "package": null, "version": null}, {"name": "int_production_establishments_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_establishments_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_campaigns": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_campaigns", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_campaigns.sql", "original_file_path": "models/intermediate/production/int_production_establishments_campaigns.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_campaigns", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_campaigns"], "alias": "int_production_establishments_campaigns", "checksum": {"name": "sha256", "checksum": "f7d6f579d49b811058c8824e2727faf5287840a27cc60e9d30f9cdd02f802313"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.72618, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_campaigns\"", "raw_code": "SELECT\n pc.establishment_id,\n TRUE AS has_campaigns,\n COUNT(DISTINCT pc.id) AS total_campaigns,\n SUM(CASE WHEN pc.sent_at IS NOT NULL THEN 1 END) AS total_sent_campaigns,\n SUM(CASE WHEN pc.exported_at IS NOT NULL THEN 1 END)\n AS total_exported_campaigns,\n MAX(pc.created_at) AS last_campaign_created,\n MIN(pc.created_at) AS first_campaign_created,\n MAX(pc.is_creation_gt_30_days) AS is_creation_gt_30_days,\n MAX(pc.is_creation_lt_30_days) AS is_creation_lt_30_days\n\nFROM {{ ref ('int_production_campaigns') }} pc\nGROUP BY pc.establishment_id", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_events": {"database": "database_name", "schema": "main_int", "name": "int_production_events", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_events.sql", "original_file_path": "models/intermediate/production/int_production_events.sql", "unique_id": "model.zlv_dbt_project.int_production_events", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_events"], "alias": "int_production_events", "checksum": {"name": "sha256", "checksum": "3fe160611e11a126bf193a37349401bf50e1988c9ba116224adc6becae0acf29"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.115167, "relation_name": "\"database_name\".\"main_int\".\"int_production_events\"", "raw_code": "WITH all_events AS (\n SELECT\n id,\n created_at,\n created_by,\n housing_id,\n new_status,\n new_sub_status,\n name,\n simple_name,\n status_changed,\n new_status_raw,\n old_status_raw,\n occupancy_changed,\n new_occupancy,\n old_occupancy,\n version,\n category\n FROM\n {{ ref ('int_production_events_old') }}\n UNION DISTINCT\n SELECT\n id,\n created_at,\n created_by,\n housing_id,\n new_status,\n new_sub_status,\n name,\n simple_name,\n status_changed,\n new_status_raw,\n old_status_raw,\n occupancy_changed,\n new_occupancy,\n old_occupancy,\n version,\n category\n FROM\n {{ ref ('int_production_events_new') }}\n)\n\nSELECT\n ae.*,\n s.new AS event_status_label,\n coalesce(user_type, 'user') AS user_source\nFROM\n all_events ae\nLEFT JOIN {{ ref ('int_production_users') }} u ON ae.created_by = u.id\nLEFT JOIN {{ ref ('status') }} s ON s.status = ae.new_status", "language": "sql", "refs": [{"name": "int_production_events_old", "package": null, "version": null}, {"name": "int_production_events_new", "package": null, "version": null}, {"name": "int_production_users", "package": null, "version": null}, {"name": "status", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_events_old", "model.zlv_dbt_project.int_production_events_new", "model.zlv_dbt_project.int_production_users", "seed.zlv_dbt_project.status"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign": {"database": "database_name", "schema": "main_int", "name": "int_production_campaigns_stats_next_campaign", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_campaigns_stats_next_campaign.sql", "original_file_path": "models/intermediate/production/int_production_campaigns_stats_next_campaign.sql", "unique_id": "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_campaigns_stats_next_campaign"], "alias": "int_production_campaigns_stats_next_campaign", "checksum": {"name": "sha256", "checksum": "ffb28dcc5f91e1575da3ac873ee2f18acfbeebee085161e3f5015aa06f57383d"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.728344, "relation_name": "\"database_name\".\"main_int\".\"int_production_campaigns_stats_next_campaign\"", "raw_code": "WITH next_campaigns AS (\n SELECT\n pc.id AS campaign_id,\n pc.sent_at AS current_sent_at,\n pc.establishment_id,\n LEAD(pc.id)\n OVER (PARTITION BY pc.establishment_id ORDER BY pc.sent_at)\n AS next_campaign_id,\n LEAD(pc.sent_at)\n OVER (PARTITION BY pc.establishment_id ORDER BY pc.sent_at)\n AS next_sent_at\n FROM {{ ref ('int_production_campaigns') }} pc\n WHERE pc.sent_at IS NOT NULL\n),\n\nnext_campaign_check AS (\n SELECT\n pc.id,\n MIN(pc.sent_at) AS campaign_sent_at,\n MAX(next_campaigns.next_sent_at) AS next_campaign_sent_at,\n MAX(next_campaigns.next_sent_at)\n - MIN(pc.sent_at) AS time_to_next_campaign,\n {{ process_return_rate_with_next_campaign (3) }},\n {{ process_return_rate_with_next_campaign (6) }},\n {{ process_return_rate_with_next_campaign (9) }},\n {{ process_return_rate_with_next_campaign (36) }}\n FROM {{ ref ('int_production_campaigns') }} pc\n LEFT JOIN {{ ref ('int_production_campaigns_housing_count') }} cc ON cc.campaign_id = pc.id\n LEFT JOIN next_campaigns ON next_campaigns.campaign_id = pc.id\n JOIN {{ ref ('int_production_campaigns_housing') }} pch ON pch.campaign_id = pc.id\n JOIN {{ ref ('int_production_events') }} e ON e.housing_id = pch.housing_id\n AND e.created_at > pc.sent_at\n AND e.user_source = 'user'\n AND e.created_at < (pc.sent_at + INTERVAL '36 months')\n WHERE pc.sent_at IS NOT NULL\n GROUP BY pc.id\n)\n\nSELECT * FROM next_campaign_check", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing_count", "package": null, "version": null}, {"name": "int_production_campaigns_housing", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.process_return_rate_with_next_campaign"], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_campaigns_stats": {"database": "database_name", "schema": "main_int", "name": "int_production_campaigns_stats", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_campaigns_stats.sql", "original_file_path": "models/intermediate/production/int_production_campaigns_stats.sql", "unique_id": "model.zlv_dbt_project.int_production_campaigns_stats", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_campaigns_stats"], "alias": "int_production_campaigns_stats", "checksum": {"name": "sha256", "checksum": "081c5e21c9fd752912ef0f7e36749bd3882ce271f345a58eab5265e40fa46437"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.732175, "relation_name": "\"database_name\".\"main_int\".\"int_production_campaigns_stats\"", "raw_code": "SELECT\n pc.id,\n {{ process_return_rate_without_next_campaign(3) }},\n {{ process_return_rate_without_next_campaign(6) }},\n {{ process_return_rate_without_next_campaign(9) }},\n {{ process_return_rate_without_next_campaign(36) }}\nFROM {{ ref ('int_production_campaigns') }} pc\nLEFT JOIN {{ ref ('int_production_campaigns_housing_count') }} cc ON cc.campaign_id = pc.id\nJOIN {{ ref ('int_production_campaigns_housing') }} pch ON pch.campaign_id = pc.id\nJOIN {{ ref ('int_production_events') }} e ON e.housing_id = pch.housing_id\nAND e.created_at > pc.sent_at\nAND e.user_source = 'user'\nAND e.created_at < (pc.sent_at + INTERVAL '36 months')\nWHERE pc.sent_at IS NOT NULL\nGROUP BY pc.id", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing_count", "package": null, "version": null}, {"name": "int_production_campaigns_housing", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.process_return_rate_without_next_campaign"], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_owners": {"database": "database_name", "schema": "main_int", "name": "int_production_owners", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_owners.sql", "original_file_path": "models/intermediate/production/int_production_owners.sql", "unique_id": "model.zlv_dbt_project.int_production_owners", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_owners"], "alias": "int_production_owners", "checksum": {"name": "sha256", "checksum": "bc62e8076aca1e8074f85e619f0b5a3b664caf31bf69bf2d8dcde83f07f6663a"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.115647, "relation_name": "\"database_name\".\"main_int\".\"int_production_owners\"", "raw_code": "WITH first_address AS (\n SELECT\n po.*,\n address_dgfip[1] AS address_element\n FROM\n {{ ref ('stg_production_owners') }} po\n),\n\ncleaned_addresses AS (\n SELECT\n fa.*,\n regexp_replace(fa.address_element, '^\\{|\\}$', '') AS cleaned_address\n FROM\n first_address fa\n),\n\nsplit_addresses AS (\n SELECT\n ca.*,\n regexp_extract(ca.cleaned_address, '\\d{5}', 0) AS postal_code,\n regexp_extract(ca.cleaned_address, '[^\\d\\{]*$', 0) AS city,\n regexp_extract(ca.cleaned_address, '^[^{]*', 0) AS street_address\n FROM\n cleaned_addresses ca\n)\n\nSELECT\n *\nFROM\n split_addresses", "language": "sql", "refs": [{"name": "stg_production_owners", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_owners"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_campaigns": {"database": "database_name", "schema": "main_int", "name": "int_production_campaigns", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_campaigns.sql", "original_file_path": "models/intermediate/production/int_production_campaigns.sql", "unique_id": "model.zlv_dbt_project.int_production_campaigns", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_campaigns"], "alias": "int_production_campaigns", "checksum": {"name": "sha256", "checksum": "e0eb5b7ae1542a6f4adbc7b736f67229f446302c0233398dbaebfc860ec987e8"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.736491, "relation_name": "\"database_name\".\"main_int\".\"int_production_campaigns\"", "raw_code": "SELECT\n c.id AS campaign_id,\n *,\n CASE WHEN validated_at IS NOT NULL THEN 1 ELSE 0 END AS is_validated,\n CASE WHEN confirmed_at IS NOT NULL THEN 1 ELSE 0 END AS is_confirmed,\n CASE WHEN sent_at IS NOT NULL THEN 1 ELSE 0 END AS is_sent,\n CASE\n WHEN sent_at IS NULL AND created_at <= NOW() - INTERVAL '30 days' THEN 1\n ELSE 0\n END AS is_creation_gt_30_days,\n CASE\n WHEN sent_at IS NULL AND created_at > NOW() - INTERVAL '30 days' THEN 1\n ELSE 0\n END AS is_creation_lt_30_days\nFROM {{ ref ('stg_production_campaigns') }} as c", "language": "sql", "refs": [{"name": "stg_production_campaigns", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_campaigns"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishment_events_last_status": {"database": "database_name", "schema": "main_int", "name": "int_production_establishment_events_last_status", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishment_events_last_status.sql", "original_file_path": "models/intermediate/production/int_production_establishment_events_last_status.sql", "unique_id": "model.zlv_dbt_project.int_production_establishment_events_last_status", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishment_events_last_status"], "alias": "int_production_establishment_events_last_status", "checksum": {"name": "sha256", "checksum": "ee8dd488e1960ff4014aea57dfb34da9d76c05fff7878b4ba6a1728f7497f52b"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.737408, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishment_events_last_status\"", "raw_code": "WITH \n establishment_status_user_followup AS {{ get_last_establishment_event_status('user', 'suivi') }},\n establishment_status_user_occupancy AS {{ get_last_establishment_event_status('user', \"occupation\") }},\n last_establishment_status_user_followup AS {{ select_last_establishment_event(ref('int_production_establishments'), 'establishment_status_user_followup', 'user_followup') }},\n last_establishment_status_user_occupancy AS {{ select_last_establishment_event(ref('int_production_establishments'), 'establishment_status_user_occupancy', 'user_occupancy') }}\n\nSELECT\n e.id AS establishment_id,\n hsuf.last_event_status_user_followup,\n hsuf.last_event_status_label_user_followup,\n hsuf.last_event_date_user_followup,\n hsuf.last_event_sub_status_label_user_followup,\n hszo.last_event_occupancy_user_occupancy,\n hszo.last_event_date_user_occupancy\nFROM {{ ref('int_production_establishments') }} AS e\nLEFT JOIN last_establishment_status_user_followup AS hsuf ON e.id = hsuf.establishment_id\nLEFT JOIN last_establishment_status_user_occupancy AS hszo ON e.id = hszo.establishment_id", "language": "sql", "refs": [{"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_users", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_users", "package": null, "version": null}, {"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_establishments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.get_last_establishment_event_status", "macro.zlv_dbt_project.select_last_establishment_event"], "nodes": ["model.zlv_dbt_project.int_production_events", "model.zlv_dbt_project.int_production_users", "model.zlv_dbt_project.int_production_establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_campaigns_contacts": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_campaigns_contacts", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_campaigns_contacts.sql", "original_file_path": "models/intermediate/production/int_production_establishments_campaigns_contacts.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_campaigns_contacts"], "alias": "int_production_establishments_campaigns_contacts", "checksum": {"name": "sha256", "checksum": "7be8919555be18ae7d0d6bfb23b8957290445af8740e9455304d24237e5a86d2"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.742553, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_campaigns_contacts\"", "raw_code": "WITH establishment_campaign_contacts AS (\n SELECT\n pe.id AS establishment_id,\n date_part('year', pc.sent_at) AS year,\n count(*) AS contacted_housing,\n count(DISTINCT pch.housing_id) AS contacts_number\n FROM {{ ref ('int_production_establishments') }} pe\n LEFT JOIN {{ ref ('int_production_campaigns') }} pc ON pc.establishment_id = pe.id\n LEFT JOIN {{ ref ('int_production_campaigns_housing') }} pch ON pc.id = pch.campaign_id\n WHERE pc.sent_at IS NOT NULL\n GROUP BY pe.id, year\n),\n\nestablishment_followup AS (\n SELECT\n pe.id AS establishment_id,\n date_part('year', e.created_at) AS year,\n count(DISTINCT e.housing_id) AS contacted_housing_followup_ended,\n count(\n DISTINCT CASE\n WHEN new_sub_status = 'N''\u00e9tait pas vacant' THEN e.housing_id\n END\n ) AS contacted_housing_followup_ended_not_vacant\n\n FROM {{ ref ('int_production_establishments') }} pe\n LEFT JOIN {{ ref ('int_production_campaigns') }} pc ON pc.establishment_id = pe.id\n LEFT JOIN {{ ref ('int_production_campaigns_housing') }} pch ON pc.id = pch.campaign_id\n LEFT JOIN {{ ref ('int_production_events') }} e ON e.housing_id = pch.housing_id\n WHERE pc.sent_at IS NOT NULL\n AND event_status_label = 'Suivi termin\u00e9'\n AND user_source = 'user'\n GROUP BY pe.id, year\n),\n\nyearly_data AS (\n SELECT\n establishment_id,\n year,\n contacted_housing,\n contacts_number,\n contacted_housing_followup_ended,\n contacted_housing_followup_ended_not_vacant\n FROM establishment_campaign_contacts\n LEFT OUTER JOIN establishment_followup USING (establishment_id, year)\n)\n\nSELECT\n establishment_id,\n {{ pivot_columns_by_year (\n [\"contacted_housing\",\n \"contacts_number\",\n \"contacted_housing_followup_ended\",\n \"contacted_housing_followup_ended_not_vacant\"],\n [2020, 2021, 2022, 2023, 2024]\n ) }}\nFROM yearly_data\nGROUP BY establishment_id\nORDER BY establishment_id", "language": "sql", "refs": [{"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing", "package": null, "version": null}, {"name": "int_production_establishments", "package": null, "version": null}, {"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.pivot_columns_by_year"], "nodes": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments.sql", "original_file_path": "models/intermediate/production/int_production_establishments.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments"], "alias": "int_production_establishments", "checksum": {"name": "sha256", "checksum": "b336366d0f7b4710b28cb9fda492dc1159d8d1c2e63efecdaef8726e2a481d4c"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.115799, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments\"", "raw_code": "SELECT\n est.*,\n CASE\n WHEN est.kind = 'CA' THEN 'Communaut\u00e9 d''Agglom\u00e9ration'\n WHEN est.kind = 'CC' THEN 'Communaut\u00e9 des Communes'\n WHEN est.kind = 'CU' THEN 'Communaut\u00e9 Urbaine'\n WHEN est.kind = 'Commune' THEN 'Commune'\n WHEN est.kind = 'ME' THEN 'M\u00e9tropole'\n WHEN est.kind = 'DEP' THEN 'D\u00e9partement'\n WHEN est.kind = 'PETR' THEN 'P\u00f4le \u00c9quilibre Territorial'\n WHEN est.kind = 'REG' THEN 'R\u00e9gion'\n WHEN est.kind = 'SDED' THEN 'Service D\u00e9concentr\u00e9 D\u00e9partemental'\n WHEN est.kind = 'SDER' THEN 'Service D\u00e9concentr\u00e9 R\u00e9gional'\n WHEN est.kind = 'ASSO' THEN 'Association'\n ELSE 'Autre'\n END AS establishment_kind_label,\n CASE\n WHEN est.kind IN ('CA', 'CC', 'CU', 'ME') THEN 'Intercommunalit\u00e9'\n WHEN est.kind = 'Commune' THEN 'Commune'\n WHEN est.kind = 'DEP' THEN 'Autre'\n WHEN est.kind = 'PETR' THEN 'Autre'\n WHEN est.kind = 'REG' THEN 'Autre'\n WHEN est.kind = 'SDED' THEN 'DDT/M'\n WHEN est.kind = 'SDER' THEN 'Autre'\n WHEN est.kind = 'ASSO' THEN 'Autre'\n ELSE 'Autre'\n END AS establishment_synthetic_type_label,\n CASE\n WHEN est.kind IN ('SDED', 'SDER') THEN TRUE\n ELSE FALSE\n END AS covered_by_state_service\n\nFROM {{ ref ('stg_production_establishments') }} est", "language": "sql", "refs": [{"name": "stg_production_establishments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_users": {"database": "database_name", "schema": "main_int", "name": "int_production_users", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_users.sql", "original_file_path": "models/intermediate/production/int_production_users.sql", "unique_id": "model.zlv_dbt_project.int_production_users", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_users"], "alias": "int_production_users", "checksum": {"name": "sha256", "checksum": "61d7cb5147a9ec13955ccd286afd2886fa33a11fba8aa6e6c5f11173b276e50f"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.747861, "relation_name": "\"database_name\".\"main_int\".\"int_production_users\"", "raw_code": "SELECT\n u.*,\n CASE\n WHEN\n u.email LIKE '%beta.gouv.fr' THEN 'zlv'\n ELSE 'user'\n END AS user_type\nFROM {{ ref ('stg_production_users') }} u\nWHERE u.deleted_at IS NULL", "language": "sql", "refs": [{"name": "stg_production_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_housing": {"database": "database_name", "schema": "main_int", "name": "int_production_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_housing.sql", "original_file_path": "models/intermediate/production/int_production_housing.sql", "unique_id": "model.zlv_dbt_project.int_production_housing", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_housing"], "alias": "int_production_housing", "checksum": {"name": "sha256", "checksum": "8f035cae0d56b6dbe0ca9a14d97876cba4c8af9ac112f4bc536b61b68099d6d3"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.115327, "relation_name": "\"database_name\".\"main_int\".\"int_production_housing\"", "raw_code": "SELECT ph.*, c.city_code\nFROM {{ ref ('stg_production_housing') }} ph\nJOIN {{ ref ('int_common_cities_mapping') }} c ON ph.geo_code = c.geo_code", "language": "sql", "refs": [{"name": "stg_production_housing", "package": null, "version": null}, {"name": "int_common_cities_mapping", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_housing", "model.zlv_dbt_project.int_common_cities_mapping"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_housing_users": {"database": "database_name", "schema": "main_int", "name": "int_production_housing_users", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_housing_users.sql", "original_file_path": "models/intermediate/production/int_production_housing_users.sql", "unique_id": "model.zlv_dbt_project.int_production_housing_users", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_housing_users"], "alias": "int_production_housing_users", "checksum": {"name": "sha256", "checksum": "b7c602497cabae1a96b074674cebb351ab43e1aa701dd36959e73f31f7a77759"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "table"}, "created_at": 1736418960.116894, "relation_name": "\"database_name\".\"main_int\".\"int_production_housing_users\"", "raw_code": "{{\nconfig (\nmaterialized = 'table'\n)\n}}\nWITH deduplicated_pel AS (\nSELECT\nph.housing_id,\nUNNEST (ph.establishment_ids_array) AS establishment_id\nFROM {{ ref ('int_production_housing_establishments') }} ph\n)\nSELECT\npel.housing_id,\nCASE\nWHEN SUM (ph.user_number) > 0 THEN TRUE\nELSE FALSE\nEND AS has_users\nFROM deduplicated_pel AS pel\nLEFT JOIN {{ ref ('int_production_establishments_users') }} ph\nON ph.establishment_id = pel.establishment_id\n\nGROUP BY pel.housing_id", "language": "sql", "refs": [{"name": "int_production_housing_establishments", "package": null, "version": null}, {"name": "int_production_establishments_users", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_housing_establishments", "model.zlv_dbt_project.int_production_establishments_users"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_housing_establishments": {"database": "database_name", "schema": "main_int", "name": "int_production_housing_establishments", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_housing_establishments.sql", "original_file_path": "models/intermediate/production/int_production_housing_establishments.sql", "unique_id": "model.zlv_dbt_project.int_production_housing_establishments", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_housing_establishments"], "alias": "int_production_housing_establishments", "checksum": {"name": "sha256", "checksum": "ecc16335751093fcfb541f2239e83c0358461cc392f20e1349a90fad6ee3ae67"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "table"}, "created_at": 1736418960.117074, "relation_name": "\"database_name\".\"main_int\".\"int_production_housing_establishments\"", "raw_code": "{{\nconfig (\nmaterialized = 'table'\n)\n}}\nWITH deduplicated_pel AS (\nSELECT DISTINCT geo_code, establishment_id\nFROM {{ ref ('int_production_establishments_localities') }}\n),\nfiltered_ph AS (\nSELECT id AS housing_id, geo_code\nFROM {{ ref ('int_production_housing') }}\n)\nSELECT\nph.housing_id,\nSTRING_AGG (pel.establishment_id, ' | ') AS establishment_ids,\nARRAY_AGG (pel.establishment_id) AS establishment_ids_array\nFROM filtered_ph AS ph\nLEFT JOIN deduplicated_pel AS pel ON pel.geo_code = ph.geo_code\nGROUP BY ph.housing_id", "language": "sql", "refs": [{"name": "int_production_establishments_localities", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_campaigns_housing": {"database": "database_name", "schema": "main_int", "name": "int_production_campaigns_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_campaigns_housing.sql", "original_file_path": "models/intermediate/production/int_production_campaigns_housing.sql", "unique_id": "model.zlv_dbt_project.int_production_campaigns_housing", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_campaigns_housing"], "alias": "int_production_campaigns_housing", "checksum": {"name": "sha256", "checksum": "04b10343e3346e42b50105587161197c6cf8238a02910e4ba67d1753f15100c0"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.752095, "relation_name": "\"database_name\".\"main_int\".\"int_production_campaigns_housing\"", "raw_code": "SELECT * FROM {{ ref ('stg_production_campaigns_housing') }}", "language": "sql", "refs": [{"name": "stg_production_campaigns_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_campaigns_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_localities": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_localities", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_localities.sql", "original_file_path": "models/intermediate/production/int_production_establishments_localities.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_localities", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_localities"], "alias": "int_production_establishments_localities", "checksum": {"name": "sha256", "checksum": "6c26f56dfe250a704e2759550f912f604db50104cebd667fa9b5ff9e06fadab6"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.116104, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_localities\"", "raw_code": "WITH establishment_localities AS (\n SELECT\n pe.id AS establishment_id,\n UNNEST(pe.localities_geo_code) AS geo_code\n FROM {{ ref ('int_production_establishments') }} pe\n)\n\nSELECT\n el.establishment_id,\n el.geo_code\nFROM establishment_localities el", "language": "sql", "refs": [{"name": "int_production_establishments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_housing_groups": {"database": "database_name", "schema": "main_int", "name": "int_production_housing_groups", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_housing_groups.sql", "original_file_path": "models/intermediate/production/int_production_housing_groups.sql", "unique_id": "model.zlv_dbt_project.int_production_housing_groups", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_housing_groups"], "alias": "int_production_housing_groups", "checksum": {"name": "sha256", "checksum": "58799f56b14873a1d6ee8e5be087c76730f4aff1e52f9de833cdd15944ff5ec1"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.75396, "relation_name": "\"database_name\".\"main_int\".\"int_production_housing_groups\"", "raw_code": "SELECT\n phg.housing_id,\n COUNT(DISTINCT pg.id) AS total_groups,\n STRING_AGG(pg.title, ', ') AS group_titles,\n MIN(pg.created_at) AS first_group_created,\n MAX(pg.created_at) AS last_group_created,\n MIN(pg.exported_at) AS first_group_exported,\n MAX(pg.exported_at) AS last_group_exported\nFROM {{ ref ('stg_production_groups_housing') }} phg\nJOIN {{ ref ('stg_production_groups') }} pg ON phg.group_id = pg.id\nGROUP BY phg.housing_id", "language": "sql", "refs": [{"name": "stg_production_groups_housing", "package": null, "version": null}, {"name": "stg_production_groups", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_groups_housing", "model.zlv_dbt_project.stg_production_groups"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_groups": {"database": "database_name", "schema": "main_int", "name": "int_production_groups", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_groups.sql", "original_file_path": "models/intermediate/production/int_production_groups.sql", "unique_id": "model.zlv_dbt_project.int_production_groups", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_groups"], "alias": "int_production_groups", "checksum": {"name": "sha256", "checksum": "b424a6c72d4dee17110d4cd4849d3183055cd9ab264c093acd0b2db2f6ca1d50"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.754923, "relation_name": "\"database_name\".\"main_int\".\"int_production_groups\"", "raw_code": "SELECT\n pg.*\nFROM {{ ref ('stg_production_groups') }} pg", "language": "sql", "refs": [{"name": "stg_production_groups", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_groups"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_campaigns_stats_actions": {"database": "database_name", "schema": "main_int", "name": "int_production_campaigns_stats_actions", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_campaigns_stats_actions.sql", "original_file_path": "models/intermediate/production/int_production_campaigns_stats_actions.sql", "unique_id": "model.zlv_dbt_project.int_production_campaigns_stats_actions", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_campaigns_stats_actions"], "alias": "int_production_campaigns_stats_actions", "checksum": {"name": "sha256", "checksum": "f69a9effc8f79a69c8ffe4edc1cd259281c9fbd9c00be7d55ad175c32d6076c4"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.755818, "relation_name": "\"database_name\".\"main_int\".\"int_production_campaigns_stats_actions\"", "raw_code": "WITH base AS (\n SELECT\n pc.id,\n e.created_at AS global_date,\n CASE WHEN category = 'Followup' THEN e.created_at ELSE NULL END\n AS followup_date,\n CASE WHEN category = 'Ownership' THEN e.created_at ELSE NULL END\n AS ownership_date\n FROM {{ ref ('int_production_campaigns') }} pc\n JOIN {{ ref ('int_production_campaigns_housing') }} pch ON pch.campaign_id = pc.id\n JOIN {{ ref ('int_production_events') }} e ON e.housing_id = pch.housing_id\n AND e.created_at > pc.sent_at\n AND e.user_source = 'user'\n AND e.created_at < (pc.sent_at + INTERVAL '36 months')\n WHERE\n pc.sent_at IS NOT NULL\n\n)\n\nSELECT\n id,\n MIN(global_date) AS first_event_global_date,\n MAX(global_date) AS last_event_global_date,\n MIN(followup_date) AS first_event_followup_date,\n MAX(followup_date) AS last_event_followup_date,\n MIN(ownership_date) AS first_event_ownership_date,\n MAX(ownership_date) AS last_event_ownership_date\nFROM base\nGROUP BY id", "language": "sql", "refs": [{"name": "int_production_campaigns", "package": null, "version": null}, {"name": "int_production_campaigns_housing", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_events_old": {"database": "database_name", "schema": "main_int", "name": "int_production_events_old", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_events_old.sql", "original_file_path": "models/intermediate/production/int_production_events_old.sql", "unique_id": "model.zlv_dbt_project.int_production_events_old", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_events_old"], "alias": "int_production_events_old", "checksum": {"name": "sha256", "checksum": "3587129278756723a01659ff1d0138ae88d1dd940d1146a86d5e8af4d23c2e35"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.756789, "relation_name": "\"database_name\".\"main_int\".\"int_production_events_old\"", "raw_code": "WITH old_events AS (\n SELECT\n id,\n CAST(created_at AS DATE) AS created_at,\n created_by,\n old_events.housing_id,\n NULL AS old_status,\n NULL AS new_status_raw,\n NULL AS old_status_raw,\n CASE\n WHEN LOWER(content) LIKE '%jamais contact\u00e9%' THEN 0\n WHEN LOWER(content) LIKE '%non suivi%' THEN 0\n WHEN LOWER(content) LIKE '%en attente de retour%' THEN 1\n WHEN LOWER(content) LIKE '%premier contact%' THEN 2\n WHEN LOWER(content) LIKE '%suivi en cours%' THEN 3\n WHEN LOWER(content) LIKE '%non-vacant%' THEN 4\n WHEN LOWER(content) LIKE '%suivi termin\u00e9%' THEN 4\n WHEN LOWER(content) LIKE '%bloqu\u00e9%' THEN 5\n WHEN LOWER(content) LIKE '%sortie de la vacance%' THEN 4\n ELSE NULL\n END AS new_status,\n CASE\n WHEN LOWER(content) LIKE '%passage \u00e0 non-vacant%' THEN 'V'\n ELSE NULL\n END AS old_occupancy,\n CASE\n WHEN\n LOWER(content) LIKE '%passage \u00e0 non-vacant%'\n AND LOWER(content) LIKE '%propri\u00e9taire%' THEN 'P'\n WHEN\n LOWER(content) LIKE '%passage \u00e0 non-vacant%'\n AND (\n LOWER(content) LIKE '%lou\u00e9%'\n OR LOWER(content) LIKE '%location%'\n ) THEN 'L'\n WHEN LOWER(content) LIKE '%passage \u00e0 non-vacant%' THEN 'inconnu'\n ELSE NULL\n END AS new_occupancy,\n CASE\n WHEN\n LOWER(content) LIKE '%sortie de la vacance%'\n THEN 'Sortie de la vacance'\n WHEN\n LOWER(content) LIKE '%via accompagnement%'\n THEN 'Sortie de la vacance'\n WHEN\n LOWER(content) LIKE '%via intervention publique%'\n THEN 'Sortie de la vacance'\n WHEN\n LOWER(content) LIKE '%sans accompagnement%'\n THEN 'Sortie de la vacance'\n WHEN\n LOWER(content) LIKE '%absent du mill\u00e9sime suivant%'\n THEN 'Sortie de la vacance'\n WHEN LOWER(content) LIKE '%non-vacant%' THEN 'N''\u00e9tait pas vacant'\n WHEN LOWER(content) LIKE '%npai%' THEN 'NPAI'\n WHEN\n LOWER(content) LIKE '%vacance volontaire%'\n THEN 'Vacance volontaire du propri\u00e9taire'\n WHEN\n LOWER(content) LIKE '%mauvaise exp\u00e9rience locative%'\n THEN 'Vacance volontaire du propri\u00e9taire'\n WHEN\n LOWER(content) LIKE '%rejet formel de l''accompagnement%'\n THEN 'Vacance volontaire du propri\u00e9taire'\n WHEN\n LOWER(content) LIKE '%blocage juridique%'\n THEN 'Vacance involontaire li\u00e9 au propri\u00e9taire'\n WHEN\n LOWER(content) LIKE '%li\u00e9e au propri\u00e9taire%'\n THEN 'Vacance involontaire li\u00e9 au propri\u00e9taire'\n WHEN\n LOWER(content) LIKE '%projet qui n''aboutit pas%'\n THEN 'Vacance involontaire li\u00e9 au propri\u00e9taire'\n WHEN\n LOWER(content) LIKE '%mauvais \u00e9tat%'\n THEN 'Immeuble / Environnement'\n ELSE NULL\n END AS new_sub_status,\n content AS name,\n NULL AS simple_name,\n 'old' AS version,\n NULL AS category\n FROM\n {{ ref ('stg_production_old_events') }} AS old_events\n)\n\nSELECT\n *,\n CASE\n WHEN new_status IS NOT NULL THEN TRUE\n ELSE FALSE\n END AS status_changed,\n CASE\n WHEN new_occupancy IS NOT NULL THEN TRUE\n ELSE FALSE\n END AS occupancy_changed\nFROM\n old_events", "language": "sql", "refs": [{"name": "stg_production_old_events", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_production_old_events"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_groups": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_groups", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_groups.sql", "original_file_path": "models/intermediate/production/int_production_establishments_groups.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_groups", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_groups"], "alias": "int_production_establishments_groups", "checksum": {"name": "sha256", "checksum": "34da6b20b6249417ca6734be7f0bc59bd695fdecb7ddfb7fc2ef80501737019e"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7577631, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_groups\"", "raw_code": "SELECT\n pg.establishment_id,\n TRUE AS has_groups,\n COUNT(DISTINCT pg.id) AS total_groups,\n SUM(CASE WHEN pg.exported_at IS NOT NULL THEN 1 END)\n AS total_exported_groups,\n MAX(pg.created_at) AS last_group_created,\n MIN(pg.created_at) AS first_group_created\nFROM {{ ref ('int_production_groups') }} pg\nGROUP BY pg.establishment_id", "language": "sql", "refs": [{"name": "int_production_groups", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_groups"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_housing_last_status": {"database": "database_name", "schema": "main_int", "name": "int_production_housing_last_status", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_housing_last_status.sql", "original_file_path": "models/intermediate/production/int_production_housing_last_status.sql", "unique_id": "model.zlv_dbt_project.int_production_housing_last_status", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_housing_last_status"], "alias": "int_production_housing_last_status", "checksum": {"name": "sha256", "checksum": "f710bb55556ec42e301b45534465de276b77fa4f4b9f7a1e417b23741e8a878a"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.115492, "relation_name": "\"database_name\".\"main_int\".\"int_production_housing_last_status\"", "raw_code": "WITH\nhousing_status_zlv_followup AS {{ get_last_event_status ('zlv', 'suivi') }},\nhousing_status_user_followup AS {{ get_last_event_status ('user', 'suivi') }},\nhousing_status_all_followup AS {{ get_last_event_status (None,'suivi',true) }},\nhousing_status_zlv_occupancy AS {{ get_last_event_status ('zlv',\"occupation\") }},\nhousing_status_user_occupancy AS {{ get_last_event_status ('user',\"occupation\") }},\nhousing_status_all_occupancy AS {{ get_last_event_status (None,\"occupation\",true) }},\n\n-- Application de la macro pour s\u00e9lectionner la derni\u00e8re ligne pour chaque cat\u00e9gorie\n\nlast_housing_status_zlv_followup AS {{ select_last_event (ref('int_production_housing'),'housing_status_zlv_followup','zlv_followup') }},\nlast_housing_status_user_followup AS {{ select_last_event (ref('int_production_housing'),'housing_status_user_followup','user_followup') }},\nlast_housing_status_all_followup AS {{ select_last_event (ref('int_production_housing'),'housing_status_all_followup','followup') }},\nlast_housing_status_zlv_occupancy AS {{ select_last_event (ref('int_production_housing'),'housing_status_zlv_occupancy','zlv_occupancy') }},\nlast_housing_status_user_occupancy AS {{ select_last_event (ref('int_production_housing'),'housing_status_user_occupancy','user_occupancy') }},\nlast_housing_status_all_occupancy AS {{ select_last_event (ref('int_production_housing'),'housing_status_all_occupancy','occupancy') }}\n\nSELECT\nh.id AS housing_id,\nhszf.last_event_status_zlv_followup,\nhszf.last_event_status_label_zlv_followup,\nhszf.last_event_date_zlv_followup,\nhsuf.last_event_status_user_followup,\nhsuf.last_event_status_label_user_followup,\nhsuf.last_event_date_user_followup,\nhsuf.last_event_sub_status_label_user_followup,\nhsf.last_event_status_followup,\nhsf.last_event_status_label_followup,\nhsf.last_event_date_followup,\nhszo.last_event_status_zlv_occupancy,\nhszo.last_event_status_label_zlv_occupancy,\nhszo.last_event_date_zlv_occupancy,\nhsuo.last_event_status_user_occupancy,\nhsuo.last_event_status_label_user_occupancy,\nhsuo.last_event_date_user_occupancy,\nhsuo.last_event_sub_status_label_user_occupancy,\nhso.last_event_status_occupancy,\nhso.last_event_status_label_occupancy,\nhso.last_event_date_occupancy\nFROM {{ ref ('int_production_housing') }} AS h\nLEFT JOIN last_housing_status_zlv_followup AS hszf ON h.id = hszf.housing_id\nLEFT JOIN last_housing_status_user_followup AS hsuf ON h.id = hsuf.housing_id\nLEFT JOIN last_housing_status_all_followup AS hsf ON h.id = hsf.housing_id\nLEFT JOIN last_housing_status_zlv_occupancy AS hszo ON h.id = hszo.housing_id\nLEFT JOIN last_housing_status_user_occupancy AS hsuo ON h.id = hsuo.housing_id\nLEFT JOIN last_housing_status_all_occupancy AS hso ON h.id = hso.housing_id", "language": "sql", "refs": [{"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_events", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.get_last_event_status", "macro.zlv_dbt_project.select_last_event"], "nodes": ["model.zlv_dbt_project.int_production_events", "model.zlv_dbt_project.int_production_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_production_establishments_housing": {"database": "database_name", "schema": "main_int", "name": "int_production_establishments_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/production/int_production_establishments_housing.sql", "original_file_path": "models/intermediate/production/int_production_establishments_housing.sql", "unique_id": "model.zlv_dbt_project.int_production_establishments_housing", "fqn": ["zlv_dbt_project", "intermediate", "production", "int_production_establishments_housing"], "alias": "int_production_establishments_housing", "checksum": {"name": "sha256", "checksum": "36d9662482ba84774c18e0cde06c6d903ca1463c0deff0fc1f432627fd737514"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/production/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.115951, "relation_name": "\"database_name\".\"main_int\".\"int_production_establishments_housing\"", "raw_code": "SELECT\n establishment_id,\n h.id AS housing_id,\n h.geo_code\nFROM {{ ref ('int_production_establishments_localities') }} el\nJOIN {{ ref ('int_production_housing') }} h ON el.geo_code = h.geo_code", "language": "sql", "refs": [{"name": "int_production_establishments_localities", "package": null, "version": null}, {"name": "int_production_housing", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_housing"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_owners_dedup": {"database": "database_name", "schema": "main_int", "name": "int_ff_owners_dedup", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_owners_dedup.sql", "original_file_path": "models/intermediate/ff/int_ff_owners_dedup.sql", "unique_id": "model.zlv_dbt_project.int_ff_owners_dedup", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_owners_dedup"], "alias": "int_ff_owners_dedup", "checksum": {"name": "sha256", "checksum": "f2523a469f6acd9b5aa01e6204337e9b1af722546dc5cb98adc8cfa4f9530474"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Description de ce que fait le mod\u00e8le lovac, par exemple, analyse des locaux vacants.", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.117316, "relation_name": "\"database_name\".\"main_int\".\"int_ff_owners_dedup\"", "raw_code": "SELECT\n ff_owner_idpersonne,\n array_agg(ff_owner_idprodroit) AS ff_owner_idprodroit,\n array_agg(ff_owner_idprocpte) AS ff_owner_idprocpte,\n max(ff_owner_address_1) AS ff_owner_address_1,\n max(ff_owner_address_2) AS ff_owner_address_2,\n max(ff_owner_address_3) AS ff_owner_address_3,\n max(ff_owner_address_4) AS ff_owner_address_4,\n max(ff_owner_postal_code) AS ff_owner_postal_code,\n max(ff_owner_birth_date) AS ff_owner_birth_date,\n max(ff_owner_lastname) AS ff_owner_lastname,\n max(ff_owner_firstname) AS ff_owner_firstname,\n max(ff_owner_firstnames) AS ff_owner_firstnames,\n max(ff_owner_birth_lastname) AS ff_owner_birth_lastname,\n max(ff_owner_city) AS ff_owner_city,\n max(ff_owner_fullname) AS ff_owner_fullname,\n max(ff_locprop) AS ff_locprop,\n max(ff_locproptxt) AS ff_locproptxt,\n max(ff_owner_category) AS ff_owner_category,\n max(ff_owner_category_text) AS ff_owner_category_text\nFROM {{ ref ('stg_ff_owners') }}\nGROUP BY ff_owner_idpersonne", "language": "sql", "refs": [{"name": "stg_ff_owners", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_owners"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2019": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2019", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2019.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2019.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2019", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2019"], "alias": "int_ff_ext_2019", "checksum": {"name": "sha256", "checksum": "850b6b3db7c9a49758ce3d0a45dd41ecdcdb8e3f0db4d6685846f6b27e74f956"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.766582, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2019\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_ff_ext_2019') }}\nWHERE ff_dteloc IN ('1', '2')\nAND (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)", "language": "sql", "refs": [{"name": "stg_ff_ext_2019", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_ext_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_history_housing": {"database": "database_name", "schema": "main_int", "name": "int_ff_history_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_history_housing.sql", "original_file_path": "models/intermediate/ff/int_ff_history_housing.sql", "unique_id": "model.zlv_dbt_project.int_ff_history_housing", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_history_housing"], "alias": "int_ff_history_housing", "checksum": {"name": "sha256", "checksum": "1172eaccc03c51e25ff1962aa2326fdeadcd7bff4825d2ed73d8a52cd4a6c8b6"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.767476, "relation_name": "\"database_name\".\"main_int\".\"int_ff_history_housing\"", "raw_code": "WITH ff_history AS (\n SELECT ff_idlocal, 'ff-' || ff_millesime AS file_year\n FROM {{ ref ('int_ff_ext_2023') }}\n UNION ALL\n SELECT ff_idlocal, 'ff-' || ff_millesime AS file_year\n FROM {{ ref ('int_ff_ext_2022') }}\n UNION ALL\n SELECT ff_idlocal, 'ff-' || ff_millesime AS file_year\n FROM {{ ref ('int_ff_ext_2021') }}\n UNION ALL\n SELECT ff_idlocal, 'ff-' || ff_millesime AS file_year\n FROM {{ ref ('int_ff_ext_2020') }}\n UNION ALL\n SELECT ff_idlocal, 'ff-' || ff_millesime AS file_year\n FROM {{ ref ('int_ff_ext_2019') }}\n)\n\nSELECT\n ff_idlocal AS local_id,\n listagg(file_year, ',') AS file_years\nFROM ff_history\nGROUP BY local_id", "language": "sql", "refs": [{"name": "int_ff_ext_2023", "package": null, "version": null}, {"name": "int_ff_ext_2022", "package": null, "version": null}, {"name": "int_ff_ext_2021", "package": null, "version": null}, {"name": "int_ff_ext_2020", "package": null, "version": null}, {"name": "int_ff_ext_2019", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_ff_ext_2023", "model.zlv_dbt_project.int_ff_ext_2022", "model.zlv_dbt_project.int_ff_ext_2021", "model.zlv_dbt_project.int_ff_ext_2020", "model.zlv_dbt_project.int_ff_ext_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2020_geo_code": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2020_geo_code", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2020_geo_code.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2020_geo_code.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2020_geo_code", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2020_geo_code"], "alias": "int_ff_ext_2020_geo_code", "checksum": {"name": "sha256", "checksum": "d5dbcacdcaae7d4fe60778719665187a053d0c4a796973264922a4b25ee53d42"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7686641, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2020_geo_code\"", "raw_code": "SELECT geo_code, COUNT(*) AS nombre_logements\nFROM {{ ref ('int_ff_ext_2020') }}\nGROUP BY geo_code", "language": "sql", "refs": [{"name": "int_ff_ext_2020", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_ff_ext_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2023": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2023.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2023.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2023", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2023"], "alias": "int_ff_ext_2023", "checksum": {"name": "sha256", "checksum": "3212782380bed43385cf28dae3cb805de17c1474be64029ecce60050781f8a69"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.117484, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2023\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_ff_ext_2023') }}\nWHERE ff_dteloc IN ('1', '2')\nAND (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)", "language": "sql", "refs": [{"name": "stg_ff_ext_2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_ext_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2022": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2022", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2022.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2022.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2022", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2022"], "alias": "int_ff_ext_2022", "checksum": {"name": "sha256", "checksum": "a1d669d9ec31fdfe6afbbcf4479ea679c7f1123358b8c8b993292839e08933da"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.77053, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2022\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_ff_ext_2022') }}\nWHERE ff_dteloc IN ('1', '2')\nAND (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)", "language": "sql", "refs": [{"name": "stg_ff_ext_2022", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_ext_2022"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2020": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2020", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2020.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2020.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2020", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2020"], "alias": "int_ff_ext_2020", "checksum": {"name": "sha256", "checksum": "b146e719dcfa18bee28e7adb03f5fbb9c6284132ee8d89577e57956f98046a95"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.771432, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2020\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_ff_ext_2020') }}\nWHERE ff_dteloc IN ('1', '2')\nAND (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)", "language": "sql", "refs": [{"name": "stg_ff_ext_2020", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_ext_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2021": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2021", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2021.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2021.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2021", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2021"], "alias": "int_ff_ext_2021", "checksum": {"name": "sha256", "checksum": "c6410ef7b46c82f1f7ce558938e6e6a97f379ef369489aa4bf5813be9f4469b8"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.772334, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2021\"", "raw_code": "SELECT *\nFROM {{ ref ('stg_ff_ext_2021') }}\nWHERE ff_dteloc IN ('1', '2')\nAND (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)", "language": "sql", "refs": [{"name": "stg_ff_ext_2021", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_ext_2021"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_ff_ext_2023_geo_code": {"database": "database_name", "schema": "main_int", "name": "int_ff_ext_2023_geo_code", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/ff/int_ff_ext_2023_geo_code.sql", "original_file_path": "models/intermediate/ff/int_ff_ext_2023_geo_code.sql", "unique_id": "model.zlv_dbt_project.int_ff_ext_2023_geo_code", "fqn": ["zlv_dbt_project", "intermediate", "ff", "int_ff_ext_2023_geo_code"], "alias": "int_ff_ext_2023_geo_code", "checksum": {"name": "sha256", "checksum": "892aa7bc1be2512155eeee41d90e87a08fd8f82ee7e1586537c888a97cd47693"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://models/intermediate/ff/schema.yml", "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418960.117653, "relation_name": "\"database_name\".\"main_int\".\"int_ff_ext_2023_geo_code\"", "raw_code": "SELECT geo_code, COUNT(*) AS nombre_logements\nFROM {{ ref ('int_ff_ext_2023') }}\nGROUP BY geo_code", "language": "sql", "refs": [{"name": "int_ff_ext_2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_ff_ext_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_history_housing": {"database": "database_name", "schema": "main_int", "name": "int_lovac_history_housing", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_history_housing.sql", "original_file_path": "models/intermediate/lovac/int_lovac_history_housing.sql", "unique_id": "model.zlv_dbt_project.int_lovac_history_housing", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_history_housing"], "alias": "int_lovac_history_housing", "checksum": {"name": "sha256", "checksum": "0d27dc456109c8bb5aec35edddd1e0c6264c207eae72ab85303a0f9f27a64d78"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.77565, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_history_housing\"", "raw_code": "WITH lovac_history AS (\n SELECT local_id, 'lovac-' || data_year AS file_year, geo_code, data_year\n FROM {{ ref ('int_lovac_fil_2024') }}\n UNION ALL\n SELECT local_id, 'lovac-' || data_year AS file_year, geo_code, data_year\n FROM {{ ref ('int_lovac_fil_2023') }}\n UNION ALL\n SELECT local_id, 'lovac-' || data_year AS file_year, geo_code, data_year\n FROM {{ ref ('int_lovac_fil_2022') }}\n UNION ALL\n SELECT local_id, 'lovac-' || data_year AS file_year, geo_code, data_year\n FROM {{ ref ('int_lovac_fil_2021') }}\n UNION ALL\n SELECT local_id, 'lovac-' || data_year AS file_year, geo_code, data_year\n FROM {{ ref ('int_lovac_fil_2020') }}\n UNION ALL\n SELECT local_id, 'lovac-' || data_year AS file_year, geo_code, data_year\n FROM {{ ref ('int_lovac_fil_2019') }}\n)\n\nSELECT\n local_id,\n listagg(file_year, ',') AS file_years,\n (\n SELECT geo_code\n FROM lovac_history lh2\n WHERE lh2.local_id = lh.local_id\n ORDER BY lh2.data_year DESC\n LIMIT 1\n ) AS geo_code\nFROM lovac_history lh\nGROUP BY local_id", "language": "sql", "refs": [{"name": "int_lovac_fil_2024", "package": null, "version": null}, {"name": "int_lovac_fil_2023", "package": null, "version": null}, {"name": "int_lovac_fil_2022", "package": null, "version": null}, {"name": "int_lovac_fil_2021", "package": null, "version": null}, {"name": "int_lovac_fil_2020", "package": null, "version": null}, {"name": "int_lovac_fil_2019", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_lovac_fil_2024", "model.zlv_dbt_project.int_lovac_fil_2023", "model.zlv_dbt_project.int_lovac_fil_2022", "model.zlv_dbt_project.int_lovac_fil_2021", "model.zlv_dbt_project.int_lovac_fil_2020", "model.zlv_dbt_project.int_lovac_fil_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_geo_code": {"database": "database_name", "schema": "main_int", "name": "int_lovac_geo_code", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_geo_code.sql", "original_file_path": "models/intermediate/lovac/int_lovac_geo_code.sql", "unique_id": "model.zlv_dbt_project.int_lovac_geo_code", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_geo_code"], "alias": "int_lovac_geo_code", "checksum": {"name": "sha256", "checksum": "c8c629d4fe43b84af17b9d1a5cea11022ffb8fa26b674d0d02cb81fee60a4690"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7767308, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_geo_code\"", "raw_code": "WITH vacancies_2024 AS (\n SELECT\n geo_code,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year = 2023 THEN 1 END\n ) AS vac_2024_1an,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year = 2022 THEN 1 END\n ) AS vac_2024_2ans,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year <= 2021 THEN 1 END\n ) AS vac_2024_plus_2ans,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year >= 2022 THEN 1 END\n ) AS vac_2024_moins_2ans,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year = 2021 THEN 1 END\n ) AS vac_2024_3ans,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year <= 2020 THEN 1 END\n ) AS vac_2024_4ans_plus,\n COUNT(\n CASE WHEN data_year = 2024 AND vacancy_start_year = 2024 THEN 1 END\n ) AS vac_2024_moins_1an,\n COUNT(*) AS vac_2024_total\n FROM {{ ref ('int_lovac_ex_2024') }}\n GROUP BY geo_code\n),\n\nvacancies_2023 AS (\n SELECT\n geo_code,\n COUNT(\n CASE WHEN data_year = 2023 AND vacancy_start_year = 2022 THEN 1 END\n ) AS vac_2023_1an,\n COUNT(\n CASE WHEN data_year = 2023 AND vacancy_start_year = 2021 THEN 1 END\n ) AS vac_2023_2ans,\n COUNT(\n CASE WHEN data_year = 2023 AND vacancy_start_year = 2020 THEN 1 END\n ) AS vac_2023_3ans,\n COUNT(\n CASE WHEN data_year = 2023 AND vacancy_start_year <= 2019 THEN 1 END\n ) AS vac_2023_4ans_plus,\n COUNT(\n CASE WHEN data_year = 2023 AND vacancy_start_year = 2023 THEN 1 END\n ) AS vac_2023_moins_1an,\n COUNT(*) AS vac_2023_total\n FROM {{ ref ('int_lovac_ex_2023') }}\n GROUP BY geo_code\n),\n\nvacancies_2020 AS (\n SELECT\n geo_code,\n COUNT(\n CASE WHEN data_year = 2020 AND vacancy_start_year = 2019 THEN 1 END\n ) AS vac_2020_1an,\n COUNT(\n CASE WHEN data_year = 2020 AND vacancy_start_year = 2018 THEN 1 END\n ) AS vac_2020_2ans,\n COUNT(\n CASE WHEN data_year = 2020 AND vacancy_start_year = 2017 THEN 1 END\n ) AS vac_2020_3ans,\n COUNT(\n CASE WHEN data_year = 2020 AND vacancy_start_year <= 2016 THEN 1 END\n ) AS vac_2020_4ans_plus,\n COUNT(\n CASE WHEN data_year = 2020 AND vacancy_start_year = 2020 THEN 1 END\n ) AS vac_2020_moins_1an,\n COUNT(*) AS vac_2020_total\n FROM {{ ref ('int_lovac_ex_2020') }}\n GROUP BY geo_code\n),\n\nall_data AS (\n\n SELECT\n COALESCE(v2024.geo_code, v2023.geo_code) AS geo_code,\n COALESCE(v2024.vac_2024_moins_1an, 0) AS vac_2024_moins_1an,\n COALESCE(v2024.vac_2024_1an, 0) AS vac_2024_1an,\n COALESCE(v2024.vac_2024_2ans, 0) AS vac_2024_2ans,\n COALESCE(v2024.vac_2024_3ans, 0) AS vac_2024_3ans,\n COALESCE(v2024.vac_2024_4ans_plus, 0) AS vac_2024_4ans_plus,\n COALESCE(v2023.vac_2023_moins_1an, 0) AS vac_2023_moins_1an,\n COALESCE(v2023.vac_2023_1an, 0) AS vac_2023_1an,\n COALESCE(v2023.vac_2023_2ans, 0) AS vac_2023_2ans,\n COALESCE(v2023.vac_2023_3ans, 0) AS vac_2023_3ans,\n COALESCE(v2023.vac_2023_4ans_plus, 0) AS vac_2023_4ans_plus,\n COALESCE(v2023.vac_2023_total, 0) AS vac_2023_total,\n\n COALESCE(v2020.vac_2020_moins_1an, 0) AS vac_2020_moins_1an,\n COALESCE(v2020.vac_2020_1an, 0) AS vac_2020_1an,\n COALESCE(v2020.vac_2020_2ans, 0) AS vac_2020_2ans,\n COALESCE(v2020.vac_2020_3ans, 0) AS vac_2020_3ans,\n COALESCE(v2020.vac_2020_4ans_plus, 0) AS vac_2020_4ans_plus,\n\n COALESCE(v2020.vac_2020_total, 0) AS vac_2020_total,\n COALESCE(v2023.vac_2023_total, 0) AS vac_2023_total,\n COALESCE(v2024.vac_2024_total, 0) AS vac_2024_total,\n COALESCE(v2024.vac_2024_plus_2ans, 0) AS vac_2024_plus_2ans,\n COALESCE(v2024.vac_2024_moins_2ans, 0) AS vac_2024_moins_2ans\n FROM\n vacancies_2024 v2024\n FULL OUTER JOIN\n vacancies_2023 v2023\n ON\n v2024.geo_code = v2023.geo_code\n FULL OUTER JOIN\n vacancies_2020 v2020\n ON\n v2024.geo_code = v2020.geo_code\n)\n\nSELECT * FROM all_data\nWHERE geo_code IS NOT NULL", "language": "sql", "refs": [{"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}, {"name": "int_lovac_ex_2020", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_lovac_ex_2024", "model.zlv_dbt_project.int_lovac_ex_2023", "model.zlv_dbt_project.int_lovac_ex_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_fil_2019": {"database": "database_name", "schema": "main_int", "name": "int_lovac_fil_2019", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_fil_2019.sql", "original_file_path": "models/intermediate/lovac/int_lovac_fil_2019.sql", "unique_id": "model.zlv_dbt_project.int_lovac_fil_2019", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_fil_2019"], "alias": "int_lovac_fil_2019", "checksum": {"name": "sha256", "checksum": "102499fcdcbf4fef128ef3af510141e5ed81adf8e70e0658cdb1f6ab70342e70"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.777753, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_fil_2019\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2019') }}\n{{ filter_lovac(ccthp = True) }}", "language": "sql", "refs": [{"name": "stg_lovac_2019", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_fil_2024": {"database": "database_name", "schema": "main_int", "name": "int_lovac_fil_2024", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_fil_2024.sql", "original_file_path": "models/intermediate/lovac/int_lovac_fil_2024.sql", "unique_id": "model.zlv_dbt_project.int_lovac_fil_2024", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_fil_2024"], "alias": "int_lovac_fil_2024", "checksum": {"name": "sha256", "checksum": "483bcc770f3377dda58e60f68ffad3c1819dcda3718b510f557c7dfdf2392bf1"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7807438, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_fil_2024\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2024') }}\n{{ filter_lovac(ccthp = True) }}", "language": "sql", "refs": [{"name": "stg_lovac_2024", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2024"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_fil_2020": {"database": "database_name", "schema": "main_int", "name": "int_lovac_fil_2020", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_fil_2020.sql", "original_file_path": "models/intermediate/lovac/int_lovac_fil_2020.sql", "unique_id": "model.zlv_dbt_project.int_lovac_fil_2020", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_fil_2020"], "alias": "int_lovac_fil_2020", "checksum": {"name": "sha256", "checksum": "e711bccacb9cec9ca15b4a72a5ac46edc9127b0f60d4fe7bc3ed6840c137257e"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.7831511, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_fil_2020\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2020') }}\n{{ filter_lovac(ccthp = True) }}", "language": "sql", "refs": [{"name": "stg_lovac_2020", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_fil_2021": {"database": "database_name", "schema": "main_int", "name": "int_lovac_fil_2021", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_fil_2021.sql", "original_file_path": "models/intermediate/lovac/int_lovac_fil_2021.sql", "unique_id": "model.zlv_dbt_project.int_lovac_fil_2021", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_fil_2021"], "alias": "int_lovac_fil_2021", "checksum": {"name": "sha256", "checksum": "afeca988440e7a1220e9dbd71d9e6a56b9d7e65d370e2c47e86f42bfea445011"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.785511, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_fil_2021\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2021') }}\n{{ filter_lovac(ccthp = True) }}", "language": "sql", "refs": [{"name": "stg_lovac_2021", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2021"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_fil_2023": {"database": "database_name", "schema": "main_int", "name": "int_lovac_fil_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_fil_2023.sql", "original_file_path": "models/intermediate/lovac/int_lovac_fil_2023.sql", "unique_id": "model.zlv_dbt_project.int_lovac_fil_2023", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_fil_2023"], "alias": "int_lovac_fil_2023", "checksum": {"name": "sha256", "checksum": "c99bb5d6e5ced40e33e1e43f0a14cf0e76703fdefc62543fc8d10daafb848f3c"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.788414, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_fil_2023\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2023') }}\n{{ filter_lovac(ccthp = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_fil_2022": {"database": "database_name", "schema": "main_int", "name": "int_lovac_fil_2022", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_fil_2022.sql", "original_file_path": "models/intermediate/lovac/int_lovac_fil_2022.sql", "unique_id": "model.zlv_dbt_project.int_lovac_fil_2022", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_fil_2022"], "alias": "int_lovac_fil_2022", "checksum": {"name": "sha256", "checksum": "f09f87a3516a2e871a17b0f920ff9b0a290a3460bdbc1ba7f7e7e288e3fc59b5"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.790742, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_fil_2022\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2022') }}\n{{ filter_lovac(ccthp = True) }}", "language": "sql", "refs": [{"name": "stg_lovac_2022", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2022"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_ex_2024": {"database": "database_name", "schema": "main_int", "name": "int_lovac_ex_2024", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_ex_2024.sql", "original_file_path": "models/intermediate/lovac/int_lovac_ex_2024.sql", "unique_id": "model.zlv_dbt_project.int_lovac_ex_2024", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_ex_2024"], "alias": "int_lovac_ex_2024", "checksum": {"name": "sha256", "checksum": "b85926e3451fb3625fbcddac313cfa029cf1d574bd718522f391cc3c06a779d3"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.793055, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_ex_2024\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2024') }}\n{{ filter_lovac(ccthp = True, vacancy = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2024", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2024"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_ex_2019": {"database": "database_name", "schema": "main_int", "name": "int_lovac_ex_2019", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_ex_2019.sql", "original_file_path": "models/intermediate/lovac/int_lovac_ex_2019.sql", "unique_id": "model.zlv_dbt_project.int_lovac_ex_2019", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_ex_2019"], "alias": "int_lovac_ex_2019", "checksum": {"name": "sha256", "checksum": "9cba75caa66043ea3aa1232de61de9060be64093b778fb9dbab4674d6189f3d4"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.79543, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_ex_2019\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2019') }}\n{{ filter_lovac(ccthp = True, vacancy = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2019", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_ex_2022": {"database": "database_name", "schema": "main_int", "name": "int_lovac_ex_2022", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_ex_2022.sql", "original_file_path": "models/intermediate/lovac/int_lovac_ex_2022.sql", "unique_id": "model.zlv_dbt_project.int_lovac_ex_2022", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_ex_2022"], "alias": "int_lovac_ex_2022", "checksum": {"name": "sha256", "checksum": "a84a33f140303747dcfbdea59d3817880196b5e6cd2f8517da7d701682874326"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.797791, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_ex_2022\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2022') }}\n{{ filter_lovac(ccthp = True, vacancy = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2022", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2022"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_ex_2023": {"database": "database_name", "schema": "main_int", "name": "int_lovac_ex_2023", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_ex_2023.sql", "original_file_path": "models/intermediate/lovac/int_lovac_ex_2023.sql", "unique_id": "model.zlv_dbt_project.int_lovac_ex_2023", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_ex_2023"], "alias": "int_lovac_ex_2023", "checksum": {"name": "sha256", "checksum": "9e66b1c5d2f41770a9e4469897b2e29a927c989986b306fb0537411e2568d406"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.8007119, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_ex_2023\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2023') }}\n{{ filter_lovac(ccthp = True, vacancy = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_ex_2021": {"database": "database_name", "schema": "main_int", "name": "int_lovac_ex_2021", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_ex_2021.sql", "original_file_path": "models/intermediate/lovac/int_lovac_ex_2021.sql", "unique_id": "model.zlv_dbt_project.int_lovac_ex_2021", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_ex_2021"], "alias": "int_lovac_ex_2021", "checksum": {"name": "sha256", "checksum": "ff81abb470e2aecd9d0ba6b7e34f3c852f64ef95b2ccf178ff8179a7f8de192b"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.803036, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_ex_2021\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2021') }}\n{{ filter_lovac(ccthp = True, vacancy = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2021", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2021"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.zlv_dbt_project.int_lovac_ex_2020": {"database": "database_name", "schema": "main_int", "name": "int_lovac_ex_2020", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_ex_2020.sql", "original_file_path": "models/intermediate/lovac/int_lovac_ex_2020.sql", "unique_id": "model.zlv_dbt_project.int_lovac_ex_2020", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_ex_2020"], "alias": "int_lovac_ex_2020", "checksum": {"name": "sha256", "checksum": "1e89c968290ba343438307251c600d1b3561597ca57c894079abe079dec2332e"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736418959.805386, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_ex_2020\"", "raw_code": "SELECT * FROM {{ ref ('stg_lovac_2020') }}\n{{ filter_lovac(ccthp = True, vacancy = False) }}", "language": "sql", "refs": [{"name": "stg_lovac_2020", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.zlv_dbt_project.filter_lovac"], "nodes": ["model.zlv_dbt_project.stg_lovac_2020"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "analysis.zlv_dbt_project.ff23_lovac_local_id": {"database": "database_name", "schema": "main", "name": "ff23_lovac_local_id", "resource_type": "analysis", "package_name": "zlv_dbt_project", "path": "analysis/ff23_lovac_local_id.sql", "original_file_path": "analyses/ff23_lovac_local_id.sql", "unique_id": "analysis.zlv_dbt_project.ff23_lovac_local_id", "fqn": ["zlv_dbt_project", "analysis", "ff23_lovac_local_id"], "alias": "ff23_lovac_local_id", "checksum": {"name": "sha256", "checksum": "0516b9e73d67195d11351ec0acd50c860e9303dc6b953ed426940df6116daf1d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true}, "created_at": 1736418959.86302, "relation_name": null, "raw_code": "WITH ff AS (\n SELECT\n ff_idlocal,\n ff_ccthp AS occupation_ff23,\n ff_stoth AS surface,\n ff_dteloc AS nature\n FROM {{ source ('duckdb_raw', 'raw_ff_2023') }}\n WHERE\n (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)\n AND ff_ccthp ! = 'V'\n AND ff_dteloc IN (1, 2)\n),\n\nlovac_2022 AS (\n SELECT\n ff_idlocal,\n true AS vacant_lovac22,\n debutvacance,\n TRY_CAST(dvf_datemut AS DATE) AS mutation_date,\n dvf_libnatmut AS mutation_nature,\n dvf_valeurfonc AS mutation_value\n FROM {{ ref ('stg_lovac_2022') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2021 AS (\n SELECT\n ff_idlocal,\n true AS vacant_lovac21,\n debutvacance,\n TRY_CAST(dvf_datemut AS DATE) AS mutation_date,\n dvf_libnatmut AS mutation_nature,\n dvf_valeurfonc AS mutation_value\n FROM {{ ref ('stg_lovac_2021') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2020 AS (\n SELECT\n ff_idlocal,\n true AS vacant_lovac20,\n debutvacance,\n TRY_CAST(anmutation AS DATE) AS mutation_date,\n null AS mutation_nature,\n null AS mutation_value\n FROM {{ ref ('stg_lovac_2020') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2019 AS (\n SELECT\n ff_idlocal,\n true AS vacant_lovac19,\n debutvacance,\n TRY_CAST(anmutation AS DATE) AS mutation_date,\n null AS mutation_nature,\n null AS mutation_value\n FROM {{ ref ('stg_lovac_2019') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nvacancy_data AS (\n SELECT\n ff_idlocal,\n COALESCE(lovac_2022.vacant_lovac22, false) AS vacant_lovac22,\n COALESCE(lovac_2021.vacant_lovac21, false) AS vacant_lovac21,\n COALESCE(lovac_2020.vacant_lovac20, false) AS vacant_lovac20,\n COALESCE(lovac_2019.vacant_lovac19, false) AS vacant_lovac19,\n COALESCE(\n lovac_2022.debutvacance,\n lovac_2021.debutvacance,\n lovac_2020.debutvacance,\n lovac_2019.debutvacance\n ) AS debut_vacance,\n -- Mutation indicators for each year\n COALESCE(lovac_2022.mutation_date IS NOT null, false) AS mutation_22,\n COALESCE(lovac_2021.mutation_date IS NOT null, false) AS mutation_21,\n COALESCE(lovac_2020.mutation_date IS NOT null, false) AS mutation_20,\n COALESCE(lovac_2019.mutation_date IS NOT null, false) AS mutation_19,\n\n -- Cumulative mutation count across years\n (\n CASE WHEN lovac_2022.mutation_date IS NOT null THEN 1 ELSE 0 END +\n CASE WHEN lovac_2021.mutation_date IS NOT null THEN 1 ELSE 0 END +\n CASE WHEN lovac_2020.mutation_date IS NOT null THEN 1 ELSE 0 END +\n CASE WHEN lovac_2019.mutation_date IS NOT null THEN 1 ELSE 0 END)\n AS mutation_cumul,\n\n -- Last mutation information (most recent non-null mutation data)\n CASE\n WHEN\n COALESCE(\n lovac_2022.mutation_date,\n lovac_2021.mutation_date,\n lovac_2020.mutation_date,\n lovac_2019.mutation_date\n ) IS NOT null\n THEN true\n ELSE false\n END AS last_mutation,\n\n COALESCE(\n lovac_2022.mutation_date,\n lovac_2021.mutation_date,\n lovac_2020.mutation_date,\n lovac_2019.mutation_date\n ) AS last_mutation_date,\n COALESCE(lovac_2022.mutation_nature, lovac_2021.mutation_nature)\n AS last_mutation_nature,\n COALESCE(lovac_2022.mutation_value, lovac_2021.mutation_value)\n AS last_mutation_value\n FROM ff\n LEFT JOIN lovac_2022 USING (ff_idlocal)\n LEFT JOIN lovac_2021 USING (ff_idlocal)\n LEFT JOIN lovac_2020 USING (ff_idlocal)\n LEFT JOIN lovac_2019 USING (ff_idlocal)\n),\n\nall_data AS (\n SELECT\n ff.ff_idlocal,\n ff.occupation_ff23,\n vacancy_data.vacant_lovac22,\n vacancy_data.vacant_lovac21,\n vacancy_data.vacant_lovac20,\n vacancy_data.vacant_lovac19,\n vacancy_data.debut_vacance,\n vacancy_data.mutation_22,\n vacancy_data.mutation_21,\n vacancy_data.mutation_20,\n vacancy_data.mutation_19,\n vacancy_data.mutation_cumul,\n vacancy_data.last_mutation,\n vacancy_data.last_mutation_date,\n vacancy_data.last_mutation_nature,\n vacancy_data.last_mutation_value,\n ff.surface,\n ff.nature\n FROM ff\n LEFT JOIN vacancy_data ON ff.ff_idlocal = vacancy_data.ff_idlocal\n WHERE\n (\n vacant_lovac22 IS true\n OR vacant_lovac21 IS true\n OR vacant_lovac20 IS true\n OR vacant_lovac19 IS true\n )\n)\n\nSELECT * FROM all_data", "language": "sql", "refs": [{"name": "stg_lovac_2022", "package": null, "version": null}, {"name": "stg_lovac_2021", "package": null, "version": null}, {"name": "stg_lovac_2020", "package": null, "version": null}, {"name": "stg_lovac_2019", "package": null, "version": null}], "sources": [["duckdb_raw", "raw_ff_2023"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2023", "model.zlv_dbt_project.stg_lovac_2022", "model.zlv_dbt_project.stg_lovac_2021", "model.zlv_dbt_project.stg_lovac_2020", "model.zlv_dbt_project.stg_lovac_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac": {"database": "database_name", "schema": "main", "name": "marts_analysis_exit_flow_ff23_lovac", "resource_type": "analysis", "package_name": "zlv_dbt_project", "path": "analysis/marts_analysis_exit_flow_ff23_lovac.sql", "original_file_path": "analyses/marts_analysis_exit_flow_ff23_lovac.sql", "unique_id": "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac", "fqn": ["zlv_dbt_project", "analysis", "marts_analysis_exit_flow_ff23_lovac"], "alias": "marts_analysis_exit_flow_ff23_lovac", "checksum": {"name": "sha256", "checksum": "6bcd85207cafd3378571d8a0085afb2813cd9e0a87fa0a025edd42e584b1266b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true}, "created_at": 1736418959.869327, "relation_name": null, "raw_code": "WITH ff AS (\n SELECT\n ff_idlocal,\n ff_ccthp AS occupation_ff23,\n ff_stoth AS surface,\n ff_dteloc AS nature\n FROM {{ ref ('stg_ff_ext_2023') }}\n WHERE\n (ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9') OR ff_ccogrm IS NULL)\n AND ff_ccthp ! = 'V'\n AND ff_dteloc IN (1, 2)\n),\n\nlovac_2022 AS (\n SELECT\n local_id AS ff_idlocal,\n true AS vacant_lovac22,\n debutvacance,\n TRY_CAST(dvf_datemut AS DATE) AS mutation_date,\n dvf_libnatmut AS mutation_nature,\n dvf_valeurfonc AS mutation_value\n FROM {{ ref ('stg_lovac_2022') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2021 AS (\n SELECT\n local_id AS ff_idlocal,\n true AS vacant_lovac21,\n debutvacance,\n TRY_CAST(dvf_datemut AS DATE) AS mutation_date,\n dvf_libnatmut AS mutation_nature,\n dvf_valeurfonc AS mutation_value\n FROM {{ ref ('stg_lovac_2021') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2020 AS (\n SELECT\n local_id AS ff_idlocal,\n true AS vacant_lovac20,\n debutvacance,\n TRY_CAST(anmutation AS DATE) AS mutation_date,\n null AS mutation_nature,\n null AS mutation_value\n FROM {{ ref ('stg_lovac_2020') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2019 AS (\n SELECT\n local_id AS ff_idlocal,\n true AS vacant_lovac19,\n debutvacance,\n TRY_CAST(anmutation AS DATE) AS mutation_date,\n null AS mutation_nature,\n null AS mutation_value\n FROM {{ ref ('stg_lovac_2019') }}\n WHERE 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nvacancy_data AS (\n SELECT\n ff_idlocal,\n COALESCE(lovac_2022.vacant_lovac22, false) AS vacant_lovac22,\n COALESCE(lovac_2021.vacant_lovac21, false) AS vacant_lovac21,\n COALESCE(lovac_2020.vacant_lovac20, false) AS vacant_lovac20,\n COALESCE(lovac_2019.vacant_lovac19, false) AS vacant_lovac19,\n COALESCE(\n lovac_2022.debutvacance,\n lovac_2021.debutvacance,\n lovac_2020.debutvacance,\n lovac_2019.debutvacance\n ) AS debut_vacance,\n -- Mutation indicators for each year\n COALESCE(lovac_2022.mutation_date IS NOT null, false) AS mutation_22,\n COALESCE(lovac_2021.mutation_date IS NOT null, false) AS mutation_21,\n COALESCE(lovac_2020.mutation_date IS NOT null, false) AS mutation_20,\n COALESCE(lovac_2019.mutation_date IS NOT null, false) AS mutation_19,\n\n -- Cumulative mutation count across years\n (\n CASE WHEN lovac_2022.mutation_date IS NOT null THEN 1 ELSE 0 END +\n CASE WHEN lovac_2021.mutation_date IS NOT null THEN 1 ELSE 0 END +\n CASE WHEN lovac_2020.mutation_date IS NOT null THEN 1 ELSE 0 END +\n CASE WHEN lovac_2019.mutation_date IS NOT null THEN 1 ELSE 0 END)\n AS mutation_cumul,\n\n -- Last mutation information (most recent non-null mutation data)\n CASE\n WHEN\n COALESCE(\n lovac_2022.mutation_date,\n lovac_2021.mutation_date,\n lovac_2020.mutation_date,\n lovac_2019.mutation_date\n ) IS NOT null\n THEN true\n ELSE false\n END AS last_mutation,\n\n COALESCE(\n lovac_2022.mutation_date,\n lovac_2021.mutation_date,\n lovac_2020.mutation_date,\n lovac_2019.mutation_date\n ) AS last_mutation_date,\n COALESCE(lovac_2022.mutation_nature, lovac_2021.mutation_nature)\n AS last_mutation_nature,\n COALESCE(lovac_2022.mutation_value, lovac_2021.mutation_value)\n AS last_mutation_value\n FROM ff\n LEFT JOIN lovac_2022 USING (ff_idlocal)\n LEFT JOIN lovac_2021 USING (ff_idlocal)\n LEFT JOIN lovac_2020 USING (ff_idlocal)\n LEFT JOIN lovac_2019 USING (ff_idlocal)\n),\n\nall_data AS (\n SELECT\n ff.ff_idlocal,\n ff.occupation_ff23,\n vacancy_data.vacant_lovac22,\n vacancy_data.vacant_lovac21,\n vacancy_data.vacant_lovac20,\n vacancy_data.vacant_lovac19,\n vacancy_data.debut_vacance,\n vacancy_data.mutation_22,\n vacancy_data.mutation_21,\n vacancy_data.mutation_20,\n vacancy_data.mutation_19,\n vacancy_data.mutation_cumul,\n vacancy_data.last_mutation,\n vacancy_data.last_mutation_date,\n vacancy_data.last_mutation_nature,\n vacancy_data.last_mutation_value,\n ff.surface,\n ff.nature\n FROM ff\n LEFT JOIN vacancy_data ON ff.ff_idlocal = vacancy_data.ff_idlocal\n WHERE\n (\n vacant_lovac22 IS true\n OR vacant_lovac21 IS true\n OR vacant_lovac20 IS true\n OR vacant_lovac19 IS true\n )\n)\n\nSELECT * FROM all_data", "language": "sql", "refs": [{"name": "stg_ff_ext_2023", "package": null, "version": null}, {"name": "stg_lovac_2022", "package": null, "version": null}, {"name": "stg_lovac_2021", "package": null, "version": null}, {"name": "stg_lovac_2020", "package": null, "version": null}, {"name": "stg_lovac_2019", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.stg_ff_ext_2023", "model.zlv_dbt_project.stg_lovac_2022", "model.zlv_dbt_project.stg_lovac_2021", "model.zlv_dbt_project.stg_lovac_2020", "model.zlv_dbt_project.stg_lovac_2019"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "analysis.zlv_dbt_project.ff23_lovac_occupation": {"database": "database_name", "schema": "main", "name": "ff23_lovac_occupation", "resource_type": "analysis", "package_name": "zlv_dbt_project", "path": "analysis/ff23_lovac_occupation.sql", "original_file_path": "analyses/ff23_lovac_occupation.sql", "unique_id": "analysis.zlv_dbt_project.ff23_lovac_occupation", "fqn": ["zlv_dbt_project", "analysis", "ff23_lovac_occupation"], "alias": "ff23_lovac_occupation", "checksum": {"name": "sha256", "checksum": "4acc1454a2c7ee6135080363556932b4ac89339dbafbc0eb479f3cb00ea99e25"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true}, "created_at": 1736418959.8721752, "relation_name": null, "raw_code": "WITH ff AS (\n SELECT\n ff_idlocal,\n ff_ccthp AS occupation_ff23,\n ff_stoth AS surface,\n ff_dteloc AS nature\n FROM raw_ff_2023\n WHERE\n (\n ff_ccogrm NOT IN ('1', '2', '3', '4', '5', '6', '9')\n OR ff_ccogrm IS NULL\n )\n AND ff_ccthp != 'V'\n AND ff_dteloc IN (1, 2)\n),\n\nlovac_2022 AS (\n SELECT\n local_id AS ff_idlocal,\n TRUE AS vacant_lovac22,\n debutvacance,\n TRY_CAST(dvf_datemut AS DATE) AS mutation_date,\n dvf_libnatmut AS mutation_nature,\n dvf_valeurfonc AS mutation_value\n FROM main_stg.stg_lovac_2022\n WHERE\n 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe IS NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2021 AS (\n SELECT\n local_id AS ff_idlocal,\n TRUE AS vacant_lovac21,\n debutvacance,\n TRY_CAST(dvf_datemut AS DATE) AS mutation_date,\n dvf_libnatmut AS mutation_nature,\n dvf_valeurfonc AS mutation_value\n FROM main_stg.stg_lovac_2021\n WHERE\n 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe IS NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2020 AS (\n SELECT\n local_id AS ff_idlocal,\n TRUE AS vacant_lovac20,\n debutvacance,\n TRY_CAST(anmutation AS DATE) AS mutation_date,\n NULL AS mutation_nature,\n NULL AS mutation_value\n FROM main_stg.stg_lovac_2020\n WHERE\n 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe IS NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nlovac_2019 AS (\n SELECT\n local_id AS ff_idlocal,\n TRUE AS vacant_lovac19,\n debutvacance,\n TRY_CAST(anmutation AS DATE) AS mutation_date,\n NULL AS mutation_nature,\n NULL AS mutation_value\n FROM main_stg.stg_lovac_2019\n WHERE\n 1 = 1\n AND ff_ccthp IN ('V')\n AND vacancy_start_year < data_year - 2\n AND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe IS NULL)\n AND aff = 'H'\n AND housing_kind IN ('APPART', 'MAISON')\n AND local_id IS NOT NULL\n),\n\nvacancy_data AS (\n SELECT\n ff_idlocal,\n COALESCE(lovac_2022.vacant_lovac22, FALSE) AS vacant_lovac22,\n COALESCE(lovac_2021.vacant_lovac21, FALSE) AS vacant_lovac21,\n COALESCE(lovac_2020.vacant_lovac20, FALSE) AS vacant_lovac20,\n COALESCE(lovac_2019.vacant_lovac19, FALSE) AS vacant_lovac19,\n COALESCE(\n lovac_2022.debutvacance,\n lovac_2021.debutvacance,\n lovac_2020.debutvacance,\n lovac_2019.debutvacance\n ) AS debut_vacance,\n -- Mutation indicators for each year\n COALESCE(lovac_2022.mutation_date IS NOT NULL, FALSE) AS mutation_22,\n COALESCE(lovac_2021.mutation_date IS NOT NULL, FALSE) AS mutation_21,\n COALESCE(lovac_2020.mutation_date IS NOT NULL, FALSE) AS mutation_20,\n COALESCE(lovac_2019.mutation_date IS NOT NULL, FALSE) AS mutation_19,\n\n -- Cumulative mutation count across years\n (\n CASE WHEN lovac_2022.mutation_date IS NOT NULL THEN 1 ELSE 0 END +\n CASE WHEN lovac_2021.mutation_date IS NOT NULL THEN 1 ELSE 0 END +\n CASE WHEN lovac_2020.mutation_date IS NOT NULL THEN 1 ELSE 0 END +\n CASE WHEN lovac_2019.mutation_date IS NOT NULL THEN 1 ELSE 0 END)\n AS mutation_cumul,\n\n -- Last mutation information (most recent non-null mutation data)\n CASE\n WHEN\n COALESCE(\n lovac_2022.mutation_date,\n lovac_2021.mutation_date,\n lovac_2020.mutation_date,\n lovac_2019.mutation_date\n ) IS NOT NULL\n THEN TRUE\n ELSE FALSE\n END AS last_mutation,\n\n COALESCE(\n lovac_2022.mutation_date,\n lovac_2021.mutation_date,\n lovac_2020.mutation_date,\n lovac_2019.mutation_date\n ) AS last_mutation_date,\n COALESCE(lovac_2022.mutation_nature, lovac_2021.mutation_nature)\n AS last_mutation_nature,\n COALESCE(lovac_2022.mutation_value, lovac_2021.mutation_value)\n AS last_mutation_value\n FROM ff\n LEFT JOIN lovac_2022 USING (ff_idlocal)\n LEFT JOIN lovac_2021 USING (ff_idlocal)\n LEFT JOIN lovac_2020 USING (ff_idlocal)\n LEFT JOIN lovac_2019 USING (ff_idlocal)\n),\n\nall_data AS (\n SELECT\n ff.ff_idlocal,\n ff.occupation_ff23,\n vacancy_data.vacant_lovac22,\n vacancy_data.vacant_lovac21,\n vacancy_data.vacant_lovac20,\n vacancy_data.vacant_lovac19,\n vacancy_data.debut_vacance,\n vacancy_data.mutation_22,\n vacancy_data.mutation_21,\n vacancy_data.mutation_20,\n vacancy_data.mutation_19,\n vacancy_data.mutation_cumul,\n vacancy_data.last_mutation,\n vacancy_data.last_mutation_date,\n vacancy_data.last_mutation_nature,\n vacancy_data.last_mutation_value,\n ff.surface,\n ff.nature\n FROM ff\n LEFT JOIN vacancy_data ON ff.ff_idlocal = vacancy_data.ff_idlocal\n WHERE\n (\n vacant_lovac22 IS TRUE\n OR vacant_lovac21 IS TRUE\n OR vacant_lovac20 IS TRUE\n OR vacant_lovac19 IS TRUE\n )\n),\n\nbase_data AS (\n SELECT\n ff.ff_idlocal,\n ff.occupation_ff23 AS occupation,\n vacancy_data.vacant_lovac22,\n vacancy_data.vacant_lovac21,\n vacancy_data.vacant_lovac20,\n vacancy_data.vacant_lovac19,\n vacancy_data.last_mutation,\n vacancy_data.last_mutation_value,\n ff.surface AS surface_hab\n FROM ff\n LEFT JOIN vacancy_data ON ff.ff_idlocal = vacancy_data.ff_idlocal\n)\n\nSELECT\n occupation AS ff_ccthp,\n\n -- Quantit\u00e9 totale de logements par typologie d'occupation\n COUNT(*) AS logements,\n\n -- Ratio des logements dans le stock d\u2019occupation autre que vacant\n COUNT(*)\n * 1.0\n / NULLIF(SUM(CASE WHEN occupation != 'vacant' THEN 1 ELSE 0 END), 0)\n AS ratio,\n\n -- Quantit\u00e9 et part des logements vacants pour chaque ann\u00e9e lovac\n SUM(CASE WHEN vacant_lovac22 THEN 1 ELSE 0 END) AS from_lovac22_total,\n SUM(CASE WHEN vacant_lovac22 THEN 1 ELSE 0 END)\n * 1.0\n / NULLIF(COUNT(*), 0) AS from_lovac22_ratio,\n\n SUM(CASE WHEN vacant_lovac21 THEN 1 ELSE 0 END) AS from_lovac21_total,\n SUM(CASE WHEN vacant_lovac21 THEN 1 ELSE 0 END)\n * 1.0\n / NULLIF(COUNT(*), 0) AS from_lovac21_ratio,\n\n SUM(CASE WHEN vacant_lovac20 THEN 1 ELSE 0 END) AS from_lovac20_total,\n SUM(CASE WHEN vacant_lovac20 THEN 1 ELSE 0 END)\n * 1.0\n / NULLIF(COUNT(*), 0) AS from_lovac20_ratio,\n\n SUM(CASE WHEN vacant_lovac19 THEN 1 ELSE 0 END) AS from_lovac19_total,\n SUM(CASE WHEN vacant_lovac19 THEN 1 ELSE 0 END)\n * 1.0\n / NULLIF(COUNT(*), 0) AS from_lovac19_ratio,\n\n -- Total et ratio des logements ayant une mutation\n SUM(CASE WHEN last_mutation THEN 1 ELSE 0 END) AS mutations_total,\n SUM(CASE WHEN last_mutation THEN 1 ELSE 0 END)\n * 1.0\n / NULLIF(COUNT(*), 0) AS mutations_ratio,\n\n -- Valeur moyenne et m\u00e9diane des mutations pour les logements ayant une valeur de mutation non vide\n AVG(last_mutation_value) FILTER (WHERE last_mutation_value IS NOT NULL)\n AS mutations_value_average,\n PERCENTILE_CONT(0.5)\n AS within\n GROUP (ORDER BY last_mutation_value) FILTER (WHERE last_mutation_value IS NOT NULL) AS mutations_value_mediane,\n\n -- Surface moyenne et m\u00e9diane des logements\n AVG (surface_hab) AS surface_average,\n PERCENTILE_CONT (0.5) WITHIN GROUP (ORDER BY surface_hab) AS surface_mediane\n\nFROM base_data\nGROUP BY occupation;", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "seed.zlv_dbt_project.departements_france": {"database": "database_name", "schema": "main_common", "name": "departements_france", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "departements_france.csv", "original_file_path": "seeds/departements_france.csv", "unique_id": "seed.zlv_dbt_project.departements_france", "fqn": ["zlv_dbt_project", "departements_france"], "alias": "departements_france", "checksum": {"name": "sha256", "checksum": "239213e2b78ce0e6ae890fc06ff4a85d3eefa8ac413df20da5a3494f6bd9bacc"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"schema": "common"}, "created_at": 1736418959.939383, "relation_name": "\"database_name\".\"main_common\".\"departements_france\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.direction_territoriale": {"database": "database_name", "schema": "main_common", "name": "direction_territoriale", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "direction_territoriale.csv", "original_file_path": "seeds/direction_territoriale.csv", "unique_id": "seed.zlv_dbt_project.direction_territoriale", "fqn": ["zlv_dbt_project", "direction_territoriale"], "alias": "direction_territoriale", "checksum": {"name": "sha256", "checksum": "305bd8b20cb468629d385d07493933182d0008f10692d9ef00938011c69eba9a"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ";", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ";"}, "created_at": 1736418960.134586, "relation_name": "\"database_name\".\"main_common\".\"direction_territoriale\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.tlv_cities": {"database": "database_name", "schema": "main_common", "name": "tlv_cities", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "tlv_cities.csv", "original_file_path": "seeds/tlv_cities.csv", "unique_id": "seed.zlv_dbt_project.tlv_cities", "fqn": ["zlv_dbt_project", "tlv_cities"], "alias": "tlv_cities", "checksum": {"name": "sha256", "checksum": "68fda1dba6756ed39e65787d644cca0fb9df6ffec9d40ea00c65461171f0f8dc"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ";", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ";", "+header": true}, "created_at": 1736418960.136051, "relation_name": "\"database_name\".\"main_common\".\"tlv_cities\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.status": {"database": "database_name", "schema": "main_common", "name": "status", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "status.csv", "original_file_path": "seeds/status.csv", "unique_id": "seed.zlv_dbt_project.status", "fqn": ["zlv_dbt_project", "status"], "alias": "status", "checksum": {"name": "sha256", "checksum": "05e1d0b9282016efe5f8ea456b4c34b33522c603ab565f30e9db60160bceaff7"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"schema": "common"}, "created_at": 1736418959.943049, "relation_name": "\"database_name\".\"main_common\".\"status\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.prenom": {"database": "database_name", "schema": "main_common", "name": "prenom", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "prenom.csv", "original_file_path": "seeds/prenom.csv", "unique_id": "seed.zlv_dbt_project.prenom", "fqn": ["zlv_dbt_project", "prenom"], "alias": "prenom", "checksum": {"name": "path", "checksum": "seeds/prenom.csv"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ","}, "created_at": 1736418960.1353421, "relation_name": "\"database_name\".\"main_common\".\"prenom\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.ngeo-anct-cog2023": {"database": "database_name", "schema": "main_common", "name": "ngeo-anct-cog2023", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "ngeo-anct-cog2023.csv", "original_file_path": "seeds/ngeo-anct-cog2023.csv", "unique_id": "seed.zlv_dbt_project.ngeo-anct-cog2023", "fqn": ["zlv_dbt_project", "ngeo-anct-cog2023"], "alias": "ngeo-anct-cog2023", "checksum": {"name": "path", "checksum": "seeds/ngeo-anct-cog2023.csv"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "+header": true}, "created_at": 1736418960.139244, "relation_name": "\"database_name\".\"main_common\".\"ngeo-anct-cog2023\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.com_epci_dep_reg": {"database": "database_name", "schema": "main_common", "name": "com_epci_dep_reg", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "com_epci_dep_reg.csv", "original_file_path": "seeds/com_epci_dep_reg.csv", "unique_id": "seed.zlv_dbt_project.com_epci_dep_reg", "fqn": ["zlv_dbt_project", "com_epci_dep_reg"], "alias": "com_epci_dep_reg", "checksum": {"name": "path", "checksum": "seeds/com_epci_dep_reg.csv"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ";", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ";"}, "created_at": 1736418960.1321752, "relation_name": "\"database_name\".\"main_common\".\"com_epci_dep_reg\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.table_appartenance_geo_communes_2024": {"database": "database_name", "schema": "main_common", "name": "table_appartenance_geo_communes_2024", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "table_appartenance_geo_communes_2024.csv", "original_file_path": "seeds/table_appartenance_geo_communes_2024.csv", "unique_id": "seed.zlv_dbt_project.table_appartenance_geo_communes_2024", "fqn": ["zlv_dbt_project", "table_appartenance_geo_communes_2024"], "alias": "table_appartenance_geo_communes_2024", "checksum": {"name": "path", "checksum": "seeds/table_appartenance_geo_communes_2024.csv"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ",", "+header": true}, "created_at": 1736418960.14128, "relation_name": "\"database_name\".\"main_common\".\"table_appartenance_geo_communes_2024\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.cities": {"database": "database_name", "schema": "main_common", "name": "cities", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "cities.csv", "original_file_path": "seeds/cities.csv", "unique_id": "seed.zlv_dbt_project.cities", "fqn": ["zlv_dbt_project", "cities"], "alias": "cities", "checksum": {"name": "path", "checksum": "seeds/cities.csv"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ",", "+header": true}, "created_at": 1736418960.1372721, "relation_name": "\"database_name\".\"main_common\".\"cities\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.fusions": {"database": "database_name", "schema": "main_common", "name": "fusions", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "fusions.csv", "original_file_path": "seeds/fusions.csv", "unique_id": "seed.zlv_dbt_project.fusions", "fqn": ["zlv_dbt_project", "fusions"], "alias": "fusions", "checksum": {"name": "sha256", "checksum": "ebc414c53d5291816eeffc35671e24ddbdfa548a74adb7d32fe98ebc575d69b5"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "Fusions de communes", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ",", "+header": true}, "created_at": 1736418960.141975, "relation_name": "\"database_name\".\"main_common\".\"fusions\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.scissions": {"database": "database_name", "schema": "main_common", "name": "scissions", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "scissions.csv", "original_file_path": "seeds/scissions.csv", "unique_id": "seed.zlv_dbt_project.scissions", "fqn": ["zlv_dbt_project", "scissions"], "alias": "scissions", "checksum": {"name": "sha256", "checksum": "a78a225994723295eca371b52449e4e8ae315d65be5133c6ed85a964ca5eab82"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ",", "+header": true}, "created_at": 1736418960.142602, "relation_name": "\"database_name\".\"main_common\".\"scissions\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.article_232_1": {"database": "database_name", "schema": "main_common", "name": "article_232_1", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "article_232_1.csv", "original_file_path": "seeds/article_232_1.csv", "unique_id": "seed.zlv_dbt_project.article_232_1", "fqn": ["zlv_dbt_project", "article_232_1"], "alias": "article_232_1", "checksum": {"name": "sha256", "checksum": "14db7f0e9d0f5f3546e3296693979271b221f26102b5196dc189c2ac50fdaf4d"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "+header": true}, "created_at": 1736418960.137923, "relation_name": "\"database_name\".\"main_common\".\"article_232_1\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.opah": {"database": "database_name", "schema": "main_common", "name": "opah", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "opah.csv", "original_file_path": "seeds/opah.csv", "unique_id": "seed.zlv_dbt_project.opah", "fqn": ["zlv_dbt_project", "opah"], "alias": "opah", "checksum": {"name": "path", "checksum": "seeds/opah.csv"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "+header": true}, "created_at": 1736418960.139877, "relation_name": "\"database_name\".\"main_common\".\"opah\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.article_232_2": {"database": "database_name", "schema": "main_common", "name": "article_232_2", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "article_232_2.csv", "original_file_path": "seeds/article_232_2.csv", "unique_id": "seed.zlv_dbt_project.article_232_2", "fqn": ["zlv_dbt_project", "article_232_2"], "alias": "article_232_2", "checksum": {"name": "sha256", "checksum": "9fa8e145239f6900d507071c7bce45a8a2d9cc3358d997c2e0cf2d04716416e0"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "+header": true}, "created_at": 1736418960.138551, "relation_name": "\"database_name\".\"main_common\".\"article_232_2\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "seed.zlv_dbt_project.ort": {"database": "database_name", "schema": "main_common", "name": "ort", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "ort.csv", "original_file_path": "seeds/ort.csv", "unique_id": "seed.zlv_dbt_project.ort", "fqn": ["zlv_dbt_project", "ort"], "alias": "ort", "checksum": {"name": "sha256", "checksum": "81816e5907e5df51781a28450a64c1f7ee87bfc936de505310b05133dd186f08"}, "config": {"enabled": true, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"Si sign\u00e9e, date de signature": "varchar(5)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null, "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "+header": true, "column_types": {"Si sign\u00e9e, date de signature": "varchar(5)"}}, "created_at": 1736418960.140641, "relation_name": "\"database_name\".\"main_common\".\"ort\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}, "model.zlv_dbt_project.int_lovac_history_owners": {"database": "database_name", "schema": "main_int", "name": "int_lovac_history_owners", "resource_type": "model", "package_name": "zlv_dbt_project", "path": "intermediate/lovac/int_lovac_history_owners.sql", "original_file_path": "models/intermediate/lovac/int_lovac_history_owners.sql", "unique_id": "model.zlv_dbt_project.int_lovac_history_owners", "fqn": ["zlv_dbt_project", "intermediate", "lovac", "int_lovac_history_owners"], "alias": "int_lovac_history_owners", "checksum": {"name": "sha256", "checksum": "c770a26b7e343c3e5fa814de1e1a5638cc4092b258172c0ed31be76fbffe0550"}, "config": {"enabled": true, "alias": null, "schema": "int", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": true, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"full_refresh": true, "schema": "int", "materialized": "view"}, "created_at": 1736434658.6245482, "relation_name": "\"database_name\".\"main_int\".\"int_lovac_history_owners\"", "raw_code": "WITH lovac_history AS (\n SELECT\n ff_idprodroit_1 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2024') }}\n UNION ALL\n SELECT\n ff_idprodroit_2 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2024') }}\n UNION ALL\n SELECT\n ff_idprodroit_3 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2024') }}\n UNION ALL\n SELECT\n ff_idprodroit_4 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2024') }}\n UNION ALL\n SELECT\n ff_idprodroit_5 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2024') }}\n UNION ALL\n SELECT\n ff_idprodroit_6 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2024') }}\n UNION ALL\n SELECT\n ff_idprodroit_1 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2023') }}\n UNION ALL\n SELECT\n ff_idprodroit_2 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2023') }}\n UNION ALL\n SELECT\n ff_idprodroit_3 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2023') }}\n UNION ALL\n SELECT\n ff_idprodroit_4 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2023') }}\n UNION ALL\n SELECT\n ff_idprodroit_5 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2023') }}\n UNION ALL\n SELECT\n ff_idprodroit_6 AS idprodroit,\n 'lovac-' || annee AS file_year,\n annee,\n groupe,\n aff,\n nature,\n ff_ccthp,\n TRY_CAST(debutvacance AS INTEGER) AS debutvacance,\n ccodep\n FROM {{ ref ('int_lovac_ex_2023') }}\n)\n\nSELECT idprodroit, LISTAGG(file_year, ',') AS file_years\nFROM lovac_history\nWHERE\n debutvacance < annee - 2\n AND groupe NOT IN ('1', '2', '3', '4', '5', '6', '9')\n AND aff = 'H'\n AND nature IN ('APPART', 'MAISON') AND ff_ccthp = 'V'\nGROUP BY idprodroit", "language": "sql", "refs": [{"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2024", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}, {"name": "int_lovac_ex_2023", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.zlv_dbt_project.int_lovac_ex_2024", "model.zlv_dbt_project.int_lovac_ex_2023"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}}, "sources": {"source.zlv_dbt_project.airbyte_raw.zlovac": {"database": "AIRBYTE_DATABASE", "schema": "AIRBYTE_SCHEMA", "name": "zlovac", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/externals/sources/stg_zlovac_sources.yml", "original_file_path": "models/staging/externals/sources/stg_zlovac_sources.yml", "unique_id": "source.zlv_dbt_project.airbyte_raw.zlovac", "fqn": ["zlv_dbt_project", "staging", "externals", "sources", "airbyte_raw", "zlovac"], "source_name": "airbyte_raw", "source_description": "", "loader": "", "identifier": "zlovac", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table ZLOVAC contient les informations d\u00e9taill\u00e9es sur les locaux, leur valeur locative, ainsi que des informations sur les propri\u00e9taires et gestionnaires.", "columns": {"insee": {"name": "insee", "description": "Code INSEE de la commune.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccodep": {"name": "ccodep", "description": "Code du d\u00e9partement.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annee": {"name": "annee", "description": "Mill\u00e9sime de l\u2019ann\u00e9e de production N.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dir": {"name": "dir", "description": "Code DSF.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sip": {"name": "sip", "description": "Code SIP.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "commune": {"name": "commune", "description": "Code commune de situation du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "intercommunalite": {"name": "intercommunalite", "description": "Code intercommunalit\u00e9.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gestre_ppre": {"name": "gestre_ppre", "description": "D\u00e9signation du gestionnaire s\u2019il existe, sinon du propri\u00e9taire du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "proprietaire": {"name": "proprietaire", "description": "D\u00e9signation du propri\u00e9taire du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adresse1": {"name": "adresse1", "description": "Adresse du gestionnaire ou du propri\u00e9taire sur 4 lignes de 36 caract\u00e8res.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "groupe": {"name": "groupe", "description": "Code groupe propri\u00e9taire (personnes morales et physiques).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nature": {"name": "nature", "description": "Nature du local en clair.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "loc_voie": {"name": "loc_voie", "description": "Code de la voie du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "loc_num": {"name": "loc_num", "description": "Num\u00e9ro de l'adresse du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invariant": {"name": "invariant", "description": "Num\u00e9ro invariant du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "refcad": {"name": "refcad", "description": "R\u00e9f\u00e9rences cadastrales du local: Num\u00e9ro de section et Num\u00e9ro de plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vlcad": {"name": "vlcad", "description": "Valeur locative en base 1970 (m\u00e9tropole) ou 1975 (DOM) ou 2012 (Mayotte).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vl_revpro": {"name": "vl_revpro", "description": "Valeur Locative R\u00e9vis\u00e9e pour les locaux ayant un code Affectation = A ou S.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "libvoie": {"name": "libvoie", "description": "2\u00e8me ligne adresse du local (n\u00b0 d\u2019immeuble, indice de r\u00e9p\u00e9tition et libell\u00e9 voie).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "libcom": {"name": "libcom", "description": "Libell\u00e9 de la commune de situation du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "txtlv": {"name": "txtlv", "description": "Taux d\u2019imposition TLV ou nombre d'ann\u00e9es de taxation \u00e0 la THLV en N-1.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vl_2020": {"name": "vl_2020", "description": "Valeur locative actualis\u00e9e et revaloris\u00e9e de l'ann\u00e9e 2020.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vlb_pro": {"name": "vlb_pro", "description": "Valeur Locative R\u00e9vis\u00e9e de l'ann\u00e9e courante pour les locaux \u00e0 usage professionnel.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "potentiel_tlv_thlv": {"name": "potentiel_tlv_thlv", "description": "Susceptible-TLV/THLV en N (au sens large).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ffh_ccthp": {"name": "ffh_ccthp", "description": "Code occupation \u00e0 la Th ou \u00e0 la TP.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ffh_jdatat": {"name": "ffh_jdatat", "description": "Date de mutation (date de l'acte).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vl_2019": {"name": "vl_2019", "description": "Valeur locative de l'ann\u00e9e 2019.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"AIRBYTE_DATABASE\".\"AIRBYTE_SCHEMA\".\"zlovac\"", "created_at": 1736418960.144772}, "source.zlv_dbt_project.airbyte_raw.lovac": {"database": "AIRBYTE_DATABASE", "schema": "AIRBYTE_SCHEMA", "name": "lovac", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/externals/sources/stg_lovac_sources.yml", "original_file_path": "models/staging/externals/sources/stg_lovac_sources.yml", "unique_id": "source.zlv_dbt_project.airbyte_raw.lovac", "fqn": ["zlv_dbt_project", "staging", "externals", "sources", "airbyte_raw", "lovac"], "source_name": "airbyte_raw", "source_description": "", "loader": "", "identifier": "lovac", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table LOVAC contient les informations d\u00e9taill\u00e9es sur les locaux, leur valeur locative, ainsi que des informations sur les propri\u00e9taires et gestionnaires.", "columns": {"insee": {"name": "insee", "description": "Code INSEE de la commune.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ccodep": {"name": "ccodep", "description": "Code du d\u00e9partement.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "annee": {"name": "annee", "description": "Mill\u00e9sime de l\u2019ann\u00e9e de production N.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dir": {"name": "dir", "description": "Code DSF.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "sip": {"name": "sip", "description": "Code SIP.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "commune": {"name": "commune", "description": "Code commune de situation du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "intercommunalite": {"name": "intercommunalite", "description": "Code intercommunalit\u00e9.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gestre_ppre": {"name": "gestre_ppre", "description": "D\u00e9signation du gestionnaire s\u2019il existe, sinon du propri\u00e9taire du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "proprietaire": {"name": "proprietaire", "description": "D\u00e9signation du propri\u00e9taire du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adresse1": {"name": "adresse1", "description": "Adresse du gestionnaire ou du propri\u00e9taire sur 4 lignes de 36 caract\u00e8res.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "groupe": {"name": "groupe", "description": "Code groupe propri\u00e9taire (personnes morales et physiques).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "nature": {"name": "nature", "description": "Nature du local en clair.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "loc_voie": {"name": "loc_voie", "description": "Code de la voie du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "loc_num": {"name": "loc_num", "description": "Num\u00e9ro de l'adresse du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "invariant": {"name": "invariant", "description": "Num\u00e9ro invariant du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "refcad": {"name": "refcad", "description": "R\u00e9f\u00e9rences cadastrales du local: Num\u00e9ro de section et Num\u00e9ro de plan.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vlcad": {"name": "vlcad", "description": "Valeur locative en base 1970 (m\u00e9tropole) ou 1975 (DOM) ou 2012 (Mayotte).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vl_revpro": {"name": "vl_revpro", "description": "Valeur Locative R\u00e9vis\u00e9e pour les locaux ayant un code Affectation = A ou S.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "libvoie": {"name": "libvoie", "description": "2\u00e8me ligne adresse du local (n\u00b0 d\u2019immeuble, indice de r\u00e9p\u00e9tition et libell\u00e9 voie).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "libcom": {"name": "libcom", "description": "Libell\u00e9 de la commune de situation du local.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "txtlv": {"name": "txtlv", "description": "Taux d\u2019imposition TLV ou nombre d'ann\u00e9es de taxation \u00e0 la THLV en N-1.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vl_2020": {"name": "vl_2020", "description": "Valeur locative actualis\u00e9e et revaloris\u00e9e de l'ann\u00e9e 2020.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vlb_pro": {"name": "vlb_pro", "description": "Valeur Locative R\u00e9vis\u00e9e de l'ann\u00e9e courante pour les locaux \u00e0 usage professionnel.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "potentiel_tlv_thlv": {"name": "potentiel_tlv_thlv", "description": "Susceptible-TLV/THLV en N (au sens large).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ffh_ccthp": {"name": "ffh_ccthp", "description": "Code occupation \u00e0 la Th ou \u00e0 la TP.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ffh_jdatat": {"name": "ffh_jdatat", "description": "Date de mutation (date de l'acte).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "vl_2019": {"name": "vl_2019", "description": "Valeur locative de l'ann\u00e9e 2019.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"AIRBYTE_DATABASE\".\"AIRBYTE_SCHEMA\".\"lovac\"", "created_at": 1736418960.1454358}, "source.zlv_dbt_project.airbyte_raw.URSAAF": {"database": "AIRBYTE_DATABASE", "schema": "AIRBYTE_SCHEMA", "name": "URSAAF", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/externals/sources/stg_ursaaf_sources.yml", "original_file_path": "models/staging/externals/sources/stg_ursaaf_sources.yml", "unique_id": "source.zlv_dbt_project.airbyte_raw.URSAAF", "fqn": ["zlv_dbt_project", "staging", "externals", "sources", "airbyte_raw", "URSAAF"], "source_name": "airbyte_raw", "source_description": "", "loader": "", "identifier": "URSAAF", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing employment and establishment data from URSAAF, synchronized via Airbyte.", "columns": {"_AIRBYTE_RAW_ID": {"name": "_AIRBYTE_RAW_ID", "description": "Unique identifier for the record in raw format.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AIRBYTE_EXTRACTED_AT": {"name": "_AIRBYTE_EXTRACTED_AT", "description": "Timestamp when the data was extracted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AIRBYTE_META": {"name": "_AIRBYTE_META", "description": "Metadata associated with the data extraction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "APE": {"name": "APE", "description": "Description of APE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EPCI": {"name": "EPCI", "description": "EPCI code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "COMMUNE": {"name": "COMMUNE", "description": "Commune name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE APE": {"name": "CODE APE", "description": "Code for the APE classification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE EPCI": {"name": "CODE EPCI", "description": "Code for the EPCI classification.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "R\u00c9GION": {"name": "R\u00c9GION", "description": "Region name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOM COMMUNE": {"name": "NOM COMMUNE", "description": "Official name of the commune.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE COMMUNE": {"name": "CODE COMMUNE", "description": "Code identifying the commune.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE R\u00c9GION": {"name": "CODE R\u00c9GION", "description": "Code identifying the region.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "D\u00c9PARTEMENT": {"name": "D\u00c9PARTEMENT", "description": "Department name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "SECTEUR NA17": {"name": "SECTEUR NA17", "description": "Sector classified under NA17.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "SECTEUR NA38": {"name": "SECTEUR NA38", "description": "Sector classified under NA38.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "SECTEUR NA88": {"name": "SECTEUR NA88", "description": "Sector classified under NA88.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ZONE D'EMPLOI": {"name": "ZONE D'EMPLOI", "description": "Employment zone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ANCIENNE R\u00c9GION": {"name": "ANCIENNE R\u00c9GION", "description": "Name of the former region.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE D\u00c9PARTEMENT": {"name": "CODE D\u00c9PARTEMENT", "description": "Code for the department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE ZONE D'EMPLOI": {"name": "CODE ZONE D'EMPLOI", "description": "Code for the employment zone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODE ANCIENNE R\u00c9GION": {"name": "CODE ANCIENNE R\u00c9GION", "description": "Code for the former region.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2006": {"name": "EFFECTIFS SALARI\u00c9S 2006", "description": "Number of employees in 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2007": {"name": "EFFECTIFS SALARI\u00c9S 2007", "description": "Number of employees in 2007.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2008": {"name": "EFFECTIFS SALARI\u00c9S 2008", "description": "Number of employees in 2008.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2009": {"name": "EFFECTIFS SALARI\u00c9S 2009", "description": "Number of employees in 2009.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2010": {"name": "EFFECTIFS SALARI\u00c9S 2010", "description": "Number of employees in 2010.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2011": {"name": "EFFECTIFS SALARI\u00c9S 2011", "description": "Number of employees in 2011.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2012": {"name": "EFFECTIFS SALARI\u00c9S 2012", "description": "Number of employees in 2012.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2013": {"name": "EFFECTIFS SALARI\u00c9S 2013", "description": "Number of employees in 2013.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2014": {"name": "EFFECTIFS SALARI\u00c9S 2014", "description": "Number of employees in 2014.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2015": {"name": "EFFECTIFS SALARI\u00c9S 2015", "description": "Number of employees in 2015.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2016": {"name": "EFFECTIFS SALARI\u00c9S 2016", "description": "Number of employees in 2016.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2017": {"name": "EFFECTIFS SALARI\u00c9S 2017", "description": "Number of employees in 2017.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2018": {"name": "EFFECTIFS SALARI\u00c9S 2018", "description": "Number of employees in 2018.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2019": {"name": "EFFECTIFS SALARI\u00c9S 2019", "description": "Number of employees in 2019.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2020": {"name": "EFFECTIFS SALARI\u00c9S 2020", "description": "Number of employees in 2020.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2021": {"name": "EFFECTIFS SALARI\u00c9S 2021", "description": "Number of employees in 2021.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "EFFECTIFS SALARI\u00c9S 2022": {"name": "EFFECTIFS SALARI\u00c9S 2022", "description": "Number of employees in 2022.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "GRAND SECTEUR D'ACTIVIT\u00c9": {"name": "GRAND SECTEUR D'ACTIVIT\u00c9", "description": "Major sector of activity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2006": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2006", "description": "Number of establishments in 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2007": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2007", "description": "Number of establishments in 2007.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2008": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2008", "description": "Number of establishments in 2008.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2009": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2009", "description": "Number of establishments in 2009.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2010": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2010", "description": "Number of establishments in 2010.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2011": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2011", "description": "Number of establishments in 2011.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2012": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2012", "description": "Number of establishments in 2012.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2013": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2013", "description": "Number of establishments in 2013.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2014": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2014", "description": "Number of establishments in 2014.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2015": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2015", "description": "Number of establishments in 2015.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2016": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2016", "description": "Number of establishments in 2016.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2017": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2017", "description": "Number of establishments in 2017.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2018": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2018", "description": "Number of establishments in 2018.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2019": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2019", "description": "Number of establishments in 2019.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2020": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2020", "description": "Number of establishments in 2020.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2021": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2021", "description": "Number of establishments in 2021.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "NOMBRE D'\u00c9TABLISSEMENTS 2022": {"name": "NOMBRE D'\u00c9TABLISSEMENTS 2022", "description": "Number of establishments in 2022.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AB_SOURCE_FILE_URL": {"name": "_AB_SOURCE_FILE_URL", "description": "URL of the source file for the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AB_SOURCE_FILE_LAST_MODIFIED": {"name": "_AB_SOURCE_FILE_LAST_MODIFIED", "description": "Timestamp when the source file was last modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"AIRBYTE_DATABASE\".\"AIRBYTE_SCHEMA\".\"URSAAF\"", "created_at": 1736418960.1455941}, "source.zlv_dbt_project.airbyte_raw.FF": {"database": "AIRBYTE_DATABASE", "schema": "AIRBYTE_SCHEMA", "name": "FF", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/externals/sources/stg_ff_sources.yml", "original_file_path": "models/staging/externals/sources/stg_ff_sources.yml", "unique_id": "source.zlv_dbt_project.airbyte_raw.FF", "fqn": ["zlv_dbt_project", "staging", "externals", "sources", "airbyte_raw", "FF"], "source_name": "airbyte_raw", "source_description": "", "loader": "", "identifier": "FF", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing data related to airbyte synchronization processes.", "columns": {"_AIRBYTE_RAW_ID": {"name": "_AIRBYTE_RAW_ID", "description": "Unique identifier for the record in raw format.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AIRBYTE_EXTRACTED_AT": {"name": "_AIRBYTE_EXTRACTED_AT", "description": "Timestamp when the data was extracted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AIRBYTE_META": {"name": "_AIRBYTE_META", "description": "Metadata associated with the data extraction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_X": {"name": "FF_X", "description": "Description of what FF_X represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_Y": {"name": "FF_Y", "description": "Description of what FF_Y represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CCTHP": {"name": "FF_CCTHP", "description": "Description of what FF_CCTHP represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CTPDL": {"name": "FF_CTPDL", "description": "Description of what FF_CTPDL represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DNBWC": {"name": "FF_DNBWC", "description": "Description of what FF_DNBWC represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_IDBAT": {"name": "FF_IDBAT", "description": "Description of what FF_IDBAT represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_IDCOM": {"name": "FF_IDCOM", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "you_description": "Description of what FF_IDCOM represents."}, "FF_IDPAR": {"name": "FF_IDPAR", "description": "Description of what FF_IDPAR represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_IDSEC": {"name": "FF_IDSEC", "description": "Description of what FF_IDSEC represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_STOTH": {"name": "FF_STOTH", "description": "Description of what FF_STOTH represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CCODEP": {"name": "FF_CCODEP", "description": "Description of what FF_CCODEP represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CCOGRM": {"name": "FF_CCOGRM", "description": "Description of what FF_CCOGRM represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CCORIV": {"name": "FF_CCORIV", "description": "Description of what FF_CCORIV represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DDENOM": {"name": "FF_DDENOM", "description": "Description of what FF_DDENOM represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DINDIC": {"name": "FF_DINDIC", "description": "Description of what FF_DINDIC represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DNBBAI": {"name": "FF_DNBBAI", "description": "Description of what FF_DNBBAI represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DNBDOU": {"name": "FF_DNBDOU", "description": "Description of what FF_DNBDOU represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DTELOC": {"name": "FF_DTELOC", "description": "Description of what FF_DTELOC represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DVLTRT": {"name": "FF_DVLTRT", "description": "Description of what FF_DVLTRT represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_JDATAT": {"name": "FF_JDATAT", "description": "Description of what FF_JDATAT represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_NDROIT": {"name": "FF_NDROIT", "description": "Description of what FF_NDROIT represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_SLOCAL": {"name": "FF_SLOCAL", "description": "Description of what FF_SLOCAL represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FFH_CCTHP": {"name": "FFH_CCTHP", "description": "Description of what FFH_CCTHP represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CATPRO2": {"name": "FF_CATPRO2", "description": "Description of what FF_CATPRO2 represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CATPRO3": {"name": "FF_CATPRO3", "description": "Description of what FF_CATPRO3 represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DCAPEC2": {"name": "FF_DCAPEC2", "description": "Description of what FF_DCAPEC2 represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DNVOIRI": {"name": "FF_DNVOIRI", "description": "Description of what FF_DNVOIRI represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_DVOILIB": {"name": "FF_DVOILIB", "description": "Description of what FF_DVOILIB represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_GEOMLOC": {"name": "FF_GEOMLOC", "description": "Description of what FF_GEOMLOC represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_IDLOCAL": {"name": "FF_IDLOCAL", "description": "Description of what FF_IDLOCAL represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_JANNATH": {"name": "FF_JANNATH", "description": "Description of what FF_JANNATH represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_JDATNSS": {"name": "FF_JDATNSS", "description": "Description of what FF_JDATNSS represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_LOCPROP": {"name": "FF_LOCPROP", "description": "Description of what FF_LOCPROP represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FFH_JDATAT": {"name": "FFH_JDATAT", "description": "Description of what FFH_JDATAT represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_MILLESIME": {"name": "FF_MILLESIME", "description": "Description of what FF_MILLESIME represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_NPIECE_P2": {"name": "FF_NPIECE_P2", "description": "Description of what FF_NPIECE_P2 represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_CATPRO2TXT": {"name": "FF_CATPRO2TXT", "description": "Description of what FF_CATPRO2TXT represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "FF_PROBA_RPRS": {"name": "FF_PROBA_RPRS", "description": "Description of what FF_PROBA_RPRS represents.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AB_SOURCE_FILE_URL": {"name": "_AB_SOURCE_FILE_URL", "description": "URL of the source file for the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AB_SOURCE_FILE_LAST_MODIFIED": {"name": "_AB_SOURCE_FILE_LAST_MODIFIED", "description": "Timestamp when the source file was last modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"AIRBYTE_DATABASE\".\"AIRBYTE_SCHEMA\".\"FF\"", "created_at": 1736418960.145808}, "source.zlv_dbt_project.airbyte_raw.INSEE": {"database": "AIRBYTE_DATABASE", "schema": "AIRBYTE_SCHEMA", "name": "INSEE", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/externals/sources/stg_insee_sources.yml", "original_file_path": "models/staging/externals/sources/stg_insee_sources.yml", "unique_id": "source.zlv_dbt_project.airbyte_raw.INSEE", "fqn": ["zlv_dbt_project", "staging", "externals", "sources", "airbyte_raw", "INSEE"], "source_name": "airbyte_raw", "source_description": "", "loader": "", "identifier": "INSEE", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "Table containing historical and recent population metrics from INSEE data, synchronized via Airbyte.", "columns": {"_AIRBYTE_RAW_ID": {"name": "_AIRBYTE_RAW_ID", "description": "Unique identifier for the record in raw format.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AIRBYTE_EXTRACTED_AT": {"name": "_AIRBYTE_EXTRACTED_AT", "description": "Timestamp when the data was extracted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AIRBYTE_META": {"name": "_AIRBYTE_META", "description": "Metadata associated with the data extraction.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "DEP": {"name": "DEP", "description": "Department code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "REG": {"name": "REG", "description": "Region code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "LIBGEO": {"name": "LIBGEO", "description": "Geographic area description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2006": {"name": "PMUN2006", "description": "Municipal population in 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2007": {"name": "PMUN2007", "description": "Municipal population in 2007.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2008": {"name": "PMUN2008", "description": "Municipal population in 2008.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2009": {"name": "PMUN2009", "description": "Municipal population in 2009.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2010": {"name": "PMUN2010", "description": "Municipal population in 2010.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2011": {"name": "PMUN2011", "description": "Municipal population in 2011.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2012": {"name": "PMUN2012", "description": "Municipal population in 2012.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2013": {"name": "PMUN2013", "description": "Municipal population in 2013.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2014": {"name": "PMUN2014", "description": "Municipal population in 2014.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2015": {"name": "PMUN2015", "description": "Municipal population in 2015.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2016": {"name": "PMUN2016", "description": "Municipal population in 2016.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2017": {"name": "PMUN2017", "description": "Municipal population in 2017.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2018": {"name": "PMUN2018", "description": "Municipal population in 2018.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2019": {"name": "PMUN2019", "description": "Municipal population in 2019.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2020": {"name": "PMUN2020", "description": "Municipal population in 2020.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PMUN2021": {"name": "PMUN2021", "description": "Municipal population in 2021.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PSDC1962": {"name": "PSDC1962", "description": "Population without double counting in 1962.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PSDC1968": {"name": "PSDC1968", "description": "Population without double counting in 1968.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PSDC1975": {"name": "PSDC1975", "description": "Population without double counting in 1975.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PSDC1982": {"name": "PSDC1982", "description": "Population without double counting in 1982.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PSDC1990": {"name": "PSDC1990", "description": "Population without double counting in 1990.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PSDC1999": {"name": "PSDC1999", "description": "Population without double counting in 1999.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1876": {"name": "PTOT1876", "description": "Total population in 1876.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1881": {"name": "PTOT1881", "description": "Total population in 1881.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1886": {"name": "PTOT1886", "description": "Total population in 1886.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1891": {"name": "PTOT1891", "description": "Total population in 1891.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1896": {"name": "PTOT1896", "description": "Total population in 1896.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1901": {"name": "PTOT1901", "description": "Total population in 1901.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1906": {"name": "PTOT1906", "description": "Total population in 1906.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1911": {"name": "PTOT1911", "description": "Total population in 1911.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1921": {"name": "PTOT1921", "description": "Total population in 1921.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1926": {"name": "PTOT1926", "description": "Total population in 1926.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1931": {"name": "PTOT1931", "description": "Total population in 1931.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1936": {"name": "PTOT1936", "description": "Total population in 1936.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "PTOT1954": {"name": "PTOT1954", "description": "Total population in 1954.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "CODGEO": {"name": "CODGEO", "description": "Geographic code (identifier).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AB_SOURCE_FILE_URL": {"name": "_AB_SOURCE_FILE_URL", "description": "URL of the source file for the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_AB_SOURCE_FILE_LAST_MODIFIED": {"name": "_AB_SOURCE_FILE_LAST_MODIFIED", "description": "Timestamp when the source file was last modified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"AIRBYTE_DATABASE\".\"AIRBYTE_SCHEMA\".\"INSEE\"", "created_at": 1736418960.145934}, "source.zlv_dbt_project.duckdb_production_raw.housing": {"database": "database_name", "schema": "production", "name": "housing", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.housing", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "housing"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "housing", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"housing\"", "created_at": 1736418960.145997}, "source.zlv_dbt_project.duckdb_production_raw.owners": {"database": "database_name", "schema": "production", "name": "owners", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.owners", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "owners"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "owners", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"owners\"", "created_at": 1736418960.146066}, "source.zlv_dbt_project.duckdb_production_raw.events": {"database": "database_name", "schema": "production", "name": "events", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.events", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "events"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "events", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"events\"", "created_at": 1736418960.146142}, "source.zlv_dbt_project.duckdb_production_raw.old_events": {"database": "database_name", "schema": "production", "name": "old_events", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.old_events", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "old_events"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "old_events", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"old_events\"", "created_at": 1736418960.1462011}, "source.zlv_dbt_project.duckdb_production_raw.housing_events": {"database": "database_name", "schema": "production", "name": "housing_events", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.housing_events", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "housing_events"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "housing_events", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"housing_events\"", "created_at": 1736418960.146271}, "source.zlv_dbt_project.duckdb_production_raw.establishments": {"database": "database_name", "schema": "production", "name": "establishments", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.establishments", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "establishments"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "establishments", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"establishments\"", "created_at": 1736418960.1463318}, "source.zlv_dbt_project.duckdb_production_raw.users": {"database": "database_name", "schema": "production", "name": "users", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.users", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "users"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "users", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"users\"", "created_at": 1736418960.1464}, "source.zlv_dbt_project.duckdb_production_raw.campaigns_housing": {"database": "database_name", "schema": "production", "name": "campaigns_housing", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.campaigns_housing", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "campaigns_housing"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "campaigns_housing", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"campaigns_housing\"", "created_at": 1736418960.146467}, "source.zlv_dbt_project.duckdb_production_raw.campaigns": {"database": "database_name", "schema": "production", "name": "campaigns", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.campaigns", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "campaigns"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "campaigns", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"campaigns\"", "created_at": 1736418960.146533}, "source.zlv_dbt_project.duckdb_production_raw.owners_housing": {"database": "database_name", "schema": "production", "name": "owners_housing", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.owners_housing", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "owners_housing"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "owners_housing", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"owners_housing\"", "created_at": 1736418960.1466}, "source.zlv_dbt_project.duckdb_production_raw.group_housing_events": {"database": "database_name", "schema": "production", "name": "group_housing_events", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.group_housing_events", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "group_housing_events"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "group_housing_events", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"group_housing_events\"", "created_at": 1736418960.146657}, "source.zlv_dbt_project.duckdb_production_raw.groups": {"database": "database_name", "schema": "production", "name": "groups", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.groups", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "groups"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "groups", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"groups\"", "created_at": 1736418960.146715}, "source.zlv_dbt_project.duckdb_production_raw.groups_housing": {"database": "database_name", "schema": "production", "name": "groups_housing", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.groups_housing", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "groups_housing"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "groups_housing", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"groups_housing\"", "created_at": 1736418960.1467829}, "source.zlv_dbt_project.duckdb_production_raw.geo_perimeters": {"database": "database_name", "schema": "production", "name": "geo_perimeters", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/production/sources.yml", "original_file_path": "models/staging/production/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_production_raw.geo_perimeters", "fqn": ["zlv_dbt_project", "staging", "production", "duckdb_production_raw", "geo_perimeters"], "source_name": "duckdb_production_raw", "source_description": "", "loader": "", "identifier": "geo_perimeters", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"production\".\"geo_perimeters\"", "created_at": 1736418960.146848}, "source.zlv_dbt_project.duckdb_raw.raw_ff_owners": {"database": "database_name", "schema": "ff", "name": "raw_ff_owners", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/ff/sources.yml", "original_file_path": "models/staging/ff/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_ff_owners", "fqn": ["zlv_dbt_project", "staging", "ff", "duckdb_raw", "raw_ff_owners"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_ff_owners", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"ff\".\"raw_ff_owners\"", "created_at": 1736418960.146913}, "source.zlv_dbt_project.duckdb_raw.raw_ff_2023": {"database": "database_name", "schema": "ff", "name": "raw_ff_2023", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/ff/sources.yml", "original_file_path": "models/staging/ff/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_ff_2023", "fqn": ["zlv_dbt_project", "staging", "ff", "duckdb_raw", "raw_ff_2023"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_ff_2023", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"ff\".\"raw_ff_2023\"", "created_at": 1736418960.146971}, "source.zlv_dbt_project.duckdb_raw.raw_ff_2022": {"database": "database_name", "schema": "ff", "name": "raw_ff_2022", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/ff/sources.yml", "original_file_path": "models/staging/ff/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_ff_2022", "fqn": ["zlv_dbt_project", "staging", "ff", "duckdb_raw", "raw_ff_2022"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_ff_2022", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"ff\".\"raw_ff_2022\"", "created_at": 1736418960.147038}, "source.zlv_dbt_project.duckdb_raw.raw_ff_2021": {"database": "database_name", "schema": "ff", "name": "raw_ff_2021", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/ff/sources.yml", "original_file_path": "models/staging/ff/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_ff_2021", "fqn": ["zlv_dbt_project", "staging", "ff", "duckdb_raw", "raw_ff_2021"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_ff_2021", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"ff\".\"raw_ff_2021\"", "created_at": 1736418960.1470988}, "source.zlv_dbt_project.duckdb_raw.raw_ff_2020": {"database": "database_name", "schema": "ff", "name": "raw_ff_2020", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/ff/sources.yml", "original_file_path": "models/staging/ff/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_ff_2020", "fqn": ["zlv_dbt_project", "staging", "ff", "duckdb_raw", "raw_ff_2020"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_ff_2020", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"ff\".\"raw_ff_2020\"", "created_at": 1736418960.147161}, "source.zlv_dbt_project.duckdb_raw.raw_ff_2019": {"database": "database_name", "schema": "ff", "name": "raw_ff_2019", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/ff/sources.yml", "original_file_path": "models/staging/ff/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_ff_2019", "fqn": ["zlv_dbt_project", "staging", "ff", "duckdb_raw", "raw_ff_2019"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_ff_2019", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"ff\".\"raw_ff_2019\"", "created_at": 1736418960.1472268}, "source.zlv_dbt_project.duckdb_raw.raw_lovac_2019": {"database": "database_name", "schema": "lovac", "name": "raw_lovac_2019", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/lovac/sources.yml", "original_file_path": "models/staging/lovac/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_lovac_2019", "fqn": ["zlv_dbt_project", "staging", "lovac", "duckdb_raw", "raw_lovac_2019"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_lovac_2019", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"lovac\".\"raw_lovac_2019\"", "created_at": 1736418960.147288}, "source.zlv_dbt_project.duckdb_raw.raw_lovac_2020": {"database": "database_name", "schema": "lovac", "name": "raw_lovac_2020", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/lovac/sources.yml", "original_file_path": "models/staging/lovac/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_lovac_2020", "fqn": ["zlv_dbt_project", "staging", "lovac", "duckdb_raw", "raw_lovac_2020"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_lovac_2020", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"lovac\".\"raw_lovac_2020\"", "created_at": 1736418960.147352}, "source.zlv_dbt_project.duckdb_raw.raw_lovac_2021": {"database": "database_name", "schema": "lovac", "name": "raw_lovac_2021", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/lovac/sources.yml", "original_file_path": "models/staging/lovac/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_lovac_2021", "fqn": ["zlv_dbt_project", "staging", "lovac", "duckdb_raw", "raw_lovac_2021"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_lovac_2021", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"lovac\".\"raw_lovac_2021\"", "created_at": 1736418960.147412}, "source.zlv_dbt_project.duckdb_raw.raw_lovac_2022": {"database": "database_name", "schema": "lovac", "name": "raw_lovac_2022", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/lovac/sources.yml", "original_file_path": "models/staging/lovac/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_lovac_2022", "fqn": ["zlv_dbt_project", "staging", "lovac", "duckdb_raw", "raw_lovac_2022"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_lovac_2022", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"lovac\".\"raw_lovac_2022\"", "created_at": 1736418960.1474938}, "source.zlv_dbt_project.duckdb_raw.raw_lovac_2023": {"database": "database_name", "schema": "lovac", "name": "raw_lovac_2023", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/lovac/sources.yml", "original_file_path": "models/staging/lovac/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_lovac_2023", "fqn": ["zlv_dbt_project", "staging", "lovac", "duckdb_raw", "raw_lovac_2023"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_lovac_2023", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"lovac\".\"raw_lovac_2023\"", "created_at": 1736418960.147564}, "source.zlv_dbt_project.duckdb_raw.raw_lovac_2024": {"database": "database_name", "schema": "lovac", "name": "raw_lovac_2024", "resource_type": "source", "package_name": "zlv_dbt_project", "path": "models/staging/lovac/sources.yml", "original_file_path": "models/staging/lovac/sources.yml", "unique_id": "source.zlv_dbt_project.duckdb_raw.raw_lovac_2024", "fqn": ["zlv_dbt_project", "staging", "lovac", "duckdb_raw", "raw_lovac_2024"], "source_name": "duckdb_raw", "source_description": "", "loader": "", "identifier": "raw_lovac_2024", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": null, "freshness": {"warn_after": {"count": null, "period": null}, "error_after": {"count": null, "period": null}, "filter": null}, "external": null, "description": "", "columns": {}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"database_name\".\"lovac\".\"raw_lovac_2024\"", "created_at": 1736418960.1476219}}, "macros": {"macro.zlv_dbt_project.pivot_columns_by_year": {"name": "pivot_columns_by_year", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/utils/pivot_columns_by_year.sql", "original_file_path": "macros/utils/pivot_columns_by_year.sql", "unique_id": "macro.zlv_dbt_project.pivot_columns_by_year", "macro_sql": "{% macro pivot_columns_by_year (columns, years) %}\n{% for column in columns %}\n{% for year in years %}\nSUM (CASE WHEN year = {{ year }} THEN {{ column }} END) AS {{ column }}_{{ year }} {% if not loop.last %},\n{% endif %}\n{% endfor %}\n{% if not loop.last %}, {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8845, "supported_languages": null}, "macro.zlv_dbt_project.process_return_rate_with_next_campaign": {"name": "process_return_rate_with_next_campaign", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/process_return_rate_with_next_campaign.sql", "original_file_path": "macros/production/process_return_rate_with_next_campaign.sql", "unique_id": "macro.zlv_dbt_project.process_return_rate_with_next_campaign", "macro_sql": "{% macro process_return_rate_with_next_campaign (n_month) %}\nMAX (CASE\nWHEN next_campaigns.next_sent_at IS NOT NULL AND next_campaigns.next_sent_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nTHEN 1\nELSE 0\nEND) AS has_next_campaign_in_{{ n_month }}_months,\n\nCOUNT (DISTINCT CASE\nWHEN e.created_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nAND (next_campaigns.next_sent_at IS NULL OR e.created_at < next_campaigns.next_sent_at)\nAND (e.status_changed IS TRUE OR e.occupancy_changed IS TRUE)\nAND e.category = 'Followup'\nTHEN pch.housing_id\nEND) AS return_count_{{ n_month }}_months_before_next_campaign,\n\n(COUNT (DISTINCT CASE\nWHEN e.created_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nAND (next_campaigns.next_sent_at IS NULL OR e.created_at < next_campaigns.next_sent_at)\nAND (e.status_changed IS TRUE OR e.occupancy_changed IS TRUE)\nAND e.category = 'Followup'\nTHEN pch.housing_id\nEND) * 100.0 / NULLIF (MAX (cc.count_housing),\n0)) AS return_rate_{{ n_month }}_months_before_next_campaign\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.884942, "supported_languages": null}, "macro.zlv_dbt_project.process_return_rate_without_next_campaign": {"name": "process_return_rate_without_next_campaign", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/process_return_rate_without_next_campaign.sql", "original_file_path": "macros/production/process_return_rate_without_next_campaign.sql", "unique_id": "macro.zlv_dbt_project.process_return_rate_without_next_campaign", "macro_sql": "{% macro process_return_rate_without_next_campaign (n_month) %}\nCOUNT (DISTINCT CASE\nWHEN e.created_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nAND (e.status_changed IS TRUE OR e.occupancy_changed IS TRUE)\nAND e.category = 'Followup'\nTHEN pch.housing_id\nEND) AS return_count_{{ n_month }}_months,\n\n(COUNT (DISTINCT CASE\nWHEN e.created_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nAND (e.status_changed IS TRUE OR e.occupancy_changed IS TRUE)\nAND e.category = 'Followup'\nTHEN pch.housing_id\nEND) * 100.0 / NULLIF (MAX (cc.count_housing),\n0)) AS return_rate_{{ n_month }}_months\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.885205, "supported_languages": null}, "macro.zlv_dbt_project.process_return_rate_for_campaigns": {"name": "process_return_rate_for_campaigns", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/campaign_return_rate.sql", "original_file_path": "macros/production/campaign_return_rate.sql", "unique_id": "macro.zlv_dbt_project.process_return_rate_for_campaigns", "macro_sql": "{% macro process_return_rate_for_campaigns (n_month,\ncheck_next_campaign = False) %}\nMAX (CASE\nWHEN next_pc.next_sent_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nTHEN 1\nELSE 0\nEND) AS has_next_campaign_{{ n_month }}_months,\n-- Define the returned count for each month interval\nCOUNT (DISTINCT CASE\nWHEN e.created_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nAND e.event_status_label = 'Suivi termin\u00e9'\n{% if check_next_campaign %}\nAND (next_pc.next_sent_at IS NULL OR e.created_at < next_pc.next_sent_at)\n{% endif %}\nTHEN pch.housing_id\nEND) AS returned_count_{{ n_month }}_months {% if not check_next_campaign %} _no_filter {% endif %},\n\n-- Define the return rate calculation\n(COUNT (DISTINCT CASE\nWHEN e.created_at < (pc.sent_at + INTERVAL '{{ n_month }} months')\nAND e.event_status_label = 'Suivi termin\u00e9'\n{% if check_next_campaign %}\nAND (next_pc.next_sent_at IS NULL OR e.created_at < next_pc.next_sent_at)\n{% endif %}\nTHEN pch.housing_id\nEND) * 100.0 / NULLIF (COUNT (DISTINCT h.id),\n0)) AS return_rate_{{ n_month }} {% if not check_next_campaign %} _no_filter {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8858628, "supported_languages": null}, "macro.zlv_dbt_project.get_last_establishment_event_status": {"name": "get_last_establishment_event_status", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/events/get_last_establishment_event_status.sql", "original_file_path": "macros/production/events/get_last_establishment_event_status.sql", "unique_id": "macro.zlv_dbt_project.get_last_establishment_event_status", "macro_sql": "{% macro get_last_establishment_event_status (user_source,\nevent_name,\nall_users = false) %}\n(\nSELECT\nu.establishment_id,\nevents.new_status AS status,\nevents.event_status_label AS status_label,\nevents.new_occupancy AS occupancy,\nevents.new_sub_status,\nevents.created_at,\nROW_NUMBER () OVER (PARTITION BY u.establishment_id ORDER BY events.created_at DESC) AS row_num\nFROM {{ ref ('int_production_events') }} AS events\nLEFT JOIN {{ ref ('int_production_users') }} AS u ON events.created_by = u.id\nWHERE\n1 = 1\n{% if event_name == 'suivi' %}\nAND events.status_changed = TRUE\n{% elif event_name == 'occupation' %}\nAND events.occupancy_changed = TRUE\n{% else %}\n{% endif %}\n{% if not all_users %}\nAND events.user_source = '{{ user_source }}'\n{% endif %}\n)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.886362, "supported_languages": null}, "macro.zlv_dbt_project.select_last_event": {"name": "select_last_event", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/events/select_last_event.sql", "original_file_path": "macros/production/events/select_last_event.sql", "unique_id": "macro.zlv_dbt_project.select_last_event", "macro_sql": "{% macro select_last_event (housing_table, event_table, column_suffix) %}\n(\nSELECT\nh.id AS housing_id,\nevt.status AS last_event_status_{{ column_suffix }},\nevt.status_label AS last_event_status_label_{{ column_suffix }},\nevt.new_sub_status AS last_event_sub_status_label_{{ column_suffix }},\nevt.created_at AS last_event_date_{{ column_suffix }}\nFROM {{ housing_table }} AS h\nLEFT JOIN {{ event_table }} AS evt\nON evt.housing_id = h.id AND evt.row_num = 1\n)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8866482, "supported_languages": null}, "macro.zlv_dbt_project.select_last_establishment_event": {"name": "select_last_establishment_event", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/events/select_last_establishment_event.sql", "original_file_path": "macros/production/events/select_last_establishment_event.sql", "unique_id": "macro.zlv_dbt_project.select_last_establishment_event", "macro_sql": "{% macro select_last_establishment_event(establishment_table, event_table, column_suffix) %}\n(\n SELECT \n e.id AS establishment_id,\n evt.status AS last_event_status_{{ column_suffix }},\n evt.status_label AS last_event_status_label_{{ column_suffix }},\n evt.occupancy AS last_event_occupancy_{{ column_suffix }},\n evt.new_sub_status AS last_event_sub_status_label_{{ column_suffix }},\n evt.created_at AS last_event_date_{{ column_suffix }}\n FROM {{ establishment_table }} AS e\n LEFT JOIN {{ event_table }} AS evt\n ON evt.establishment_id = e.id AND evt.row_num = 1\n)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.886985, "supported_languages": null}, "macro.zlv_dbt_project.get_last_event_status": {"name": "get_last_event_status", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/production/events/get_last_event_status.sql", "original_file_path": "macros/production/events/get_last_event_status.sql", "unique_id": "macro.zlv_dbt_project.get_last_event_status", "macro_sql": "{% macro get_last_event_status (user_source, event_name, all_users = false) %}\n(\nSELECT\nevents.housing_id,\nevents.new_status AS status,\nevents.event_status_label AS status_label,\nevents.new_sub_status,\nevents.created_at,\nROW_NUMBER () OVER (PARTITION BY events.housing_id ORDER BY events.created_at DESC) AS row_num\nFROM {{ ref ('int_production_events') }} AS events\nWHERE\n1 = 1\n{% if event_name == 'suivi' %}\nAND events.status_changed = TRUE\n{% elif event_name == 'occupation' %}\nAND events.occupancy_changed = TRUE\n{% else %}\n{% endif %}\n{% if not all_users %}\nAND events.user_source = '{{ user_source }}'\n{% endif %}\n)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.887375, "supported_languages": null}, "macro.zlv_dbt_project.filter_lovac": {"name": "filter_lovac", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/lovac/filters_lovac.sql", "original_file_path": "macros/lovac/filters_lovac.sql", "unique_id": "macro.zlv_dbt_project.filter_lovac", "macro_sql": "{% macro filter_lovac(ccthp = False, vacancy = True) %}\nWHERE\n1 = 1\n{% if ccthp %}\nAND ff_ccthp IN ('V')\n{% endif %}\n-- - 2 ans \n{% if vacancy %}\nAND vacancy_start_year < data_year - 2\n{% endif %}\nAND (groupe NOT IN (1, 2, 3, 4, 5, 6, 9) OR groupe is NULL)\nAND aff = 'H'\nAND housing_kind IN ('APPART', 'MAISON')\nAND local_id IS NOT NULL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8876102, "supported_languages": null}, "macro.zlv_dbt_project.process_owner_kind": {"name": "process_owner_kind", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/lovac/owner_kind_processing.sql", "original_file_path": "macros/lovac/owner_kind_processing.sql", "unique_id": "macro.zlv_dbt_project.process_owner_kind", "macro_sql": "{% macro process_owner_kind (catpro_3) %}\nCASE\nWHEN {{ catpro_3 }} IN ('P1a',\n'P1b',\n'P2a',\n'P3a',\n'P4a',\n'P4b',\n'P4c',\n'P4d',\n'P5a',\n'P6a',\n'P6b') THEN 'Etat et collectivit\u00e9 territoriale'\nWHEN {{ catpro_3 }} IN ('F1a',\n'F2a',\n'F2b',\n'F4a',\n'F4b',\n'F4c',\n'F5a',\n'F5b',\n'F7a',\n'F7c',\n'F7g') THEN 'Bailleur social, Am\u00e9nageur, Investisseur public'\nWHEN {{ catpro_3 }} IN ('F6a',\n'F6b',\n'F6c',\n'F7b',\n'F7d',\n'F7e',\n'F7f') THEN 'Promoteur, Investisseur priv\u00e9'\nWHEN {{ catpro_3 }} IN ('A1a',\n'A1e',\n'A1f',\n'A1g',\n'A1h',\n'A2a',\n'A2c',\n'A2d',\n'A3a',\n'A3b',\n'A3c',\n'A3d',\n'A3e',\n'A3f',\n'A3g',\n'A3h',\n'A4a',\n'A5a',\n'R1a',\n'R2a',\n'R2b',\n'R2c',\n'R3a',\n'R4a',\n'R4b',\n'R4c',\n'R4d',\n'R5a',\n'R5b',\n'R6a',\n'R7a',\n'R0a',\n'E1a',\n'E2a',\n'E2b',\n'E2c',\n'E2d',\n'E2e',\n'E2f',\n'E2g',\n'E2h',\n'E2i',\n'E2j',\n'E2k',\n'E2l',\n'E2m',\n'E2n',\n'E2o',\n'E2q',\n'E2r',\n'E3a',\n'E3e',\n'S1a', 'S1b', 'S1c', 'S1d', 'S1e', 'S2a', 'S2b', 'S2c', 'S2d', 'S2e', 'S2g',\n'Z1a', 'Z2a', 'Z2b', 'Z2c', 'Z3a', 'Z3b', 'Z3c', 'Z4a', 'Z4b',\n'L1a', 'L1b', 'L1c', 'L1d', 'L2a', 'L3a', 'L3b', 'L4a') THEN 'Autres'\nWHEN {{ catpro_3 }} IN ('G1a',\n'G1b',\n'G1c',\n'G1d',\n'G2a',\n'G2b',\n'G2c',\n'G2d',\n'M1a',\n'M2a',\n'M0a') THEN 'SCI, Copropri\u00e9t\u00e9, Autres personnes morales'\nWHEN {{ catpro_3 }} = 'X1a' THEN 'Particulier'\nWHEN {{ catpro_3 }} = '999' THEN 'Absence de propri\u00e9taire'\nELSE 'Non classifi\u00e9'\nEND\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8881102, "supported_languages": null}, "macro.zlv_dbt_project.handle_lovac_different_years": {"name": "handle_lovac_different_years", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/lovac/handle_lovac_different_years.sql", "original_file_path": "macros/lovac/handle_lovac_different_years.sql", "unique_id": "macro.zlv_dbt_project.handle_lovac_different_years", "macro_sql": "{% macro handle_lovac_different_years () %}\ncleaned_data AS (\nSELECT\nannee as data_year,\nff_millesime,\ninvariant,\nff_idlocal AS local_id,\nTRY_CAST (groupe AS INTEGER) as groupe,\ndebutvacance AS vacancy_start_year,\naff as aff,\n'lovac-' || annee as file_year,\nannee as year, groupe, aff, nature, ff_ccthp,\nTRY_CAST (debutvacance as INTEGER) as debutvacance,\nccodep,\nlpad (ccodep, 2, '0') || lpad (commune, 3, '0') AS geo_code,\nnature AS housing_kind,\nsource.*\n\nFROM\nsource\n)\n\nSELECT * FROM cleaned_data\nQUALIFY\nROW_NUMBER () OVER (PARTITION BY local_id ORDER BY debutvacance DESC) = 1\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.888242, "supported_languages": null}, "macro.zlv_dbt_project.process_owner_code_droit": {"name": "process_owner_code_droit", "resource_type": "macro", "package_name": "zlv_dbt_project", "path": "macros/lovac/processing_owner_code_droit.sql", "original_file_path": "macros/lovac/processing_owner_code_droit.sql", "unique_id": "macro.zlv_dbt_project.process_owner_code_droit", "macro_sql": "{% macro process_owner_code_droit (ff_ccodro) %}\nCASE\nWHEN {{ ff_ccodro }} = 'P' THEN 'PROPRIETAIRE'\nWHEN {{ ff_ccodro }} = 'U' THEN 'USUFRUITIER'\nWHEN {{ ff_ccodro }} = 'N' THEN 'NU-PROPRIETAIRE'\nWHEN {{ ff_ccodro }} = 'R' THEN 'PRENEUR A CONSTRUCTION'\nWHEN {{ ff_ccodro }} = 'F' THEN 'FONCIER'\nWHEN {{ ff_ccodro }} = 'T' THEN 'TENUYER'\nWHEN {{ ff_ccodro }} = 'D' THEN 'DOMANIER'\nWHEN {{ ff_ccodro }} = 'V' THEN 'BAILLEUR D UN BAIL A REHABILITATION'\nWHEN {{ ff_ccodro }} = 'W' THEN 'PRENEUR D UN BAIL A REHABILITATION'\nWHEN {{ ff_ccodro }} = 'A' THEN 'LOCATAIRE-ATTRIBUTAIRE'\nWHEN {{ ff_ccodro }} = 'E' THEN 'EMPHYTEOTE'\nWHEN {{ ff_ccodro }} = 'K' THEN 'ANTICHRESISTE'\nWHEN {{ ff_ccodro }} = 'L' THEN 'FONCTIONNAIRE LOGE'\nWHEN {{ ff_ccodro }} = 'G' THEN 'GERANT, MANDATAIRE,GESTIONNAIRE'\nWHEN {{ ff_ccodro }} = 'S' THEN 'SYNDIC DE COPROPRIETE'\nWHEN {{ ff_ccodro }} = 'H' THEN 'ASSOCIE DANS UNE SOCIETE EN TRANSPARENCE FISCALE'\nWHEN {{ ff_ccodro }} = 'O' THEN 'AUTORISATION DOCCUPATION TEMPORAIRE'\nWHEN {{ ff_ccodro }} = 'J' THEN 'JEUNE AGRICULTEUR'\nWHEN {{ ff_ccodro }} = 'Q' THEN 'GESTIONNAIRE TAXE SUR LES BUREAUX'\nWHEN {{ ff_ccodro }} = 'X' THEN 'LA POSTE PROPRIETAIRE ET OCCUPANT'\nWHEN {{ ff_ccodro }} = 'Y' THEN 'LA POSTE OCCUPANT - NON PROPRIETAIRE'\nWHEN {{ ff_ccodro }} = 'C' THEN 'FIDUCIAIRE'\nWHEN {{ ff_ccodro }} = 'M' THEN 'OCCUPANT D UNE PARCELLE APPARTENANT AU DEPARTEMENT DE MAYOTTE OU A L ETAT'\nWHEN {{ ff_ccodro }} = 'Z' THEN 'GESTIONNAIRE D UN BIEN DE L ETAT'\nWHEN {{ ff_ccodro }} = 'B' THEN 'BAILLEUR A CONSTRUCTION'\nELSE 'NON SPECIFIE'\nEND\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.889612, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.890788, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.890879, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.892208, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8928971, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.8932118, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.893325, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n with relations AS (\n select\n t.table_name\n , t.database_name\n , t.schema_name\n , 'BASE TABLE' as table_type\n , {{ adapter.catalog_comment('t') }} as table_comment\n from duckdb_tables() t\n WHERE t.database_name = '{{ database }}'\n UNION ALL\n SELECT v.view_name as table_name\n , v.database_name\n , v.schema_name\n , 'VIEW' as table_type\n , {{ adapter.catalog_comment('v') }} as table_comment\n from duckdb_views() v\n WHERE v.database_name = '{{ database }}'\n )\n select\n '{{ database }}' as table_database,\n r.schema_name as table_schema,\n r.table_name,\n r.table_type,\n r.table_comment,\n c.column_name,\n c.column_index as column_index,\n c.data_type as column_type,\n {{ adapter.catalog_comment('c') }} as column_comment,\n '' as table_owner\n FROM relations r JOIN duckdb_columns() c ON r.schema_name = c.schema_name AND r.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(r.schema_name) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ORDER BY\n r.schema_name,\n r.table_name,\n c.column_index\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.894131, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n {% set sql %}\n select type from duckdb_databases()\n where database_name='{{ relation.database }}'\n and type='sqlite'\n {% endset %}\n {% set results = run_query(sql) %}\n {% if results|length == 0 %}\n create schema if not exists {{ relation.without_identifier() }}\n {% else %}\n {% if relation.schema!='main' %}\n {{ exceptions.raise_compiler_error(\n \"Schema must be 'main' when writing to sqlite \"\n ~ \"instead got \" ~ relation.schema\n )}}\n {% endif %}\n {% endif %}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.89994, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.900078, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.900279, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.900465, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9007308, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.901577, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9017081, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9020119, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9023821, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9026382, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9027991, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.903022, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.90328, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.903338, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9034681, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9035468, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9036539, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.903766, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9039261, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format, config) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format, config) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.904139, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% if options is not mapping %}\n {% do exceptions.raise_compiler_error(\"The options argument must be a dictionary\") %}\n {% endif %}\n\n {% for k in options %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9048991, "supported_languages": null}, "macro.dbt_duckdb.duckdb_escape_comment": {"name": "duckdb_escape_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb_escape_comment", "macro_sql": "{% macro duckdb_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9056551, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_comment": {"name": "duckdb__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_comment", "macro_sql": "{% macro duckdb__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.905844, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_column_comment": {"name": "duckdb__alter_column_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_column_comment", "macro_sql": "{% macro duckdb__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.906301, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.907726, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.908437, "supported_languages": null}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.910474, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {%- set partition_columns = config.get('partition_columns', []) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.914411, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n -- only create temp tables if using local duckdb, as it is not currently supported for remote databases\n {%- set temporary = not adapter.is_motherduck() -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if not temporary %}\n -- if not using a temporary table we will update the temp relation to use a different temp schema (\"dbt_temp\" by default)\n {% set temp_relation = temp_relation.incorporate(path=adapter.get_temp_relation_path(this)) %}\n {% do run_query(create_schema(temp_relation)) %}\n -- then drop the temp relation after we insert the incremental data into the target relation\n {% do to_drop.append(temp_relation) %}\n {% endif %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(temporary, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.create_schema", "macro.dbt.statement", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.91908, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n date_add({{ from_date_or_timestamp }}, interval ({{ interval }}) {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.919263, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9197068, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n date_diff('{{ datepart }}', {{ first_date }}::timestamp, {{ second_date}}::timestamp )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9198651, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9199622, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.921706, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9218738, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.922244, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.922652, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.923433, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.923577, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.923682, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.923788, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9238908, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9241679, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.924383, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.924611, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.924937, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.925366, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.928266, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.928393, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.928571, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.929088, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.929214, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.929356, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9303958, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.931446, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9342022, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.93441, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9345438, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.934609, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.934718, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.934805, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9349508, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.935615, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.935751, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9359329, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.936237, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.940493, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.942538, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.943388, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.943608, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.943756, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.944192, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.944462, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9447339, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.946034, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.949615, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.949894, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.950078, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9510489, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9512188, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.951683, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9537768, "supported_languages": ["sql"]}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9558458, "supported_languages": ["sql"]}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9570189, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.957409, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9578822, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.958056, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.958575, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.962647, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.963843, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.964035, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9647639, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.964962, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9654279, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.965872, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.966518, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.96669, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.966828, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9670432, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.967181, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.967403, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.967541, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.967734, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.967869, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9679801, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9681869, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9718442, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9756649, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.976528, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9773812, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9780061, "supported_languages": null}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9781818, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.978268, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.978482, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.978581, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.981171, "supported_languages": ["sql"]}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.983522, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9870248, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.98768, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.987864, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.988205, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.988346, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.988443, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9885461, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.988631, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9887471, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.988833, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.989193, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9893289, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.990284, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.990593, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.990871, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.991264, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9914508, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.991654, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.991942, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.99213, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.992652, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.992918, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.993054, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.993217, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.993357, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9939651, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9948711, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.995148, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.995327, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9955242, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.995682, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.995914, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.996066, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.996578, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.996889, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.997045, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.99728, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.997544, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.997746, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.998085, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9984078, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.998647, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.998801, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.998992, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.999072, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.99927, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9994318, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.999661, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9997609, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418958.9999611, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.000067, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.000505, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.000639, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.000844, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.000948, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.001146, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0012538, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0019882, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0020769, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0024588, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.002582, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0026839, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.003645, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.format_column", "macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.003925, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0041752, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.004357, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.004435, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.004632, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.004739, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.004936, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0050418, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0056698, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.005804, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.006113, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.00661, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.006944, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.007078, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.007213, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.007395, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.007471, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0081012, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.008209, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.009094, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.009239, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.009401, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.009601, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.009707, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.010006, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.010122, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.010253, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0105548, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.010817, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.011033, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.011224, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.011633, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.012697, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.013273, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.013487, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0148108, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.01565, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0161831, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.016347, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.016514, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.01657, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0170848, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.017514, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.017683, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0179489, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.018194, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.018406, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.018641, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.018764, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0189419, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.019032, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.019635, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.019991, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.020127, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.020503, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.020691, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.02077, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.021012, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.021138, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.021298, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.021355, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.021545, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0216472, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.021858, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0219588, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0224042, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.022699, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.022943, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.023067, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0232792, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.023388, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.023585, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.023703, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.023941, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.024058, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0242612, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.024357, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.024561, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.024642, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.024857, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.024956, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0251431, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.025227, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0259578, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.026072, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.026193, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.026304, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0264199, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0265448, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.026679, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0268102, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.026929, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0270941, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.027213, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0273259, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.027443, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.027549, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.027751, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.027853, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0280352, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0281181, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.028364, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0285661, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.028673, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0290592, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.029189, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.029354, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.029554, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0296478, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0299242, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.030097, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03031, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.030463, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0307531, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.030895, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03102, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0311859, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.031588, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.031706, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03181, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.031887, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.032005, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0320609, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03218, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.032298, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03291, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0330088, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.033122, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0334148, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0336041, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.033706, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03382, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0339131, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0353248, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0354502, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.035611, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.035823, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0359979, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0362308, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.036366, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0364852, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03666, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.037059, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03723, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.037334, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.037636, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.037937, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0381398, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.038362, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.039593, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.039677, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.039799, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.03988, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0401511, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0402849, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.040363, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.040524, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.040666, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.040829, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.040965, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.041134, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.041627, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.041767, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.041947, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.042114, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.042984, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header -%}\n {{ sql_header }}\n {%- endif -%}\n {%- if limit is not none -%}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n {%- else -%}\n {{ compiled_code }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.043373, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.043514, "supported_languages": null}, "macro.dbt.default__get_limit_subquery_sql": {"name": "default__get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_subquery_sql", "macro_sql": "{% macro default__get_limit_subquery_sql(sql, limit) %}\n select *\n from (\n {{ sql }}\n ) as model_limit_subq\n limit {{ limit }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.043617, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0441139, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.044235, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.044381, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0445051, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.044702, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.045046, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0471418, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0473258, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.047471, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.047654, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.04779, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.047904, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.048037, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.048219, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.048419, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.04864, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.048776, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.048892, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.04901, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0491269, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.049284, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.049424, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.051044, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.05116, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.05138, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.051539, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.051685, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0518148, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0527208, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.05297, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.053113, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.053359, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.053526, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.053948, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0541341, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.054689, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0571, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0575008, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.058301, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.059485, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.059598, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.060183, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0604758, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0608928, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.061244, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0613, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.061683, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.061864, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.062088, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0623639, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.062614, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.062966, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.063294, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.063766, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.064001, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.064233, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.065021, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0657768, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0663931, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.067209, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0676851, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.067936, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.068467, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.069126, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.06948, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.069813, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.070267, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0706098, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0710242, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0713332, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.071687, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.072056, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.072542, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.07307, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.073506, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.073758, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.074049, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.074304, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0747762, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.07554, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.076189, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.076842, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.077423, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0780602, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.078414, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.078629, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.081012, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.082113, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.082313, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.082434, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.082755, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.082956, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0830982, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.083284, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0834088, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.083851, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.084506, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.085008, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0854368, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.085608, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0858722, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.086098, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.086348, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.086825, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0874538, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.088064, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.088353, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.08849, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.088861, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0893319, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.089938, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0902321, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.090438, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.09129, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.092361, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.093308, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0944462, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.0946612, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.094764, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.096885, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.099369, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.099591, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.099769, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.100319, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.100482, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1006238, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.100769, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1008902, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.101015, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.101305, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.101482, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.10176, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.102148, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1024, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.102638, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.10382, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.104081, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.104656, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.105014, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.105798, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.106894, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.10765, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.108246, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1085892, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1091142, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.110153, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.110496, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"name": "redshift__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.110846, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1109838, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.111271, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.111705, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.112066, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.112545, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.112841, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.112946, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.113049, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.113419, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.114018, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.11487, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.115078, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1154869, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.116073, "supported_languages": null}, "macro.codegen.generate_model_import_ctes": {"name": "generate_model_import_ctes", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_model_import_ctes.sql", "original_file_path": "macros/generate_model_import_ctes.sql", "unique_id": "macro.codegen.generate_model_import_ctes", "macro_sql": "{% macro generate_model_import_ctes(model_name, leading_commas = False) %}\n {{ return(adapter.dispatch('generate_model_import_ctes', 'codegen')(model_name, leading_commas)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.default__generate_model_import_ctes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1205819, "supported_languages": null}, "macro.codegen.default__generate_model_import_ctes": {"name": "default__generate_model_import_ctes", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_model_import_ctes.sql", "original_file_path": "macros/generate_model_import_ctes.sql", "unique_id": "macro.codegen.default__generate_model_import_ctes", "macro_sql": "{% macro default__generate_model_import_ctes(model_name, leading_commas) %}\n\n {%- if execute -%}\n {%- set nodes = graph.nodes.values() -%}\n\n {%- set model = (nodes\n | selectattr('name', 'equalto', model_name) \n | selectattr('resource_type', 'equalto', 'model')\n | list).pop() -%}\n\n {%- set model_raw_sql = model.raw_sql or model.raw_code -%}\n {%- else -%}\n {%- set model_raw_sql = '' -%}\n {%- endif -%}\n\n {#-\n\n REGEX Explanations\n\n # with_regex\n - matches (start of file followed by anything then whitespace\n or whitespace\n or a comma) followed by the word with then a space \n\n # from_ref \n - matches (from or join) followed by some spaces and then {{ref()}}\n\n # from_source \n - matches (from or join) followed by some spaces and then {{source(,)}}\n\n # from_var_1\n - matches (from or join) followed by some spaces and then {{var()}}\n\n # from_var_2\n - matches (from or join) followed by some spaces and then {{var(,)}}\n\n # from_table_1\n - matches (from or join) followed by some spaces and then .\n where each is enclosed by (` or [ or \" or ' or nothing)\n\n # from_table_2\n - matches (from or join) followed by some spaces and then ..\n where each is enclosed by (` or [ or \" or ' or nothing)\n\n # from_table_3\n - matches (from or join) followed by some spaces and then \n where is enclosed by (` or [ or \" or ')\n\n # config block\n - matches the start of the file followed by anything and then {{config()}}\n\n -#}\n\n {%- set re = modules.re -%}\n\n {%- set with_regex = '(?i)(?s)(^.*\\s*|\\s+|,)with\\s' -%}\n {%- set does_raw_sql_contain_cte = re.search(with_regex, model_raw_sql) -%}\n\n {%- set from_regexes = {\n 'from_ref':\n '(?ix)\n\n # first matching group\n # from or join followed by at least 1 whitespace character\n (from|join)\\s+\n\n # second matching group\n # opening {{, 0 or more whitespace character(s), ref, 0 or more whitespace character(s), an opening parenthesis, 0 or more whitespace character(s), 1 or 0 quotation mark\n ({{\\s*ref\\s*\\(\\s*[\\'\\\"]?)\n \n # third matching group\n # at least 1 of anything except a parenthesis or quotation mark\n ([^)\\'\\\"]+)\n \n # fourth matching group\n # 1 or 0 quotation mark, 0 or more whitespace character(s)\n ([\\'\\\"]?\\s*)\n\n # fifth matching group\n # a closing parenthesis, 0 or more whitespace character(s), closing }}\n (\\)\\s*}})\n \n ',\n 'from_source':\n '(?ix)\n\n # first matching group\n # from or join followed by at least 1 whitespace character\n (from|join)\\s+\n\n # second matching group\n # opening {{, 0 or more whitespace character(s), source, 0 or more whitespace character(s), an opening parenthesis, 0 or more whitespace character(s), 1 or 0 quotation mark\n ({{\\s*source\\s*\\(\\s*[\\'\\\"]?)\n\n # third matching group\n # at least 1 of anything except a parenthesis or quotation mark\n ([^)\\'\\\"]+)\n\n # fourth matching group\n # 1 or 0 quotation mark, 0 or more whitespace character(s)\n ([\\'\\\"]?\\s*)\n\n # fifth matching group\n # a comma\n (,)\n\n # sixth matching group\n # 0 or more whitespace character(s), 1 or 0 quotation mark\n (\\s*[\\'\\\"]?)\n\n # seventh matching group\n # at least 1 of anything except a parenthesis or quotation mark\n ([^)\\'\\\"]+)\n\n # eighth matching group\n # 1 or 0 quotation mark, 0 or more whitespace character(s)\n ([\\'\\\"]?\\s*)\n\n # ninth matching group\n # a closing parenthesis, 0 or more whitespace character(s), closing }}\n (\\)\\s*}})\n\n ',\n 'from_var_1':\n '(?ix)\n\n # first matching group\n # from or join followed by at least 1 whitespace character\n (from|join)\\s+\n\n # second matching group\n # opening {{, 0 or more whitespace character(s), var, 0 or more whitespace character(s), an opening parenthesis, 0 or more whitespace character(s), 1 or 0 quotation mark\n ({{\\s*var\\s*\\(\\s*[\\'\\\"]?)\n\n # third matching group\n # at least 1 of anything except a parenthesis or quotation mark\n ([^)\\'\\\"]+)\n\n # fourth matching group\n # 1 or 0 quotation mark, 0 or more whitespace character(s)\n ([\\'\\\"]?\\s*)\n\n # fifth matching group\n # a closing parenthesis, 0 or more whitespace character(s), closing }}\n (\\)\\s*}})\n \n ',\n 'from_var_2':\n '(?ix)\n\n # first matching group\n # from or join followed by at least 1 whitespace character\n (from|join)\\s+\n \n # second matching group\n # opening {{, 0 or more whitespace character(s), var, 0 or more whitespace character(s), an opening parenthesis, 0 or more whitespace character(s), 1 or 0 quotation mark\n ({{\\s*var\\s*\\(\\s*[\\'\\\"]?)\n\n # third matching group\n # at least 1 of anything except a parenthesis or quotation mark \n ([^)\\'\\\"]+)\n \n # fourth matching group\n # 1 or 0 quotation mark, 0 or more whitespace character(s)\n ([\\'\\\"]?\\s*)\n\n # fifth matching group\n # a comma\n (,)\n\n # sixth matching group\n # 0 or more whitespace character(s), 1 or 0 quotation mark \n (\\s*[\\'\\\"]?)\n\n # seventh matching group\n # at least 1 of anything except a parenthesis or quotation mark \n ([^)\\'\\\"]+)\n\n # eighth matching group\n # 1 or 0 quotation mark, 0 or more whitespace character(s) \n ([\\'\\\"]?\\s*)\n\n # ninth matching group\n # a closing parenthesis, 0 or more whitespace character(s), closing }} \n (\\)\\s*}})\n \n ',\n 'from_table_1':\n '(?ix)\n \n # first matching group\n # from or join followed by at least 1 whitespace character \n (from|join)\\s+\n \n # second matching group\n # 1 or 0 of (opening bracket, backtick, or quotation mark)\n ([\\[`\\\"\\']?)\n \n # third matching group\n # at least 1 word character\n (\\w+)\n \n # fouth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark)\n ([\\]`\\\"\\']?)\n \n # fifth matching group\n # a period\n (\\.)\n \n # sixth matching group\n # 1 or 0 of (opening bracket, backtick, or quotation mark)\n ([\\[`\\\"\\']?)\n \n # seventh matching group\n # at least 1 word character\n (\\w+)\n \n # eighth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark) folowed by a whitespace character or end of string\n ([\\]`\\\"\\']?)(?=\\s|$)\n \n ',\n 'from_table_2':\n '(?ix)\n\n # first matching group\n # from or join followed by at least 1 whitespace character \n (from|join)\\s+\n \n # second matching group\n # 1 or 0 of (opening bracket, backtick, or quotation mark) \n ([\\[`\\\"\\']?)\n \n # third matching group\n # at least 1 word character\n (\\w+)\n\n # fouth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark) \n ([\\]`\\\"\\']?)\n \n # fifth matching group\n # a period \n (\\.)\n \n # sixth matching group\n # 1 or 0 of (opening bracket, backtick, or quotation mark)\n ([\\[`\\\"\\']?)\n\n # seventh matching group\n # at least 1 word character \n (\\w+)\n \n # eighth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark) \n ([\\]`\\\"\\']?)\n \n # ninth matching group\n # a period \n (\\.)\n \n # tenth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark) \n ([\\[`\\\"\\']?)\n \n # eleventh matching group\n # at least 1 word character \n (\\w+)\n\n # twelfth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark) folowed by a whitespace character or end of string\n ([\\]`\\\"\\']?)(?=\\s|$)\n \n ',\n 'from_table_3':\n '(?ix)\n\n # first matching group\n # from or join followed by at least 1 whitespace character \n (from|join)\\s+\n \n # second matching group\n # 1 or 0 of (opening bracket, backtick, or quotation mark) \n ([\\[`\\\"\\'])\n \n # third matching group\n # at least 1 word character or space \n ([\\w ]+)\n\n # fourth matching group\n # 1 or 0 of (closing bracket, backtick, or quotation mark) folowed by a whitespace character or end of string\n ([\\]`\\\"\\'])(?=\\s|$)\n \n ',\n 'config_block':'(?i)(?s)^.*{{\\s*config\\s*\\([^)]+\\)\\s*}}'\n } -%}\n\n {%- set from_list = [] -%}\n {%- set config_list = [] -%}\n {%- set ns = namespace(model_sql = model_raw_sql) -%}\n\n {%- for regex_name, regex_pattern in from_regexes.items() -%}\n\n {%- set all_regex_matches = re.findall(regex_pattern, model_raw_sql) -%}\n\n {%- for match in all_regex_matches -%}\n\n {%- if regex_name == 'config_block' -%}\n {%- set match_tuple = (match|trim, regex_name) -%}\n {%- do config_list.append(match_tuple) -%}\n {%- elif regex_name == 'from_source' -%} \n {%- set full_from_clause = match[1:]|join|trim -%}\n {%- set cte_name = 'source_' + match[6]|lower -%}\n {%- set match_tuple = (cte_name, full_from_clause, regex_name) -%}\n {%- do from_list.append(match_tuple) -%} \n {%- elif regex_name == 'from_table_1' -%}\n {%- set full_from_clause = match[1:]|join()|trim -%}\n {%- set cte_name = match[2]|lower + '_' + match[6]|lower -%}\n {%- set match_tuple = (cte_name, full_from_clause, regex_name) -%}\n {%- do from_list.append(match_tuple) -%} \n {%- elif regex_name == 'from_table_2' -%}\n {%- set full_from_clause = match[1:]|join()|trim -%}\n {%- set cte_name = match[2]|lower + '_' + match[6]|lower + '_' + match[10]|lower -%}\n {%- set match_tuple = (cte_name, full_from_clause, regex_name) -%}\n {%- do from_list.append(match_tuple) -%} \n {%- else -%}\n {%- set full_from_clause = match[1:]|join|trim -%}\n {%- set cte_name = match[2]|trim|lower -%}\n {%- set match_tuple = (cte_name, full_from_clause, regex_name) -%}\n {%- do from_list.append(match_tuple) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if regex_name == 'config_block' -%}\n {%- elif regex_name == 'from_source' -%}\n {%- set ns.model_sql = re.sub(regex_pattern, '\\g<1> source_\\g<7>', ns.model_sql) -%} \n {%- elif regex_name == 'from_table_1' -%}\n {%- set ns.model_sql = re.sub(regex_pattern, '\\g<1> \\g<3>_\\g<7>', ns.model_sql) -%} \n {%- elif regex_name == 'from_table_2' -%}\n {%- set ns.model_sql = re.sub(regex_pattern, '\\g<1> \\g<3>_\\g<7>_\\g<11>', ns.model_sql) -%} \n {%- else -%} \n {%- set ns.model_sql = re.sub(regex_pattern, '\\g<1> \\g<3>', ns.model_sql) -%} \n {% endif %}\n\n {%- endfor -%}\n\n{%- if from_list|length > 0 -%}\n\n{%- set model_import_ctes -%}\n\n {%- for config_obj in config_list -%}\n\n {%- set ns.model_sql = ns.model_sql|replace(config_obj[0], '') -%}\n\n{{ config_obj[0] }}\n\n{% endfor -%}\n\n {%- for from_obj in from_list|unique|sort -%}\n\n{%- if loop.first -%}with {% else -%}{%- if leading_commas -%},{%- endif -%}{%- endif -%}{{ from_obj[0] }} as (\n\n select * from {{ from_obj[1] }}\n {%- if from_obj[2] == 'from_source' and from_list|length > 1 %} \n -- CAUTION: It's best practice to create staging layer for raw sources\n {%- elif from_obj[2] == 'from_table_1' or from_obj[2] == 'from_table_2' or from_obj[2] == 'from_table_3' %}\n -- CAUTION: It's best practice to use the ref or source function instead of a direct reference\n {%- elif from_obj[2] == 'from_var_1' or from_obj[2] == 'from_var_2' %}\n -- CAUTION: It's best practice to use the ref or source function instead of a var\n {%- endif %}\n \n){%- if ((loop.last and does_raw_sql_contain_cte) or (not loop.last)) and not leading_commas -%},{%- endif %}\n\n{% endfor -%}\n\n{%- if does_raw_sql_contain_cte -%}\n {%- if leading_commas -%}\n {%- set replace_with = '\\g<1>,' -%}\n {%- else -%}\n {%- set replace_with = '\\g<1>' -%}\n {%- endif -%}\n{{ re.sub(with_regex, replace_with, ns.model_sql, 1)|trim }}\n{%- else -%}\n{{ ns.model_sql|trim }}\n{%- endif -%}\n\n{%- endset -%}\n\n{%- else -%}\n\n{% set model_import_ctes = model_raw_sql %}\n\n{%- endif -%}\n\n{%- if execute -%}\n\n{{ print(model_import_ctes) }}\n{% do return(model_import_ctes) %}\n\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.124404, "supported_languages": null}, "macro.codegen.generate_column_yaml": {"name": "generate_column_yaml", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_model_yaml.sql", "original_file_path": "macros/generate_model_yaml.sql", "unique_id": "macro.codegen.generate_column_yaml", "macro_sql": "{% macro generate_column_yaml(column, model_yaml, column_desc_dict, include_data_types, parent_column_name=\"\") %}\n {{ return(adapter.dispatch('generate_column_yaml', 'codegen')(column, model_yaml, column_desc_dict, include_data_types, parent_column_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.default__generate_column_yaml"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1259599, "supported_languages": null}, "macro.codegen.default__generate_column_yaml": {"name": "default__generate_column_yaml", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_model_yaml.sql", "original_file_path": "macros/generate_model_yaml.sql", "unique_id": "macro.codegen.default__generate_column_yaml", "macro_sql": "{% macro default__generate_column_yaml(column, model_yaml, column_desc_dict, include_data_types, parent_column_name) %}\n {% if parent_column_name %}\n {% set column_name = parent_column_name ~ \".\" ~ column.name %}\n {% else %}\n {% set column_name = column.name %}\n {% endif %}\n\n {% do model_yaml.append(' - name: ' ~ column_name | lower ) %}\n {% if include_data_types %}\n {% do model_yaml.append(' data_type: ' ~ codegen.data_type_format_model(column)) %}\n {% endif %}\n {% do model_yaml.append(' description: \"' ~ column_desc_dict.get(column.name | lower,'') ~ '\"') %}\n {% do model_yaml.append('') %}\n\n {% if column.fields|length > 0 %}\n {% for child_column in column.fields %}\n {% set model_yaml = codegen.generate_column_yaml(child_column, model_yaml, column_desc_dict, include_data_types, parent_column_name=column_name) %}\n {% endfor %}\n {% endif %}\n {% do return(model_yaml) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.data_type_format_model", "macro.codegen.generate_column_yaml"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.126689, "supported_languages": null}, "macro.codegen.generate_model_yaml": {"name": "generate_model_yaml", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_model_yaml.sql", "original_file_path": "macros/generate_model_yaml.sql", "unique_id": "macro.codegen.generate_model_yaml", "macro_sql": "{% macro generate_model_yaml(model_names=[], upstream_descriptions=False, include_data_types=True) -%}\n {{ return(adapter.dispatch('generate_model_yaml', 'codegen')(model_names, upstream_descriptions, include_data_types)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.codegen.default__generate_model_yaml"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.126888, "supported_languages": null}, "macro.codegen.default__generate_model_yaml": {"name": "default__generate_model_yaml", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_model_yaml.sql", "original_file_path": "macros/generate_model_yaml.sql", "unique_id": "macro.codegen.default__generate_model_yaml", "macro_sql": "{% macro default__generate_model_yaml(model_names, upstream_descriptions, include_data_types) %}\n\n {% set model_yaml=[] %}\n\n {% do model_yaml.append('version: 2') %}\n {% do model_yaml.append('') %}\n {% do model_yaml.append('models:') %}\n\n {% if model_names is string %}\n {{ exceptions.raise_compiler_error(\"The `model_names` argument must always be a list, even if there is only one model.\") }}\n {% else %}\n {% for model in model_names %}\n {% do model_yaml.append(' - name: ' ~ model | lower) %}\n {% do model_yaml.append(' description: \"\"') %}\n {% do model_yaml.append(' columns:') %}\n\n {% set relation=ref(model) %}\n {%- set columns = adapter.get_columns_in_relation(relation) -%}\n {% set column_desc_dict = codegen.build_dict_column_descriptions(model) if upstream_descriptions else {} %}\n\n {% for column in columns %}\n {% set model_yaml = codegen.generate_column_yaml(column, model_yaml, column_desc_dict, include_data_types) %}\n {% endfor %}\n {% endfor %}\n {% endif %}\n\n{% if execute %}\n\n {% set joined = model_yaml | join ('\\n') %}\n {{ print(joined) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.build_dict_column_descriptions", "macro.codegen.generate_column_yaml"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1277828, "supported_languages": null}, "macro.codegen.create_base_models": {"name": "create_base_models", "resource_type": "macro", "package_name": "codegen", "path": "macros/create_base_models.sql", "original_file_path": "macros/create_base_models.sql", "unique_id": "macro.codegen.create_base_models", "macro_sql": "{% macro create_base_models(source_name, tables) %}\n {{ return(adapter.dispatch('create_base_models', 'codegen')(source_name, tables)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.default__create_base_models"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.128094, "supported_languages": null}, "macro.codegen.default__create_base_models": {"name": "default__create_base_models", "resource_type": "macro", "package_name": "codegen", "path": "macros/create_base_models.sql", "original_file_path": "macros/create_base_models.sql", "unique_id": "macro.codegen.default__create_base_models", "macro_sql": "{% macro default__create_base_models(source_name, tables) %}\n\n{% set source_name = \"\"~ source_name ~\"\" %}\n\n{% set zsh_command_models = \"source dbt_packages/codegen/bash_scripts/base_model_creation.sh \"\"\"~ source_name ~\"\"\" \" %}\n\n{%- set models_array = [] -%}\n\n{% for t in tables %}\n {% set help_command = zsh_command_models + t %}\n {{ models_array.append(help_command) }}\n{% endfor %}\n\n{{ log(\"Run these commands in your shell to generate the models:\\n\" ~ models_array|join(' && \\n'), info=True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.128464, "supported_languages": null}, "macro.codegen.generate_base_model": {"name": "generate_base_model", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_base_model.sql", "original_file_path": "macros/generate_base_model.sql", "unique_id": "macro.codegen.generate_base_model", "macro_sql": "{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False, materialized=None) %}\n {{ return(adapter.dispatch('generate_base_model', 'codegen')(source_name, table_name, leading_commas, case_sensitive_cols, materialized)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.default__generate_base_model"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.12931, "supported_languages": null}, "macro.codegen.default__generate_base_model": {"name": "default__generate_base_model", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_base_model.sql", "original_file_path": "macros/generate_base_model.sql", "unique_id": "macro.codegen.default__generate_base_model", "macro_sql": "{% macro default__generate_base_model(source_name, table_name, leading_commas, case_sensitive_cols, materialized) %}\n\n{%- set source_relation = source(source_name, table_name) -%}\n\n{%- set columns = adapter.get_columns_in_relation(source_relation) -%}\n{% set column_names=columns | map(attribute='name') %}\n{% set base_model_sql %}\n\n{%- if materialized is not none -%}\n {{ \"{{ config(materialized='\" ~ materialized ~ \"') }}\" }}\n{%- endif %}\n\nwith source as (\n\n select * from {% raw %}{{ source({% endraw %}'{{ source_name }}', '{{ table_name }}'{% raw %}) }}{% endraw %}\n\n),\n\nrenamed as (\n\n select\n {%- if leading_commas -%}\n {%- for column in column_names %}\n {{\", \" if not loop.first}}{% if not case_sensitive_cols %}{{ column | lower }}{% elif target.type == \"bigquery\" %}{{ column }}{% else %}{{ \"\\\"\" ~ column ~ \"\\\"\" }}{% endif %}\n {%- endfor %}\n {%- else -%}\n {%- for column in column_names %}\n {% if not case_sensitive_cols %}{{ column | lower }}{% elif target.type == \"bigquery\" %}{{ column }}{% else %}{{ \"\\\"\" ~ column ~ \"\\\"\" }}{% endif %}{{\",\" if not loop.last}}\n {%- endfor -%}\n {%- endif %}\n\n from source\n\n)\n\nselect * from renamed\n{% endset %}\n\n{% if execute %}\n\n{{ print(base_model_sql) }}\n{% do return(base_model_sql) %}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.130228, "supported_languages": null}, "macro.codegen.get_tables_in_schema": {"name": "get_tables_in_schema", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_source.sql", "original_file_path": "macros/generate_source.sql", "unique_id": "macro.codegen.get_tables_in_schema", "macro_sql": "{% macro get_tables_in_schema(schema_name, database_name=target.database, table_pattern='%', exclude='') %}\n \n {% set tables=dbt_utils.get_relations_by_pattern(\n schema_pattern=schema_name,\n database=database_name,\n table_pattern=table_pattern,\n exclude=exclude\n ) %}\n\n {% set table_list= tables | map(attribute='identifier') %}\n\n {{ return(table_list | sort) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.13201, "supported_languages": null}, "macro.codegen.generate_source": {"name": "generate_source", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_source.sql", "original_file_path": "macros/generate_source.sql", "unique_id": "macro.codegen.generate_source", "macro_sql": "{% macro generate_source(schema_name, database_name=target.database, generate_columns=False, include_descriptions=False, include_data_types=True, table_pattern='%', exclude='', name=schema_name, table_names=None, include_database=False, include_schema=False) %}\n {{ return(adapter.dispatch('generate_source', 'codegen')(schema_name, database_name, generate_columns, include_descriptions, include_data_types, table_pattern, exclude, name, table_names, include_database, include_schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.default__generate_source"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.132395, "supported_languages": null}, "macro.codegen.default__generate_source": {"name": "default__generate_source", "resource_type": "macro", "package_name": "codegen", "path": "macros/generate_source.sql", "original_file_path": "macros/generate_source.sql", "unique_id": "macro.codegen.default__generate_source", "macro_sql": "{% macro default__generate_source(schema_name, database_name, generate_columns, include_descriptions, include_data_types, table_pattern, exclude, name, table_names, include_database, include_schema) %}\n\n{% set sources_yaml=[] %}\n{% do sources_yaml.append('version: 2') %}\n{% do sources_yaml.append('') %}\n{% do sources_yaml.append('sources:') %}\n{% do sources_yaml.append(' - name: ' ~ name | lower) %}\n\n{% if include_descriptions %}\n {% do sources_yaml.append(' description: \"\"' ) %}\n{% endif %}\n\n{% if database_name != target.database or include_database %}\n{% do sources_yaml.append(' database: ' ~ database_name | lower) %}\n{% endif %}\n\n{% if schema_name != name or include_schema %}\n{% do sources_yaml.append(' schema: ' ~ schema_name | lower) %}\n{% endif %}\n\n{% do sources_yaml.append(' tables:') %}\n\n{% if table_names is none %}\n{% set tables=codegen.get_tables_in_schema(schema_name, database_name, table_pattern, exclude) %}\n{% else %}\n{% set tables = table_names %}\n{% endif %}\n\n{% for table in tables %}\n {% do sources_yaml.append(' - name: ' ~ table | lower ) %}\n {% if include_descriptions %}\n {% do sources_yaml.append(' description: \"\"' ) %}\n {% endif %}\n {% if generate_columns %}\n {% do sources_yaml.append(' columns:') %}\n\n {% set table_relation=api.Relation.create(\n database=database_name,\n schema=schema_name,\n identifier=table\n ) %}\n\n {% set columns=adapter.get_columns_in_relation(table_relation) %}\n\n {% for column in columns %}\n {% do sources_yaml.append(' - name: ' ~ column.name | lower ) %}\n {% if include_data_types %}\n {% do sources_yaml.append(' data_type: ' ~ codegen.data_type_format_source(column)) %}\n {% endif %}\n {% if include_descriptions %}\n {% do sources_yaml.append(' description: \"\"' ) %}\n {% endif %}\n {% endfor %}\n {% do sources_yaml.append('') %}\n\n {% endif %}\n\n{% endfor %}\n\n{% if execute %}\n\n {% set joined = sources_yaml | join ('\\n') %}\n {{ print(joined) }}\n {% do return(joined) %}\n\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.get_tables_in_schema", "macro.codegen.data_type_format_source"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.134096, "supported_languages": null}, "macro.codegen.format_column": {"name": "format_column", "resource_type": "macro", "package_name": "codegen", "path": "macros/vendored/dbt_core/format_column.sql", "original_file_path": "macros/vendored/dbt_core/format_column.sql", "unique_id": "macro.codegen.format_column", "macro_sql": "{% macro format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.134426, "supported_languages": null}, "macro.codegen.get_model_dependencies": {"name": "get_model_dependencies", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.get_model_dependencies", "macro_sql": "{% macro get_model_dependencies(model_name) %}\n {% for node in graph.nodes.values() | selectattr('name', \"equalto\", model_name) %}\n {{ return(node.depends_on.nodes) }}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.135416, "supported_languages": null}, "macro.codegen.add_model_column_descriptions_to_dict": {"name": "add_model_column_descriptions_to_dict", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.add_model_column_descriptions_to_dict", "macro_sql": "{% macro add_model_column_descriptions_to_dict(model_name,dict_with_descriptions={}) %}\n {% for node in graph.nodes.values() | selectattr('name', \"equalto\", model_name) %}\n {% for col_name, col_values in node.columns.items() %}\n {% do dict_with_descriptions.update( {col_name: col_values.description} ) %}\n {% endfor %}\n {% endfor %}\n {{ return(dict_with_descriptions) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1357598, "supported_languages": null}, "macro.codegen.build_dict_column_descriptions": {"name": "build_dict_column_descriptions", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.build_dict_column_descriptions", "macro_sql": "{% macro build_dict_column_descriptions(model_name) %}\n {% if execute %}\n {% set glob_dict = {} %}\n {% for full_model in codegen.get_model_dependencies(model_name) %}\n {% do codegen.add_model_column_descriptions_to_dict(full_model.split('.')[-1],glob_dict) %}\n {% endfor %}\n {{ return(glob_dict) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.get_model_dependencies", "macro.codegen.add_model_column_descriptions_to_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.136075, "supported_languages": null}, "macro.codegen.get_models": {"name": "get_models", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.get_models", "macro_sql": "{% macro get_models(directory=None, prefix=None) %}\n {% set model_names=[] %}\n {% set models = graph.nodes.values() | selectattr('resource_type', \"equalto\", 'model') %}\n {% if directory and prefix %}\n {% for model in models %}\n {% set model_path = \"/\".join(model.path.split(\"/\")[:-1]) %}\n {% if model_path == directory and model.name.startswith(prefix) %}\n {% do model_names.append(model.name) %}\n {% endif %} \n {% endfor %}\n {% elif directory %}\n {% for model in models %}\n {% set model_path = \"/\".join(model.path.split(\"/\")[:-1]) %}\n {% if model_path == directory %}\n {% do model_names.append(model.name) %}\n {% endif %}\n {% endfor %}\n {% elif prefix %}\n {% for model in models if model.name.startswith(prefix) %}\n {% do model_names.append(model.name) %}\n {% endfor %}\n {% else %}\n {% for model in models %}\n {% do model_names.append(model.name) %}\n {% endfor %}\n {% endif %}\n {{ return(model_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.137079, "supported_languages": null}, "macro.codegen.data_type_format_source": {"name": "data_type_format_source", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.data_type_format_source", "macro_sql": "{% macro data_type_format_source(column) -%}\n {{ return(adapter.dispatch('data_type_format_source', 'codegen')(column)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.codegen.default__data_type_format_source"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1372218, "supported_languages": null}, "macro.codegen.default__data_type_format_source": {"name": "default__data_type_format_source", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.default__data_type_format_source", "macro_sql": "{% macro default__data_type_format_source(column) %}\n {% set formatted = codegen.format_column(column) %}\n {{ return(formatted['data_type'] | lower) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.137383, "supported_languages": null}, "macro.codegen.data_type_format_model": {"name": "data_type_format_model", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.data_type_format_model", "macro_sql": "{% macro data_type_format_model(column) -%}\n {{ return(adapter.dispatch('data_type_format_model', 'codegen')(column)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.codegen.default__data_type_format_model"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.137512, "supported_languages": null}, "macro.codegen.default__data_type_format_model": {"name": "default__data_type_format_model", "resource_type": "macro", "package_name": "codegen", "path": "macros/helpers/helpers.sql", "original_file_path": "macros/helpers/helpers.sql", "unique_id": "macro.codegen.default__data_type_format_model", "macro_sql": "{% macro default__data_type_format_model(column) %}\n {% set formatted = codegen.format_column(column) %}\n {{ return(formatted['data_type'] | lower) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.codegen.format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.137674, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.143976, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.145636, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.147278, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.148504, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1490428, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.149527, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.150096, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.150611, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.151038, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.15122, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.151489, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.152104, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.152405, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.152552, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1529212, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.153168, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.15358, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.154766, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.155241, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.155931, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1561, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1562371, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1565068, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.156652, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.157254, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1574001, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.157553, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.157702, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.15785, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.157988, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.15813, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.158274, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1585732, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.158674, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.158776, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.15885, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.158926, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1590002, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.159174, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.15954, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.159708, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.159921, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1601121, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1602209, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.160702, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.160817, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.160921, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.161024, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.16113, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1612349, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.161336, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.161437, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.161731, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1618629, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.162008, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.162195, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1623218, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1624541, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.16275, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.162853, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.163015, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.163148, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1632252, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.163328, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1635032, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.165361, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.16557, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.165764, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1661, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.166382, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1668139, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1670039, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.167271, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.167525, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1676219, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.167714, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1678069, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1680598, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1682172, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.168511, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.168672, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1705668, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1707761, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.171062, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1712792, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.171586, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1718569, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1719801, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.172138, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.172342, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.172672, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.172826, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.172927, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.173027, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.173293, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.173791, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1739361, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.174133, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.174282, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.174431, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1745658, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.174711, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.174853, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.175034, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.175358, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.175492, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1756, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1756759, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1765928, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1767402, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.176855, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1770291, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1771672, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.177301, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1774201, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.177589, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1778529, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.178442, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.178584, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.178688, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1787882, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1788979, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.179002, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.179103, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1792052, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1795788, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1796758, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.179824, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.179966, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1800709, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.180228, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.180404, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.180793, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.180852, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.180908, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1809611, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181014, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181192, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.18125, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181304, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181356, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.18141, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181461, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181518, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1817238, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.181817, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1818922, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.182098, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1822772, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1835158, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1837661, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.184076, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1844218, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.184704, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.184941, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.185146, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.185358, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.185777, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1860218, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(?{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.190592, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.191272, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1914828, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1919281, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.195285, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.195679, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.196037, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.19706, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.197243, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1973279, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.19771, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.198455, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.1989288, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.199275, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.199796, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.200269, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.200993, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.201736, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.202414, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.202601, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2029598, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.203713, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2041569, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.205037, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.205685, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.205937, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.206743, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.208274, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.209016, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2098649, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.210304, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2105138, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.211097, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.211346, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.212055, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.21228, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.213166, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.213439, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.214431, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.214869, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.215165, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2155688, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.215839, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2165382, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2171662, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2178109, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.218909, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.219219, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2194052, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.219902, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.220871, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2216341, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2217999, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.22211, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.222413, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.222933, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2234619, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.224034, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.224569, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.225245, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2258828, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2271051, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.227665, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.22833, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.228737, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.229142, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.229655, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2304819, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.230762, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.231284, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.231804, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.23221, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.232845, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2333791, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.236505, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.239349, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.239805, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.24092, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2415712, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.241979, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.243051, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.243915, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2453241, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.246001, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.2464068, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.246861, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1736418959.247775, "supported_languages": null}}, "docs": {"doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {"seed.zlv_dbt_project.taxe": [{"database": "database_name", "schema": "main_common", "name": "taxe", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "taxe.csv", "original_file_path": "seeds/taxe.csv", "unique_id": "seed.zlv_dbt_project.taxe", "fqn": ["zlv_dbt_project", "taxe"], "alias": "taxe", "checksum": {"name": "sha256", "checksum": "17f664925dcf29f5d48edf7a65d7782b202abc76a5370f166282d3089c9eeb81"}, "config": {"enabled": false, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ";", "quote_columns": null, "+quote": "\"", "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ";", "+quote": "\"", "+header": true, "enabled": false}, "created_at": 1736418960.13323, "relation_name": "\"database_name\".\"main_common\".\"taxe\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}], "seed.zlv_dbt_project.nature_juridique": [{"database": "database_name", "schema": "main_common", "name": "nature_juridique", "resource_type": "seed", "package_name": "zlv_dbt_project", "path": "nature_juridique.csv", "original_file_path": "seeds/nature_juridique.csv", "unique_id": "seed.zlv_dbt_project.nature_juridique", "fqn": ["zlv_dbt_project", "nature_juridique"], "alias": "nature_juridique", "checksum": {"name": "sha256", "checksum": "c5a223e63d9bbb09679664e7cc2924554dad76f666ae805dc062142a5360b33b"}, "config": {"enabled": false, "alias": null, "schema": "common", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ";", "quote_columns": null, "+quote": "\"", "+header": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "zlv_dbt_project://seeds/properties.yml", "build_path": null, "unrendered_config": {"schema": "common", "delimiter": ";", "+quote": "\"", "+header": true, "enabled": false}, "created_at": 1736418960.133916, "relation_name": "\"database_name\".\"main_common\".\"nature_juridique\"", "raw_code": "", "root_path": "/Users/raphaelcourivaud/dev/zlv/zero-logement-vacant/analytics/dbt", "depends_on": {"macros": []}}]}, "parent_map": {"model.zlv_dbt_project.stg_common_fusions": ["seed.zlv_dbt_project.fusions"], "model.zlv_dbt_project.stg_common_departements_france": ["seed.zlv_dbt_project.departements_france"], "model.zlv_dbt_project.stg_common_cities": ["seed.zlv_dbt_project.cities"], "model.zlv_dbt_project.stg_common_scissions": ["seed.zlv_dbt_project.scissions"], "model.zlv_dbt_project.stg_common_com_epci_dep_region": ["seed.zlv_dbt_project.com_epci_dep_reg"], "model.zlv_dbt_project.stg_common_table_appartenance": ["seed.zlv_dbt_project.table_appartenance_geo_communes_2024"], "model.zlv_dbt_project.stg_common_opah": ["seed.zlv_dbt_project.opah"], "model.zlv_dbt_project.stg_common_ort": ["seed.zlv_dbt_project.ort"], "model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023": ["seed.zlv_dbt_project.ngeo-anct-cog2023"], "model.zlv_dbt_project.stg_common_article_232_1": ["seed.zlv_dbt_project.article_232_1"], "model.zlv_dbt_project.stg_common_article_232_2": ["seed.zlv_dbt_project.article_232_2"], "model.zlv_dbt_project.stg_production_users": ["source.zlv_dbt_project.duckdb_production_raw.users"], "model.zlv_dbt_project.stg_production_campaigns_housing": ["source.zlv_dbt_project.duckdb_production_raw.campaigns_housing"], "model.zlv_dbt_project.stg_production_groups_housing_events": ["source.zlv_dbt_project.duckdb_production_raw.group_housing_events"], "model.zlv_dbt_project.stg_production_establishments": ["source.zlv_dbt_project.duckdb_production_raw.establishments"], "model.zlv_dbt_project.stg_production_groups": ["source.zlv_dbt_project.duckdb_production_raw.groups"], "model.zlv_dbt_project.stg_production_groups_housing": ["source.zlv_dbt_project.duckdb_production_raw.groups_housing"], "model.zlv_dbt_project.stg_production_": ["source.zlv_dbt_project.duckdb_production_raw.users"], "model.zlv_dbt_project.stg_production_owners_housing": ["source.zlv_dbt_project.duckdb_production_raw.owners_housing"], "model.zlv_dbt_project.stg_production_campaigns": ["source.zlv_dbt_project.duckdb_production_raw.campaigns"], "model.zlv_dbt_project.stg_production_old_events": ["source.zlv_dbt_project.duckdb_production_raw.old_events"], "model.zlv_dbt_project.stg_production_housing_events": ["source.zlv_dbt_project.duckdb_production_raw.housing_events"], "model.zlv_dbt_project.stg_production_housing": ["source.zlv_dbt_project.duckdb_production_raw.housing"], "model.zlv_dbt_project.stg_production_events": ["source.zlv_dbt_project.duckdb_production_raw.events"], "model.zlv_dbt_project.stg_production_owners": ["source.zlv_dbt_project.duckdb_production_raw.owners"], "model.zlv_dbt_project.stg_production_geo_perimeters": ["source.zlv_dbt_project.duckdb_production_raw.geo_perimeters"], "model.zlv_dbt_project.stg_ff_owners": ["source.zlv_dbt_project.duckdb_raw.raw_ff_owners"], "model.zlv_dbt_project.stg_ff_ext_2019": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2019"], "model.zlv_dbt_project.stg_ff_ext_2022": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2022"], "model.zlv_dbt_project.stg_ff_ext_2023": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2023"], "model.zlv_dbt_project.stg_ff_ext_2021": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2021"], "model.zlv_dbt_project.stg_ff_ext_2020": ["source.zlv_dbt_project.duckdb_raw.raw_ff_2020"], "model.zlv_dbt_project.stg_lovac_2019": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2019"], "model.zlv_dbt_project.stg_lovac_2024": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2024"], "model.zlv_dbt_project.stg_lovac_2020": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2020"], "model.zlv_dbt_project.stg_lovac_2021": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2021"], "model.zlv_dbt_project.stg_lovac_2023": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2023"], "model.zlv_dbt_project.stg_lovac_2022": ["source.zlv_dbt_project.duckdb_raw.raw_lovac_2022"], "model.zlv_dbt_project.marts_common_cities": ["model.zlv_dbt_project.int_common_article_232_1", "model.zlv_dbt_project.int_common_article_232_2", "model.zlv_dbt_project.int_common_cities", "model.zlv_dbt_project.int_common_cities_mapping", "model.zlv_dbt_project.int_common_ngeo_anct_cog_2023", "model.zlv_dbt_project.int_common_opah", "model.zlv_dbt_project.int_common_ort", "model.zlv_dbt_project.int_common_table_appartenance", "model.zlv_dbt_project.int_production_geo_code_establishments"], "model.zlv_dbt_project.marts_common_morphology": ["model.zlv_dbt_project.int_common_cities_mapping", "model.zlv_dbt_project.int_common_com_epci_dep_region", "model.zlv_dbt_project.int_common_departements_france", "model.zlv_dbt_project.int_production_housing", "model.zlv_dbt_project.stg_common_fusions", "model.zlv_dbt_project.stg_common_scissions", "model.zlv_dbt_project.stg_ff_ext_2019", "model.zlv_dbt_project.stg_ff_ext_2020", "model.zlv_dbt_project.stg_ff_ext_2021", "model.zlv_dbt_project.stg_ff_ext_2022", "model.zlv_dbt_project.stg_ff_ext_2023", "model.zlv_dbt_project.stg_lovac_2019", "model.zlv_dbt_project.stg_lovac_2020", "model.zlv_dbt_project.stg_lovac_2021", "model.zlv_dbt_project.stg_lovac_2022", "model.zlv_dbt_project.stg_lovac_2023", "model.zlv_dbt_project.stg_lovac_2024"], "model.zlv_dbt_project.marts_public_establishments_morphology": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.marts_public_establishments_morphology_unpivoted": ["model.zlv_dbt_project.marts_public_establishments_morphology"], "model.zlv_dbt_project.marts_production_groups": ["model.zlv_dbt_project.int_production_groups"], "model.zlv_dbt_project.marts_production_campaigns": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_campaigns_stats", "model.zlv_dbt_project.int_production_campaigns_stats_actions", "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign"], "model.zlv_dbt_project.marts_production_users": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_users"], "model.zlv_dbt_project.marts_production_housing": ["model.zlv_dbt_project.int_production_housing", "model.zlv_dbt_project.int_production_housing_campaigns", "model.zlv_dbt_project.int_production_housing_establishments", "model.zlv_dbt_project.int_production_housing_groups", "model.zlv_dbt_project.int_production_housing_last_status", "model.zlv_dbt_project.int_production_housing_users", "model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.marts_production_owners": ["model.zlv_dbt_project.int_production_owners"], "model.zlv_dbt_project.marts_production_establishments": ["model.zlv_dbt_project.int_production_establishment_events_last_status", "model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_establishments_campaigns", "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "model.zlv_dbt_project.int_production_establishments_groups", "model.zlv_dbt_project.int_production_establishments_perimeters", "model.zlv_dbt_project.int_production_establishments_users"], "model.zlv_dbt_project.marts_production_join_owner_housing": ["model.zlv_dbt_project.stg_production_owners_housing"], "model.zlv_dbt_project.marts_production_join_establishment_housing": ["model.zlv_dbt_project.int_production_housing", "model.zlv_dbt_project.marts_production_join_establishment_cities"], "model.zlv_dbt_project.marts_production_join_housing_groups": ["model.zlv_dbt_project.stg_production_groups_housing"], "model.zlv_dbt_project.marts_production_join_establishment_cities": ["model.zlv_dbt_project.int_production_establishments"], "model.zlv_dbt_project.marts_production_join_campaigns_housing": ["model.zlv_dbt_project.int_production_campaigns_housing"], "model.zlv_dbt_project.marts_stats_monthly_campains": ["model.zlv_dbt_project.int_common_spine_months", "model.zlv_dbt_project.int_production_campaigns"], "model.zlv_dbt_project.marts_stats_monthly_signup": ["model.zlv_dbt_project.int_common_spine_months", "model.zlv_dbt_project.marts_production_establishments", "model.zlv_dbt_project.marts_production_users"], "model.zlv_dbt_project.marts_stats_monthly_events": [], "model.zlv_dbt_project.marts_stats_monthly_housing": ["model.zlv_dbt_project.int_common_spine_months", "model.zlv_dbt_project.int_production_campaigns"], "model.zlv_dbt_project.marts_stats_monthly_global": ["model.zlv_dbt_project.marts_stats_monthly_campains", "model.zlv_dbt_project.marts_stats_monthly_signup"], "model.zlv_dbt_project.int_common_com_epci_dep_region": ["model.zlv_dbt_project.stg_common_com_epci_dep_region"], "model.zlv_dbt_project.int_common_ngeo_anct_cog_2023": ["model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023"], "model.zlv_dbt_project.int_common_cities_mapping": ["model.zlv_dbt_project.int_common_cities"], "model.zlv_dbt_project.int_common_spine_days": [], "model.zlv_dbt_project.int_common_ort": ["model.zlv_dbt_project.stg_common_ort"], "model.zlv_dbt_project.int_common_table_appartenance": ["model.zlv_dbt_project.stg_common_table_appartenance"], "model.zlv_dbt_project.int_common_spine_months": [], "model.zlv_dbt_project.int_common_spine_years": [], "model.zlv_dbt_project.int_common_opah": ["model.zlv_dbt_project.stg_common_opah"], "model.zlv_dbt_project.int_common_fusions": ["model.zlv_dbt_project.stg_common_fusions"], "model.zlv_dbt_project.int_common_departements_france": ["model.zlv_dbt_project.stg_common_departements_france"], "model.zlv_dbt_project.int_common_cities": ["model.zlv_dbt_project.stg_common_cities"], "model.zlv_dbt_project.int_common_article_232_1": ["model.zlv_dbt_project.stg_common_article_232_1"], "model.zlv_dbt_project.int_common_article_232_2": ["model.zlv_dbt_project.stg_common_article_232_2"], "model.zlv_dbt_project.int_common_scissions": ["model.zlv_dbt_project.stg_common_scissions"], "model.zlv_dbt_project.int_production_geo_perimeters": ["model.zlv_dbt_project.stg_production_geo_perimeters"], "model.zlv_dbt_project.int_production_housing_campaigns": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.stg_production_campaigns_housing"], "model.zlv_dbt_project.int_production_campaigns_housing_count": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing"], "model.zlv_dbt_project.int_production_establishments_perimeters": ["model.zlv_dbt_project.int_production_geo_perimeters"], "model.zlv_dbt_project.int_production_geo_code_establishments": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_establishments_users"], "model.zlv_dbt_project.int_production_events_new": ["model.zlv_dbt_project.stg_production_events", "model.zlv_dbt_project.stg_production_housing_events"], "model.zlv_dbt_project.int_production_establishments_users": ["model.zlv_dbt_project.int_production_users"], "model.zlv_dbt_project.int_production_establishment_geo_code": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_establishments_users"], "model.zlv_dbt_project.int_production_establishments_campaigns": ["model.zlv_dbt_project.int_production_campaigns"], "model.zlv_dbt_project.int_production_events": ["model.zlv_dbt_project.int_production_events_new", "model.zlv_dbt_project.int_production_events_old", "model.zlv_dbt_project.int_production_users", "seed.zlv_dbt_project.status"], "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_events"], "model.zlv_dbt_project.int_production_campaigns_stats": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_events"], "model.zlv_dbt_project.int_production_owners": ["model.zlv_dbt_project.stg_production_owners"], "model.zlv_dbt_project.int_production_campaigns": ["model.zlv_dbt_project.stg_production_campaigns"], "model.zlv_dbt_project.int_production_establishment_events_last_status": ["model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_events", "model.zlv_dbt_project.int_production_users"], "model.zlv_dbt_project.int_production_establishments_campaigns_contacts": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_establishments", "model.zlv_dbt_project.int_production_events"], "model.zlv_dbt_project.int_production_establishments": ["model.zlv_dbt_project.stg_production_establishments"], "model.zlv_dbt_project.int_production_users": ["model.zlv_dbt_project.stg_production_users"], "model.zlv_dbt_project.int_production_housing": ["model.zlv_dbt_project.int_common_cities_mapping", "model.zlv_dbt_project.stg_production_housing"], "model.zlv_dbt_project.int_production_housing_users": ["model.zlv_dbt_project.int_production_establishments_users", "model.zlv_dbt_project.int_production_housing_establishments"], "model.zlv_dbt_project.int_production_housing_establishments": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_housing"], "model.zlv_dbt_project.int_production_campaigns_housing": ["model.zlv_dbt_project.stg_production_campaigns_housing"], "model.zlv_dbt_project.int_production_establishments_localities": ["model.zlv_dbt_project.int_production_establishments"], "model.zlv_dbt_project.int_production_housing_groups": ["model.zlv_dbt_project.stg_production_groups", "model.zlv_dbt_project.stg_production_groups_housing"], "model.zlv_dbt_project.int_production_groups": ["model.zlv_dbt_project.stg_production_groups"], "model.zlv_dbt_project.int_production_campaigns_stats_actions": ["model.zlv_dbt_project.int_production_campaigns", "model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_events"], "model.zlv_dbt_project.int_production_events_old": ["model.zlv_dbt_project.stg_production_old_events"], "model.zlv_dbt_project.int_production_establishments_groups": ["model.zlv_dbt_project.int_production_groups"], "model.zlv_dbt_project.int_production_housing_last_status": ["model.zlv_dbt_project.int_production_events", "model.zlv_dbt_project.int_production_housing"], "model.zlv_dbt_project.int_production_establishments_housing": ["model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_housing"], "model.zlv_dbt_project.int_ff_owners_dedup": ["model.zlv_dbt_project.stg_ff_owners"], "model.zlv_dbt_project.int_ff_ext_2019": ["model.zlv_dbt_project.stg_ff_ext_2019"], "model.zlv_dbt_project.int_ff_history_housing": ["model.zlv_dbt_project.int_ff_ext_2019", "model.zlv_dbt_project.int_ff_ext_2020", "model.zlv_dbt_project.int_ff_ext_2021", "model.zlv_dbt_project.int_ff_ext_2022", "model.zlv_dbt_project.int_ff_ext_2023"], "model.zlv_dbt_project.int_ff_ext_2020_geo_code": ["model.zlv_dbt_project.int_ff_ext_2020"], "model.zlv_dbt_project.int_ff_ext_2023": ["model.zlv_dbt_project.stg_ff_ext_2023"], "model.zlv_dbt_project.int_ff_ext_2022": ["model.zlv_dbt_project.stg_ff_ext_2022"], "model.zlv_dbt_project.int_ff_ext_2020": ["model.zlv_dbt_project.stg_ff_ext_2020"], "model.zlv_dbt_project.int_ff_ext_2021": ["model.zlv_dbt_project.stg_ff_ext_2021"], "model.zlv_dbt_project.int_ff_ext_2023_geo_code": ["model.zlv_dbt_project.int_ff_ext_2023"], "model.zlv_dbt_project.int_lovac_history_housing": ["model.zlv_dbt_project.int_lovac_fil_2019", "model.zlv_dbt_project.int_lovac_fil_2020", "model.zlv_dbt_project.int_lovac_fil_2021", "model.zlv_dbt_project.int_lovac_fil_2022", "model.zlv_dbt_project.int_lovac_fil_2023", "model.zlv_dbt_project.int_lovac_fil_2024"], "model.zlv_dbt_project.int_lovac_geo_code": ["model.zlv_dbt_project.int_lovac_ex_2020", "model.zlv_dbt_project.int_lovac_ex_2023", "model.zlv_dbt_project.int_lovac_ex_2024"], "model.zlv_dbt_project.int_lovac_fil_2019": ["model.zlv_dbt_project.stg_lovac_2019"], "model.zlv_dbt_project.int_lovac_fil_2024": ["model.zlv_dbt_project.stg_lovac_2024"], "model.zlv_dbt_project.int_lovac_fil_2020": ["model.zlv_dbt_project.stg_lovac_2020"], "model.zlv_dbt_project.int_lovac_fil_2021": ["model.zlv_dbt_project.stg_lovac_2021"], "model.zlv_dbt_project.int_lovac_fil_2023": ["model.zlv_dbt_project.stg_lovac_2023"], "model.zlv_dbt_project.int_lovac_fil_2022": ["model.zlv_dbt_project.stg_lovac_2022"], "model.zlv_dbt_project.int_lovac_ex_2024": ["model.zlv_dbt_project.stg_lovac_2024"], "model.zlv_dbt_project.int_lovac_ex_2019": ["model.zlv_dbt_project.stg_lovac_2019"], "model.zlv_dbt_project.int_lovac_ex_2022": ["model.zlv_dbt_project.stg_lovac_2022"], "model.zlv_dbt_project.int_lovac_ex_2023": ["model.zlv_dbt_project.stg_lovac_2023"], "model.zlv_dbt_project.int_lovac_ex_2021": ["model.zlv_dbt_project.stg_lovac_2021"], "model.zlv_dbt_project.int_lovac_ex_2020": ["model.zlv_dbt_project.stg_lovac_2020"], "analysis.zlv_dbt_project.ff23_lovac_local_id": ["model.zlv_dbt_project.stg_lovac_2019", "model.zlv_dbt_project.stg_lovac_2020", "model.zlv_dbt_project.stg_lovac_2021", "model.zlv_dbt_project.stg_lovac_2022", "source.zlv_dbt_project.duckdb_raw.raw_ff_2023"], "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac": ["model.zlv_dbt_project.stg_ff_ext_2023", "model.zlv_dbt_project.stg_lovac_2019", "model.zlv_dbt_project.stg_lovac_2020", "model.zlv_dbt_project.stg_lovac_2021", "model.zlv_dbt_project.stg_lovac_2022"], "analysis.zlv_dbt_project.ff23_lovac_occupation": [], "seed.zlv_dbt_project.departements_france": [], "seed.zlv_dbt_project.direction_territoriale": [], "seed.zlv_dbt_project.tlv_cities": [], "seed.zlv_dbt_project.status": [], "seed.zlv_dbt_project.prenom": [], "seed.zlv_dbt_project.ngeo-anct-cog2023": [], "seed.zlv_dbt_project.com_epci_dep_reg": [], "seed.zlv_dbt_project.table_appartenance_geo_communes_2024": [], "seed.zlv_dbt_project.cities": [], "seed.zlv_dbt_project.fusions": [], "seed.zlv_dbt_project.scissions": [], "seed.zlv_dbt_project.article_232_1": [], "seed.zlv_dbt_project.opah": [], "seed.zlv_dbt_project.article_232_2": [], "seed.zlv_dbt_project.ort": [], "model.zlv_dbt_project.int_lovac_history_owners": ["model.zlv_dbt_project.int_lovac_ex_2023", "model.zlv_dbt_project.int_lovac_ex_2024"], "source.zlv_dbt_project.airbyte_raw.zlovac": [], "source.zlv_dbt_project.airbyte_raw.lovac": [], "source.zlv_dbt_project.airbyte_raw.URSAAF": [], "source.zlv_dbt_project.airbyte_raw.FF": [], "source.zlv_dbt_project.airbyte_raw.INSEE": [], "source.zlv_dbt_project.duckdb_production_raw.housing": [], "source.zlv_dbt_project.duckdb_production_raw.owners": [], "source.zlv_dbt_project.duckdb_production_raw.events": [], "source.zlv_dbt_project.duckdb_production_raw.old_events": [], "source.zlv_dbt_project.duckdb_production_raw.housing_events": [], "source.zlv_dbt_project.duckdb_production_raw.establishments": [], "source.zlv_dbt_project.duckdb_production_raw.users": [], "source.zlv_dbt_project.duckdb_production_raw.campaigns_housing": [], "source.zlv_dbt_project.duckdb_production_raw.campaigns": [], "source.zlv_dbt_project.duckdb_production_raw.owners_housing": [], "source.zlv_dbt_project.duckdb_production_raw.group_housing_events": [], "source.zlv_dbt_project.duckdb_production_raw.groups": [], "source.zlv_dbt_project.duckdb_production_raw.groups_housing": [], "source.zlv_dbt_project.duckdb_production_raw.geo_perimeters": [], "source.zlv_dbt_project.duckdb_raw.raw_ff_owners": [], "source.zlv_dbt_project.duckdb_raw.raw_ff_2023": [], "source.zlv_dbt_project.duckdb_raw.raw_ff_2022": [], "source.zlv_dbt_project.duckdb_raw.raw_ff_2021": [], "source.zlv_dbt_project.duckdb_raw.raw_ff_2020": [], "source.zlv_dbt_project.duckdb_raw.raw_ff_2019": [], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2019": [], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2020": [], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2021": [], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2022": [], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2023": [], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2024": []}, "child_map": {"model.zlv_dbt_project.stg_common_fusions": ["model.zlv_dbt_project.int_common_fusions", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_common_departements_france": ["model.zlv_dbt_project.int_common_departements_france"], "model.zlv_dbt_project.stg_common_cities": ["model.zlv_dbt_project.int_common_cities"], "model.zlv_dbt_project.stg_common_scissions": ["model.zlv_dbt_project.int_common_scissions", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_common_com_epci_dep_region": ["model.zlv_dbt_project.int_common_com_epci_dep_region"], "model.zlv_dbt_project.stg_common_table_appartenance": ["model.zlv_dbt_project.int_common_table_appartenance"], "model.zlv_dbt_project.stg_common_opah": ["model.zlv_dbt_project.int_common_opah"], "model.zlv_dbt_project.stg_common_ort": ["model.zlv_dbt_project.int_common_ort"], "model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023": ["model.zlv_dbt_project.int_common_ngeo_anct_cog_2023"], "model.zlv_dbt_project.stg_common_article_232_1": ["model.zlv_dbt_project.int_common_article_232_1"], "model.zlv_dbt_project.stg_common_article_232_2": ["model.zlv_dbt_project.int_common_article_232_2"], "model.zlv_dbt_project.stg_production_users": ["model.zlv_dbt_project.int_production_users"], "model.zlv_dbt_project.stg_production_campaigns_housing": ["model.zlv_dbt_project.int_production_campaigns_housing", "model.zlv_dbt_project.int_production_housing_campaigns"], "model.zlv_dbt_project.stg_production_groups_housing_events": [], "model.zlv_dbt_project.stg_production_establishments": ["model.zlv_dbt_project.int_production_establishments"], "model.zlv_dbt_project.stg_production_groups": ["model.zlv_dbt_project.int_production_groups", "model.zlv_dbt_project.int_production_housing_groups"], "model.zlv_dbt_project.stg_production_groups_housing": ["model.zlv_dbt_project.int_production_housing_groups", "model.zlv_dbt_project.marts_production_join_housing_groups"], "model.zlv_dbt_project.stg_production_": [], "model.zlv_dbt_project.stg_production_owners_housing": ["model.zlv_dbt_project.marts_production_join_owner_housing"], "model.zlv_dbt_project.stg_production_campaigns": ["model.zlv_dbt_project.int_production_campaigns"], "model.zlv_dbt_project.stg_production_old_events": ["model.zlv_dbt_project.int_production_events_old"], "model.zlv_dbt_project.stg_production_housing_events": ["model.zlv_dbt_project.int_production_events_new"], "model.zlv_dbt_project.stg_production_housing": ["model.zlv_dbt_project.int_production_housing"], "model.zlv_dbt_project.stg_production_events": ["model.zlv_dbt_project.int_production_events_new"], "model.zlv_dbt_project.stg_production_owners": ["model.zlv_dbt_project.int_production_owners"], "model.zlv_dbt_project.stg_production_geo_perimeters": ["model.zlv_dbt_project.int_production_geo_perimeters"], "model.zlv_dbt_project.stg_ff_owners": ["model.zlv_dbt_project.int_ff_owners_dedup"], "model.zlv_dbt_project.stg_ff_ext_2019": ["model.zlv_dbt_project.int_ff_ext_2019", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_ff_ext_2022": ["model.zlv_dbt_project.int_ff_ext_2022", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_ff_ext_2023": ["analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac", "model.zlv_dbt_project.int_ff_ext_2023", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_ff_ext_2021": ["model.zlv_dbt_project.int_ff_ext_2021", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_ff_ext_2020": ["model.zlv_dbt_project.int_ff_ext_2020", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_lovac_2019": ["analysis.zlv_dbt_project.ff23_lovac_local_id", "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac", "model.zlv_dbt_project.int_lovac_ex_2019", "model.zlv_dbt_project.int_lovac_fil_2019", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_lovac_2024": ["model.zlv_dbt_project.int_lovac_ex_2024", "model.zlv_dbt_project.int_lovac_fil_2024", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_lovac_2020": ["analysis.zlv_dbt_project.ff23_lovac_local_id", "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac", "model.zlv_dbt_project.int_lovac_ex_2020", "model.zlv_dbt_project.int_lovac_fil_2020", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_lovac_2021": ["analysis.zlv_dbt_project.ff23_lovac_local_id", "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac", "model.zlv_dbt_project.int_lovac_ex_2021", "model.zlv_dbt_project.int_lovac_fil_2021", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_lovac_2023": ["model.zlv_dbt_project.int_lovac_ex_2023", "model.zlv_dbt_project.int_lovac_fil_2023", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.stg_lovac_2022": ["analysis.zlv_dbt_project.ff23_lovac_local_id", "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac", "model.zlv_dbt_project.int_lovac_ex_2022", "model.zlv_dbt_project.int_lovac_fil_2022", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.marts_common_cities": ["model.zlv_dbt_project.marts_production_housing"], "model.zlv_dbt_project.marts_common_morphology": ["model.zlv_dbt_project.marts_public_establishments_morphology"], "model.zlv_dbt_project.marts_public_establishments_morphology": ["model.zlv_dbt_project.marts_public_establishments_morphology_unpivoted"], "model.zlv_dbt_project.marts_public_establishments_morphology_unpivoted": [], "model.zlv_dbt_project.marts_production_groups": [], "model.zlv_dbt_project.marts_production_campaigns": [], "model.zlv_dbt_project.marts_production_users": ["model.zlv_dbt_project.marts_stats_monthly_signup"], "model.zlv_dbt_project.marts_production_housing": [], "model.zlv_dbt_project.marts_production_owners": [], "model.zlv_dbt_project.marts_production_establishments": ["model.zlv_dbt_project.marts_stats_monthly_signup"], "model.zlv_dbt_project.marts_production_join_owner_housing": [], "model.zlv_dbt_project.marts_production_join_establishment_housing": [], "model.zlv_dbt_project.marts_production_join_housing_groups": [], "model.zlv_dbt_project.marts_production_join_establishment_cities": ["model.zlv_dbt_project.marts_production_join_establishment_housing"], "model.zlv_dbt_project.marts_production_join_campaigns_housing": [], "model.zlv_dbt_project.marts_stats_monthly_campains": ["model.zlv_dbt_project.marts_stats_monthly_global"], "model.zlv_dbt_project.marts_stats_monthly_signup": ["model.zlv_dbt_project.marts_stats_monthly_global"], "model.zlv_dbt_project.marts_stats_monthly_events": [], "model.zlv_dbt_project.marts_stats_monthly_housing": [], "model.zlv_dbt_project.marts_stats_monthly_global": [], "model.zlv_dbt_project.int_common_com_epci_dep_region": ["model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.int_common_ngeo_anct_cog_2023": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_cities_mapping": ["model.zlv_dbt_project.int_production_housing", "model.zlv_dbt_project.marts_common_cities", "model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.int_common_spine_days": [], "model.zlv_dbt_project.int_common_ort": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_table_appartenance": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_spine_months": ["model.zlv_dbt_project.marts_stats_monthly_campains", "model.zlv_dbt_project.marts_stats_monthly_housing", "model.zlv_dbt_project.marts_stats_monthly_signup"], "model.zlv_dbt_project.int_common_spine_years": [], "model.zlv_dbt_project.int_common_opah": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_fusions": [], "model.zlv_dbt_project.int_common_departements_france": ["model.zlv_dbt_project.marts_common_morphology"], "model.zlv_dbt_project.int_common_cities": ["model.zlv_dbt_project.int_common_cities_mapping", "model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_article_232_1": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_article_232_2": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_common_scissions": [], "model.zlv_dbt_project.int_production_geo_perimeters": ["model.zlv_dbt_project.int_production_establishments_perimeters"], "model.zlv_dbt_project.int_production_housing_campaigns": ["model.zlv_dbt_project.marts_production_housing"], "model.zlv_dbt_project.int_production_campaigns_housing_count": ["model.zlv_dbt_project.int_production_campaigns_stats", "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign", "model.zlv_dbt_project.marts_production_campaigns"], "model.zlv_dbt_project.int_production_establishments_perimeters": ["model.zlv_dbt_project.marts_production_establishments"], "model.zlv_dbt_project.int_production_geo_code_establishments": ["model.zlv_dbt_project.marts_common_cities"], "model.zlv_dbt_project.int_production_events_new": ["model.zlv_dbt_project.int_production_events"], "model.zlv_dbt_project.int_production_establishments_users": ["model.zlv_dbt_project.int_production_establishment_geo_code", "model.zlv_dbt_project.int_production_geo_code_establishments", "model.zlv_dbt_project.int_production_housing_users", "model.zlv_dbt_project.marts_production_establishments"], "model.zlv_dbt_project.int_production_establishment_geo_code": [], "model.zlv_dbt_project.int_production_establishments_campaigns": ["model.zlv_dbt_project.marts_production_establishments"], "model.zlv_dbt_project.int_production_events": ["model.zlv_dbt_project.int_production_campaigns_stats", "model.zlv_dbt_project.int_production_campaigns_stats_actions", "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign", "model.zlv_dbt_project.int_production_establishment_events_last_status", "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "model.zlv_dbt_project.int_production_housing_last_status"], "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign": ["model.zlv_dbt_project.marts_production_campaigns"], "model.zlv_dbt_project.int_production_campaigns_stats": ["model.zlv_dbt_project.marts_production_campaigns"], "model.zlv_dbt_project.int_production_owners": ["model.zlv_dbt_project.marts_production_owners"], "model.zlv_dbt_project.int_production_campaigns": ["model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_campaigns_stats", "model.zlv_dbt_project.int_production_campaigns_stats_actions", "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign", "model.zlv_dbt_project.int_production_establishments_campaigns", "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "model.zlv_dbt_project.int_production_housing_campaigns", "model.zlv_dbt_project.marts_production_campaigns", "model.zlv_dbt_project.marts_stats_monthly_campains", "model.zlv_dbt_project.marts_stats_monthly_housing"], "model.zlv_dbt_project.int_production_establishment_events_last_status": ["model.zlv_dbt_project.marts_production_establishments"], "model.zlv_dbt_project.int_production_establishments_campaigns_contacts": ["model.zlv_dbt_project.marts_production_establishments"], "model.zlv_dbt_project.int_production_establishments": ["model.zlv_dbt_project.int_production_establishment_events_last_status", "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "model.zlv_dbt_project.int_production_establishments_localities", "model.zlv_dbt_project.int_production_geo_code_establishments", "model.zlv_dbt_project.marts_production_establishments", "model.zlv_dbt_project.marts_production_join_establishment_cities", "model.zlv_dbt_project.marts_production_users", "model.zlv_dbt_project.marts_public_establishments_morphology"], "model.zlv_dbt_project.int_production_users": ["model.zlv_dbt_project.int_production_establishment_events_last_status", "model.zlv_dbt_project.int_production_establishments_users", "model.zlv_dbt_project.int_production_events", "model.zlv_dbt_project.marts_production_users"], "model.zlv_dbt_project.int_production_housing": ["model.zlv_dbt_project.int_production_establishments_housing", "model.zlv_dbt_project.int_production_housing_establishments", "model.zlv_dbt_project.int_production_housing_last_status", "model.zlv_dbt_project.marts_common_morphology", "model.zlv_dbt_project.marts_production_housing", "model.zlv_dbt_project.marts_production_join_establishment_housing"], "model.zlv_dbt_project.int_production_housing_users": ["model.zlv_dbt_project.marts_production_housing"], "model.zlv_dbt_project.int_production_housing_establishments": ["model.zlv_dbt_project.int_production_housing_users", "model.zlv_dbt_project.marts_production_housing"], "model.zlv_dbt_project.int_production_campaigns_housing": ["model.zlv_dbt_project.int_production_campaigns_housing_count", "model.zlv_dbt_project.int_production_campaigns_stats", "model.zlv_dbt_project.int_production_campaigns_stats_actions", "model.zlv_dbt_project.int_production_campaigns_stats_next_campaign", "model.zlv_dbt_project.int_production_establishments_campaigns_contacts", "model.zlv_dbt_project.marts_production_join_campaigns_housing"], "model.zlv_dbt_project.int_production_establishments_localities": ["model.zlv_dbt_project.int_production_establishment_geo_code", "model.zlv_dbt_project.int_production_establishments_housing", "model.zlv_dbt_project.int_production_geo_code_establishments", "model.zlv_dbt_project.int_production_housing_establishments", "model.zlv_dbt_project.marts_public_establishments_morphology"], "model.zlv_dbt_project.int_production_housing_groups": ["model.zlv_dbt_project.marts_production_housing"], "model.zlv_dbt_project.int_production_groups": ["model.zlv_dbt_project.int_production_establishments_groups", "model.zlv_dbt_project.marts_production_groups"], "model.zlv_dbt_project.int_production_campaigns_stats_actions": ["model.zlv_dbt_project.marts_production_campaigns"], "model.zlv_dbt_project.int_production_events_old": ["model.zlv_dbt_project.int_production_events"], "model.zlv_dbt_project.int_production_establishments_groups": ["model.zlv_dbt_project.marts_production_establishments"], "model.zlv_dbt_project.int_production_housing_last_status": ["model.zlv_dbt_project.marts_production_housing"], "model.zlv_dbt_project.int_production_establishments_housing": [], "model.zlv_dbt_project.int_ff_owners_dedup": [], "model.zlv_dbt_project.int_ff_ext_2019": ["model.zlv_dbt_project.int_ff_history_housing"], "model.zlv_dbt_project.int_ff_history_housing": [], "model.zlv_dbt_project.int_ff_ext_2020_geo_code": [], "model.zlv_dbt_project.int_ff_ext_2023": ["model.zlv_dbt_project.int_ff_ext_2023_geo_code", "model.zlv_dbt_project.int_ff_history_housing"], "model.zlv_dbt_project.int_ff_ext_2022": ["model.zlv_dbt_project.int_ff_history_housing"], "model.zlv_dbt_project.int_ff_ext_2020": ["model.zlv_dbt_project.int_ff_ext_2020_geo_code", "model.zlv_dbt_project.int_ff_history_housing"], "model.zlv_dbt_project.int_ff_ext_2021": ["model.zlv_dbt_project.int_ff_history_housing"], "model.zlv_dbt_project.int_ff_ext_2023_geo_code": [], "model.zlv_dbt_project.int_lovac_history_housing": [], "model.zlv_dbt_project.int_lovac_geo_code": [], "model.zlv_dbt_project.int_lovac_fil_2019": ["model.zlv_dbt_project.int_lovac_history_housing"], "model.zlv_dbt_project.int_lovac_fil_2024": ["model.zlv_dbt_project.int_lovac_history_housing"], "model.zlv_dbt_project.int_lovac_fil_2020": ["model.zlv_dbt_project.int_lovac_history_housing"], "model.zlv_dbt_project.int_lovac_fil_2021": ["model.zlv_dbt_project.int_lovac_history_housing"], "model.zlv_dbt_project.int_lovac_fil_2023": ["model.zlv_dbt_project.int_lovac_history_housing"], "model.zlv_dbt_project.int_lovac_fil_2022": ["model.zlv_dbt_project.int_lovac_history_housing"], "model.zlv_dbt_project.int_lovac_ex_2024": ["model.zlv_dbt_project.int_lovac_geo_code", "model.zlv_dbt_project.int_lovac_history_owners"], "model.zlv_dbt_project.int_lovac_ex_2019": [], "model.zlv_dbt_project.int_lovac_ex_2022": [], "model.zlv_dbt_project.int_lovac_ex_2023": ["model.zlv_dbt_project.int_lovac_geo_code", "model.zlv_dbt_project.int_lovac_history_owners"], "model.zlv_dbt_project.int_lovac_ex_2021": [], "model.zlv_dbt_project.int_lovac_ex_2020": ["model.zlv_dbt_project.int_lovac_geo_code"], "analysis.zlv_dbt_project.ff23_lovac_local_id": [], "analysis.zlv_dbt_project.marts_analysis_exit_flow_ff23_lovac": [], "analysis.zlv_dbt_project.ff23_lovac_occupation": [], "seed.zlv_dbt_project.departements_france": ["model.zlv_dbt_project.stg_common_departements_france"], "seed.zlv_dbt_project.direction_territoriale": [], "seed.zlv_dbt_project.tlv_cities": [], "seed.zlv_dbt_project.status": ["model.zlv_dbt_project.int_production_events"], "seed.zlv_dbt_project.prenom": [], "seed.zlv_dbt_project.ngeo-anct-cog2023": ["model.zlv_dbt_project.stg_common_ngeo_anct_cog_2023"], "seed.zlv_dbt_project.com_epci_dep_reg": ["model.zlv_dbt_project.stg_common_com_epci_dep_region"], "seed.zlv_dbt_project.table_appartenance_geo_communes_2024": ["model.zlv_dbt_project.stg_common_table_appartenance"], "seed.zlv_dbt_project.cities": ["model.zlv_dbt_project.stg_common_cities"], "seed.zlv_dbt_project.fusions": ["model.zlv_dbt_project.stg_common_fusions"], "seed.zlv_dbt_project.scissions": ["model.zlv_dbt_project.stg_common_scissions"], "seed.zlv_dbt_project.article_232_1": ["model.zlv_dbt_project.stg_common_article_232_1"], "seed.zlv_dbt_project.opah": ["model.zlv_dbt_project.stg_common_opah"], "seed.zlv_dbt_project.article_232_2": ["model.zlv_dbt_project.stg_common_article_232_2"], "seed.zlv_dbt_project.ort": ["model.zlv_dbt_project.stg_common_ort"], "model.zlv_dbt_project.int_lovac_history_owners": [], "source.zlv_dbt_project.airbyte_raw.zlovac": [], "source.zlv_dbt_project.airbyte_raw.lovac": [], "source.zlv_dbt_project.airbyte_raw.URSAAF": [], "source.zlv_dbt_project.airbyte_raw.FF": [], "source.zlv_dbt_project.airbyte_raw.INSEE": [], "source.zlv_dbt_project.duckdb_production_raw.housing": ["model.zlv_dbt_project.stg_production_housing"], "source.zlv_dbt_project.duckdb_production_raw.owners": ["model.zlv_dbt_project.stg_production_owners"], "source.zlv_dbt_project.duckdb_production_raw.events": ["model.zlv_dbt_project.stg_production_events"], "source.zlv_dbt_project.duckdb_production_raw.old_events": ["model.zlv_dbt_project.stg_production_old_events"], "source.zlv_dbt_project.duckdb_production_raw.housing_events": ["model.zlv_dbt_project.stg_production_housing_events"], "source.zlv_dbt_project.duckdb_production_raw.establishments": ["model.zlv_dbt_project.stg_production_establishments"], "source.zlv_dbt_project.duckdb_production_raw.users": ["model.zlv_dbt_project.stg_production_", "model.zlv_dbt_project.stg_production_users"], "source.zlv_dbt_project.duckdb_production_raw.campaigns_housing": ["model.zlv_dbt_project.stg_production_campaigns_housing"], "source.zlv_dbt_project.duckdb_production_raw.campaigns": ["model.zlv_dbt_project.stg_production_campaigns"], "source.zlv_dbt_project.duckdb_production_raw.owners_housing": ["model.zlv_dbt_project.stg_production_owners_housing"], "source.zlv_dbt_project.duckdb_production_raw.group_housing_events": ["model.zlv_dbt_project.stg_production_groups_housing_events"], "source.zlv_dbt_project.duckdb_production_raw.groups": ["model.zlv_dbt_project.stg_production_groups"], "source.zlv_dbt_project.duckdb_production_raw.groups_housing": ["model.zlv_dbt_project.stg_production_groups_housing"], "source.zlv_dbt_project.duckdb_production_raw.geo_perimeters": ["model.zlv_dbt_project.stg_production_geo_perimeters"], "source.zlv_dbt_project.duckdb_raw.raw_ff_owners": ["model.zlv_dbt_project.stg_ff_owners"], "source.zlv_dbt_project.duckdb_raw.raw_ff_2023": ["analysis.zlv_dbt_project.ff23_lovac_local_id", "model.zlv_dbt_project.stg_ff_ext_2023"], "source.zlv_dbt_project.duckdb_raw.raw_ff_2022": ["model.zlv_dbt_project.stg_ff_ext_2022"], "source.zlv_dbt_project.duckdb_raw.raw_ff_2021": ["model.zlv_dbt_project.stg_ff_ext_2021"], "source.zlv_dbt_project.duckdb_raw.raw_ff_2020": ["model.zlv_dbt_project.stg_ff_ext_2020"], "source.zlv_dbt_project.duckdb_raw.raw_ff_2019": ["model.zlv_dbt_project.stg_ff_ext_2019"], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2019": ["model.zlv_dbt_project.stg_lovac_2019"], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2020": ["model.zlv_dbt_project.stg_lovac_2020"], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2021": ["model.zlv_dbt_project.stg_lovac_2021"], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2022": ["model.zlv_dbt_project.stg_lovac_2022"], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2023": ["model.zlv_dbt_project.stg_lovac_2023"], "source.zlv_dbt_project.duckdb_raw.raw_lovac_2024": ["model.zlv_dbt_project.stg_lovac_2024"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}} \ No newline at end of file