From 2994dba1059cc914343a477e71564300b3fa0896 Mon Sep 17 00:00:00 2001 From: Tatiana Al-Chueyr Date: Thu, 27 Jun 2024 15:00:03 +0100 Subject: [PATCH] Support partial parsing when cache is disabled (#1070) Partial parsing support was introduced in #800 and improved in #904 (caching). However, as the caching layer was introduced, we removed support to use partial parsing if the cache was disabled. This PR solves the issue. Fix: #1041 --- cosmos/cache.py | 1 + cosmos/dbt/graph.py | 25 +- dev/dags/dbt/jaffle_shop/target/manifest.json | 8213 +++++++++++------ tests/dbt/test_graph.py | 52 +- tests/test_cache.py | 2 +- 5 files changed, 5432 insertions(+), 2861 deletions(-) diff --git a/cosmos/cache.py b/cosmos/cache.py index a3b29b0e5..d519eaca4 100644 --- a/cosmos/cache.py +++ b/cosmos/cache.py @@ -139,6 +139,7 @@ def _update_partial_parse_cache(latest_partial_parse_filepath: Path, cache_dir: :param cache_dir: Path to the Cosmos project cache directory """ cache_path = get_partial_parse_path(cache_dir) + cache_path.parent.mkdir(parents=True, exist_ok=True) manifest_path = get_partial_parse_path(cache_dir).parent / DBT_MANIFEST_FILE_NAME latest_manifest_filepath = latest_partial_parse_filepath.parent / DBT_MANIFEST_FILE_NAME diff --git a/cosmos/dbt/graph.py b/cosmos/dbt/graph.py index 8dba0a92e..62b6d88bf 100644 --- a/cosmos/dbt/graph.py +++ b/cosmos/dbt/graph.py @@ -404,6 +404,10 @@ def load_via_dbt_ls_cache(self) -> bool: logger.info(f"Cosmos performance: Cache miss for {self.dbt_ls_cache_key} - skipped") return False + def should_use_partial_parse_cache(self) -> bool: + """Identify if Cosmos should use/store dbt partial parse cache or not.""" + return settings.enable_cache_partial_parse and settings.enable_cache and bool(self.cache_dir) + def load_via_dbt_ls_without_cache(self) -> None: """ This is the most accurate way of loading `dbt` projects and filtering them out, since it uses the `dbt` command @@ -424,18 +428,21 @@ def load_via_dbt_ls_without_cache(self) -> None: raise CosmosLoadDbtException("Unable to load project via dbt ls without a profile config.") with tempfile.TemporaryDirectory() as tmpdir: - logger.debug( - f"Content of the dbt project dir {self.render_config.project_path}: `{os.listdir(self.render_config.project_path)}`" - ) + logger.debug(f"Content of the dbt project dir {project_path}: `{os.listdir(project_path)}`") tmpdir_path = Path(tmpdir) create_symlinks(project_path, tmpdir_path, self.render_config.dbt_deps) - if self.project.partial_parse and self.cache_dir: - latest_partial_parse = cache._get_latest_partial_parse(project_path, self.cache_dir) + latest_partial_parse = None + if self.project.partial_parse: + if self.should_use_partial_parse_cache() and self.cache_dir: + latest_partial_parse = cache._get_latest_partial_parse(project_path, self.cache_dir) + else: + latest_partial_parse = get_partial_parse_path(project_path) + + if latest_partial_parse is not None and latest_partial_parse.exists(): logger.info("Partial parse is enabled and the latest partial parse file is %s", latest_partial_parse) - if latest_partial_parse is not None: - cache._copy_partial_parse_to_project(latest_partial_parse, tmpdir_path) + cache._copy_partial_parse_to_project(latest_partial_parse, tmpdir_path) with self.profile_config.ensure_profile( use_mock_values=self.render_config.enable_mock_profile @@ -470,9 +477,9 @@ def load_via_dbt_ls_without_cache(self) -> None: self.nodes = nodes self.filtered_nodes = nodes - if self.project.partial_parse and self.cache_dir: + if self.should_use_partial_parse_cache(): partial_parse_file = get_partial_parse_path(tmpdir_path) - if partial_parse_file.exists(): + if partial_parse_file.exists() and self.cache_dir: cache._update_partial_parse_cache(partial_parse_file, self.cache_dir) def load_via_dbt_ls_file(self) -> None: diff --git a/dev/dags/dbt/jaffle_shop/target/manifest.json b/dev/dags/dbt/jaffle_shop/target/manifest.json index 9446d80c3..c8ba97554 100644 --- a/dev/dags/dbt/jaffle_shop/target/manifest.json +++ b/dev/dags/dbt/jaffle_shop/target/manifest.json @@ -68,39 +68,41 @@ }, "disabled": {}, "docs": { - "dbt.__overview__": { + "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", "name": "__overview__", "original_file_path": "docs/overview.md", "package_name": "dbt", "path": "overview.md", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "unique_id": "dbt.__overview__" + "resource_type": "doc", + "unique_id": "doc.dbt.__overview__" }, - "jaffle_shop.__overview__": { + "doc.jaffle_shop.__overview__": { "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop).", "name": "__overview__", "original_file_path": "models/overview.md", "package_name": "jaffle_shop", "path": "overview.md", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", - "unique_id": "jaffle_shop.__overview__" + "resource_type": "doc", + "unique_id": "doc.jaffle_shop.__overview__" }, - "jaffle_shop.orders_status": { + "doc.jaffle_shop.orders_status": { "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "name": "orders_status", "original_file_path": "models/docs.md", "package_name": "jaffle_shop", "path": "docs.md", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", - "unique_id": "jaffle_shop.orders_status" + "resource_type": "doc", + "unique_id": "doc.jaffle_shop.orders_status" } }, "exposures": {}, + "group_map": {}, + "groups": {}, "macros": { "macro.dbt._split_part_negative": { "arguments": [], - "created_at": 1696458269.796739, + "created_at": 1719485736.555134, "depends_on": { "macros": [] }, @@ -109,7 +111,7 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, "name": "_split_part_negative", "original_file_path": "macros/utils/split_part.sql", @@ -117,14 +119,12 @@ "patch_path": null, "path": "macros/utils/split_part.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt._split_part_negative" }, "macro.dbt.after_commit": { "arguments": [], - "created_at": 1696458269.591864, + "created_at": 1719485736.337471, "depends_on": { "macros": [ "macro.dbt.make_hook_config" @@ -143,14 +143,12 @@ "patch_path": null, "path": "macros/materializations/hooks.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.after_commit" }, "macro.dbt.alter_column_comment": { "arguments": [], - "created_at": 1696458269.832114, + "created_at": 1719485736.583679, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__alter_column_comment" @@ -169,14 +167,12 @@ "patch_path": null, "path": "macros/adapters/persist_docs.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.alter_column_comment" }, "macro.dbt.alter_column_type": { "arguments": [], - "created_at": 1696458269.845595, + "created_at": 1719485736.599694, "depends_on": { "macros": [ "macro.dbt.default__alter_column_type" @@ -195,14 +191,12 @@ "patch_path": null, "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.alter_column_type" }, "macro.dbt.alter_relation_add_remove_columns": { "arguments": [], - "created_at": 1696458269.847001, + "created_at": 1719485736.600589, "depends_on": { "macros": [ "macro.dbt.default__alter_relation_add_remove_columns" @@ -221,14 +215,12 @@ "patch_path": null, "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.alter_relation_add_remove_columns" }, "macro.dbt.alter_relation_comment": { "arguments": [], - "created_at": 1696458269.832729, + "created_at": 1719485736.585442, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__alter_relation_comment" @@ -247,14 +239,12 @@ "patch_path": null, "path": "macros/adapters/persist_docs.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.alter_relation_comment" }, "macro.dbt.any_value": { "arguments": [], - "created_at": 1696458269.7846951, + "created_at": 1719485736.542892, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__any_value" @@ -273,14 +263,12 @@ "patch_path": null, "path": "macros/utils/any_value.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.any_value" }, "macro.dbt.apply_grants": { "arguments": [], - "created_at": 1696458269.828692, + "created_at": 1719485736.577766, "depends_on": { "macros": [ "macro.dbt.default__apply_grants" @@ -299,14 +287,12 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.apply_grants" }, "macro.dbt.array_append": { "arguments": [], - "created_at": 1696458269.7995489, + "created_at": 1719485736.5569642, "depends_on": { "macros": [ "macro.dbt.default__array_append" @@ -325,14 +311,12 @@ "patch_path": null, "path": "macros/utils/array_append.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.array_append" }, "macro.dbt.array_concat": { "arguments": [], - "created_at": 1696458269.792314, + "created_at": 1719485736.5521111, "depends_on": { "macros": [ "macro.dbt.default__array_concat" @@ -351,14 +335,12 @@ "patch_path": null, "path": "macros/utils/array_concat.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.array_concat" }, "macro.dbt.array_construct": { "arguments": [], - "created_at": 1696458269.798442, + "created_at": 1719485736.556025, "depends_on": { "macros": [ "macro.dbt.default__array_construct" @@ -377,14 +359,38 @@ "patch_path": null, "path": "macros/utils/array_construct.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.array_construct" }, + "macro.dbt.assert_columns_equivalent": { + "arguments": [], + "created_at": 1719485736.5031989, + "depends_on": { + "macros": [ + "macro.dbt.get_column_schema_from_query", + "macro.dbt.get_empty_schema_sql", + "macro.dbt.format_columns" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "assert_columns_equivalent", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/column/columns_spec_ddl.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.assert_columns_equivalent" + }, "macro.dbt.before_begin": { "arguments": [], - "created_at": 1696458269.591393, + "created_at": 1719485736.336732, "depends_on": { "macros": [ "macro.dbt.make_hook_config" @@ -403,14 +409,12 @@ "patch_path": null, "path": "macros/materializations/hooks.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.before_begin" }, "macro.dbt.bool_or": { "arguments": [], - "created_at": 1696458269.7931142, + "created_at": 1719485736.5525389, "depends_on": { "macros": [ "macro.dbt.default__bool_or" @@ -429,14 +433,12 @@ "patch_path": null, "path": "macros/utils/bool_or.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.bool_or" }, "macro.dbt.build_config_dict": { "arguments": [], - "created_at": 1696458269.852396, + "created_at": 1719485736.617571, "depends_on": { "macros": [] }, @@ -445,7 +447,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_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[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", + "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 %}", "meta": {}, "name": "build_config_dict", "original_file_path": "macros/python_model/python.sql", @@ -453,23 +455,23 @@ "patch_path": null, "path": "macros/python_model/python.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.build_config_dict" }, "macro.dbt.build_ref_function": { "arguments": [], - "created_at": 1696458269.850849, + "created_at": 1719485736.616483, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.resolve_model_name" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", + "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 %}", "meta": {}, "name": "build_ref_function", "original_file_path": "macros/python_model/python.sql", @@ -477,14 +479,12 @@ "patch_path": null, "path": "macros/python_model/python.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.build_ref_function" }, "macro.dbt.build_snapshot_staging_table": { "arguments": [], - "created_at": 1696458269.620571, + "created_at": 1719485736.358976, "depends_on": { "macros": [ "macro.dbt.make_temp_relation", @@ -506,14 +506,12 @@ "patch_path": null, "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.build_snapshot_staging_table" }, "macro.dbt.build_snapshot_table": { "arguments": [], - "created_at": 1696458269.619425, + "created_at": 1719485736.3569238, "depends_on": { "macros": [ "macro.dbt.default__build_snapshot_table" @@ -532,23 +530,23 @@ "patch_path": null, "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.build_snapshot_table" }, "macro.dbt.build_source_function": { "arguments": [], - "created_at": 1696458269.851639, + "created_at": 1719485736.616947, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.resolve_model_name" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\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 %}", + "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 %}", "meta": {}, "name": "build_source_function", "original_file_path": "macros/python_model/python.sql", @@ -556,14 +554,12 @@ "patch_path": null, "path": "macros/python_model/python.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.build_source_function" }, "macro.dbt.call_dcl_statements": { "arguments": [], - "created_at": 1696458269.827903, + "created_at": 1719485736.576986, "depends_on": { "macros": [ "macro.dbt.default__call_dcl_statements" @@ -582,14 +578,60 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.call_dcl_statements" }, + "macro.dbt.can_clone_table": { + "arguments": [], + "created_at": 1719485736.4429, + "depends_on": { + "macros": [ + "macro.dbt.default__can_clone_table" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", + "meta": {}, + "name": "can_clone_table", + "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/clone/can_clone_table.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.can_clone_table" + }, + "macro.dbt.cast": { + "arguments": [], + "created_at": 1719485736.542182, + "depends_on": { + "macros": [ + "macro.dbt.default__cast" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", + "meta": {}, + "name": "cast", + "original_file_path": "macros/utils/cast.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/cast.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.cast" + }, "macro.dbt.cast_bool_to_text": { "arguments": [], - "created_at": 1696458269.783756, + "created_at": 1719485736.541704, "depends_on": { "macros": [ "macro.dbt.default__cast_bool_to_text" @@ -608,14 +650,12 @@ "patch_path": null, "path": "macros/utils/cast_bool_to_text.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.cast_bool_to_text" }, "macro.dbt.check_for_schema_changes": { "arguments": [], - "created_at": 1696458269.71107, + "created_at": 1719485736.43984, "depends_on": { "macros": [ "macro.dbt.diff_columns", @@ -635,14 +675,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/on_schema_change.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.check_for_schema_changes" }, "macro.dbt.check_schema_exists": { "arguments": [], - "created_at": 1696458269.8388941, + "created_at": 1719485736.591485, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__check_schema_exists" @@ -661,14 +699,12 @@ "patch_path": null, "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.check_schema_exists" }, "macro.dbt.collect_freshness": { "arguments": [], - "created_at": 1696458269.819403, + "created_at": 1719485736.569225, "depends_on": { "macros": [ "macro.dbt.default__collect_freshness" @@ -687,14 +723,12 @@ "patch_path": null, "path": "macros/adapters/freshness.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.collect_freshness" }, "macro.dbt.concat": { "arguments": [], - "created_at": 1696458269.774415, + "created_at": 1719485736.533403, "depends_on": { "macros": [ "macro.dbt.default__concat" @@ -713,14 +747,12 @@ "patch_path": null, "path": "macros/utils/concat.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.concat" }, "macro.dbt.convert_datetime": { "arguments": [], - "created_at": 1696458269.768708, + "created_at": 1719485736.522349, "depends_on": { "macros": [] }, @@ -737,14 +769,12 @@ "patch_path": null, "path": "macros/etc/datetime.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.convert_datetime" }, "macro.dbt.copy_grants": { "arguments": [], - "created_at": 1696458269.822963, + "created_at": 1719485736.5725539, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__copy_grants" @@ -763,14 +793,12 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.copy_grants" }, "macro.dbt.create_columns": { "arguments": [], - "created_at": 1696458269.6159968, + "created_at": 1719485736.354676, "depends_on": { "macros": [ "macro.dbt.default__create_columns" @@ -789,14 +817,12 @@ "patch_path": null, "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_columns" }, "macro.dbt.create_csv_table": { "arguments": [], - "created_at": 1696458269.7461991, + "created_at": 1719485736.45865, "depends_on": { "macros": [ "macro.dbt.default__create_csv_table" @@ -815,14 +841,12 @@ "patch_path": null, "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_csv_table" }, "macro.dbt.create_indexes": { "arguments": [], - "created_at": 1696458269.8056178, + "created_at": 1719485736.561525, "depends_on": { "macros": [ "macro.dbt.default__create_indexes" @@ -841,14 +865,36 @@ "patch_path": null, "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_indexes" }, + "macro.dbt.create_or_replace_clone": { + "arguments": [], + "created_at": 1719485736.443349, + "depends_on": { + "macros": [ + "macro.dbt.default__create_or_replace_clone" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "create_or_replace_clone", + "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/clone/create_or_replace_clone.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.create_or_replace_clone" + }, "macro.dbt.create_or_replace_view": { "arguments": [], - "created_at": 1696458269.730096, + "created_at": 1719485736.513715, "depends_on": { "macros": [ "macro.dbt.run_hooks", @@ -865,22 +911,20 @@ "node_color": null, "show": true }, - "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=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", + "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 %}", "meta": {}, "name": "create_or_replace_view", - "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", + "original_file_path": "macros/relations/view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/create_or_replace_view.sql", + "path": "macros/relations/view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_or_replace_view" }, "macro.dbt.create_schema": { "arguments": [], - "created_at": 1696458269.800509, + "created_at": 1719485736.558099, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__create_schema" @@ -899,14 +943,12 @@ "patch_path": null, "path": "macros/adapters/schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_schema" }, "macro.dbt.create_table_as": { "arguments": [], - "created_at": 1696458269.720823, + "created_at": 1719485736.508673, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__create_table_as" @@ -920,19 +962,17 @@ "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 %}", "meta": {}, "name": "create_table_as", - "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/relations/table/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/table/create_table_as.sql", + "path": "macros/relations/table/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_table_as" }, "macro.dbt.create_view_as": { "arguments": [], - "created_at": 1696458269.731384, + "created_at": 1719485736.515506, "depends_on": { "macros": [ "macro.dbt.default__create_view_as" @@ -946,19 +986,17 @@ "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "meta": {}, "name": "create_view_as", - "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/relations/view/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/create_view_as.sql", + "path": "macros/relations/view/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.create_view_as" }, "macro.dbt.current_timestamp": { "arguments": [], - "created_at": 1696458269.802294, + "created_at": 1719485736.55921, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__current_timestamp" @@ -977,14 +1015,12 @@ "patch_path": null, "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.current_timestamp" }, "macro.dbt.current_timestamp_backcompat": { "arguments": [], - "created_at": 1696458269.8032, + "created_at": 1719485736.559824, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__current_timestamp_backcompat" @@ -1003,14 +1039,12 @@ "patch_path": null, "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.current_timestamp_backcompat" }, "macro.dbt.current_timestamp_in_utc_backcompat": { "arguments": [], - "created_at": 1696458269.803582, + "created_at": 1719485736.5600908, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat" @@ -1029,14 +1063,60 @@ "patch_path": null, "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat" }, + "macro.dbt.date": { + "arguments": [], + "created_at": 1719485736.531044, + "depends_on": { + "macros": [ + "macro.dbt.default__date" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", + "meta": {}, + "name": "date", + "original_file_path": "macros/utils/date.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/date.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.date" + }, + "macro.dbt.date_spine": { + "arguments": [], + "created_at": 1719485736.529869, + "depends_on": { + "macros": [ + "macro.dbt.default__date_spine" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", + "meta": {}, + "name": "date_spine", + "original_file_path": "macros/utils/date_spine.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/date_spine.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.date_spine" + }, "macro.dbt.date_trunc": { "arguments": [], - "created_at": 1696458269.797339, + "created_at": 1719485736.55547, "depends_on": { "macros": [ "macro.dbt.default__date_trunc" @@ -1055,14 +1135,12 @@ "patch_path": null, "path": "macros/utils/date_trunc.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.date_trunc" }, "macro.dbt.dateadd": { "arguments": [], - "created_at": 1696458269.776004, + "created_at": 1719485736.5368361, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__dateadd" @@ -1081,14 +1159,12 @@ "patch_path": null, "path": "macros/utils/dateadd.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.dateadd" }, "macro.dbt.datediff": { "arguments": [], - "created_at": 1696458269.781129, + "created_at": 1719485736.5402482, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__datediff" @@ -1107,14 +1183,12 @@ "patch_path": null, "path": "macros/utils/datediff.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.datediff" }, "macro.dbt.dates_in_range": { "arguments": [], - "created_at": 1696458269.7706811, + "created_at": 1719485736.524234, "depends_on": { "macros": [ "macro.dbt.convert_datetime" @@ -1125,7 +1199,7 @@ "node_color": null, "show": true }, - "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 Partiton 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 %}", + "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 %}", "meta": {}, "name": "dates_in_range", "original_file_path": "macros/etc/datetime.sql", @@ -1133,14 +1207,12 @@ "patch_path": null, "path": "macros/etc/datetime.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.dates_in_range" }, "macro.dbt.default__alter_column_comment": { "arguments": [], - "created_at": 1696458269.832395, + "created_at": 1719485736.5851688, "depends_on": { "macros": [] }, @@ -1157,14 +1229,12 @@ "patch_path": null, "path": "macros/adapters/persist_docs.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__alter_column_comment" }, "macro.dbt.default__alter_column_type": { "arguments": [], - "created_at": 1696458269.846581, + "created_at": 1719485736.6003149, "depends_on": { "macros": [ "macro.dbt.statement" @@ -1183,14 +1253,12 @@ "patch_path": null, "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__alter_column_type" }, "macro.dbt.default__alter_relation_add_remove_columns": { "arguments": [], - "created_at": 1696458269.848277, + "created_at": 1719485736.601542, "depends_on": { "macros": [ "macro.dbt.run_query" @@ -1209,14 +1277,12 @@ "patch_path": null, "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__alter_relation_add_remove_columns" }, "macro.dbt.default__alter_relation_comment": { "arguments": [], - "created_at": 1696458269.83301, + "created_at": 1719485736.585629, "depends_on": { "macros": [] }, @@ -1233,14 +1299,12 @@ "patch_path": null, "path": "macros/adapters/persist_docs.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__alter_relation_comment" }, "macro.dbt.default__any_value": { "arguments": [], - "created_at": 1696458269.7848792, + "created_at": 1719485736.5430348, "depends_on": { "macros": [] }, @@ -1257,14 +1321,12 @@ "patch_path": null, "path": "macros/utils/any_value.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__any_value" }, "macro.dbt.default__apply_grants": { "arguments": [], - "created_at": 1696458269.830645, + "created_at": 1719485736.580575, "depends_on": { "macros": [ "macro.dbt.run_query", @@ -1286,14 +1348,12 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__apply_grants" }, "macro.dbt.default__array_append": { "arguments": [], - "created_at": 1696458269.7997708, + "created_at": 1719485736.557557, "depends_on": { "macros": [] }, @@ -1310,14 +1370,12 @@ "patch_path": null, "path": "macros/utils/array_append.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__array_append" }, "macro.dbt.default__array_concat": { "arguments": [], - "created_at": 1696458269.792536, + "created_at": 1719485736.552268, "depends_on": { "macros": [] }, @@ -1334,14 +1392,12 @@ "patch_path": null, "path": "macros/utils/array_concat.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__array_concat" }, "macro.dbt.default__array_construct": { "arguments": [], - "created_at": 1696458269.7988842, + "created_at": 1719485736.556629, "depends_on": { "macros": [] }, @@ -1358,14 +1414,12 @@ "patch_path": null, "path": "macros/utils/array_construct.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__array_construct" }, "macro.dbt.default__bool_or": { "arguments": [], - "created_at": 1696458269.793303, + "created_at": 1719485736.552653, "depends_on": { "macros": [] }, @@ -1382,14 +1436,12 @@ "patch_path": null, "path": "macros/utils/bool_or.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__bool_or" }, "macro.dbt.default__build_snapshot_table": { "arguments": [], - "created_at": 1696458269.619839, + "created_at": 1719485736.3577101, "depends_on": { "macros": [] }, @@ -1406,14 +1458,12 @@ "patch_path": null, "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__build_snapshot_table" }, "macro.dbt.default__call_dcl_statements": { "arguments": [], - "created_at": 1696458269.828314, + "created_at": 1719485736.577475, "depends_on": { "macros": [ "macro.dbt.statement" @@ -1432,14 +1482,56 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__call_dcl_statements" }, + "macro.dbt.default__can_clone_table": { + "arguments": [], + "created_at": 1719485736.443028, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", + "meta": {}, + "name": "default__can_clone_table", + "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/clone/can_clone_table.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__can_clone_table" + }, + "macro.dbt.default__cast": { + "arguments": [], + "created_at": 1719485736.5423732, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", + "meta": {}, + "name": "default__cast", + "original_file_path": "macros/utils/cast.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/cast.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__cast" + }, "macro.dbt.default__cast_bool_to_text": { "arguments": [], - "created_at": 1696458269.784034, + "created_at": 1719485736.541875, "depends_on": { "macros": [] }, @@ -1456,14 +1548,12 @@ "patch_path": null, "path": "macros/utils/cast_bool_to_text.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__cast_bool_to_text" }, "macro.dbt.default__check_schema_exists": { "arguments": [], - "created_at": 1696458269.8393972, + "created_at": 1719485736.591805, "depends_on": { "macros": [ "macro.dbt.replace", @@ -1483,14 +1573,12 @@ "patch_path": null, "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__check_schema_exists" }, "macro.dbt.default__collect_freshness": { "arguments": [], - "created_at": 1696458269.820089, + "created_at": 1719485736.569667, "depends_on": { "macros": [ "macro.dbt.statement", @@ -1502,7 +1590,7 @@ "node_color": null, "show": true }, - "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').table) }}\n{% endmacro %}", + "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 %}", "meta": {}, "name": "default__collect_freshness", "original_file_path": "macros/adapters/freshness.sql", @@ -1510,14 +1598,12 @@ "patch_path": null, "path": "macros/adapters/freshness.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__collect_freshness" }, "macro.dbt.default__concat": { "arguments": [], - "created_at": 1696458269.774613, + "created_at": 1719485736.5335412, "depends_on": { "macros": [] }, @@ -1534,14 +1620,12 @@ "patch_path": null, "path": "macros/utils/concat.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__concat" }, "macro.dbt.default__copy_grants": { "arguments": [], - "created_at": 1696458269.823154, + "created_at": 1719485736.5727968, "depends_on": { "macros": [] }, @@ -1558,14 +1642,12 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__copy_grants" }, "macro.dbt.default__create_columns": { "arguments": [], - "created_at": 1696458269.616479, + "created_at": 1719485736.354986, "depends_on": { "macros": [ "macro.dbt.statement" @@ -1584,14 +1666,12 @@ "patch_path": null, "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__create_columns" }, "macro.dbt.default__create_csv_table": { "arguments": [], - "created_at": 1696458269.747761, + "created_at": 1719485736.4600089, "depends_on": { "macros": [ "macro.dbt.statement" @@ -1610,14 +1690,12 @@ "patch_path": null, "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__create_csv_table" }, "macro.dbt.default__create_indexes": { "arguments": [], - "created_at": 1696458269.806336, + "created_at": 1719485736.562071, "depends_on": { "macros": [ "macro.dbt.get_create_index_sql", @@ -1637,14 +1715,34 @@ "patch_path": null, "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__create_indexes" }, + "macro.dbt.default__create_or_replace_clone": { + "arguments": [], + "created_at": 1719485736.4434948, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", + "meta": {}, + "name": "default__create_or_replace_clone", + "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/clone/create_or_replace_clone.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__create_or_replace_clone" + }, "macro.dbt.default__create_schema": { "arguments": [], - "created_at": 1696458269.800829, + "created_at": 1719485736.5583, "depends_on": { "macros": [ "macro.dbt.statement" @@ -1663,62 +1761,62 @@ "patch_path": null, "path": "macros/adapters/schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__create_schema" }, "macro.dbt.default__create_table_as": { "arguments": [], - "created_at": 1696458269.721521, + "created_at": 1719485736.509567, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_assert_columns_equivalent", + "macro.dbt.get_table_columns_and_constraints", + "macro.dbt.get_select_subquery" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 as (\n {{ sql }}\n );\n{%- endmacro %}", + "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 %}", "meta": {}, "name": "default__create_table_as", - "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/relations/table/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/table/create_table_as.sql", + "path": "macros/relations/table/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__create_table_as" }, "macro.dbt.default__create_view_as": { "arguments": [], - "created_at": 1696458269.7317991, + "created_at": 1719485736.515955, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_assert_columns_equivalent" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 }} as (\n {{ sql }}\n );\n{%- endmacro %}", + "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 %}", "meta": {}, "name": "default__create_view_as", - "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/relations/view/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/create_view_as.sql", + "path": "macros/relations/view/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__create_view_as" }, "macro.dbt.default__current_timestamp": { "arguments": [], - "created_at": 1696458269.802537, + "created_at": 1719485736.5593758, "depends_on": { "macros": [] }, @@ -1735,14 +1833,12 @@ "patch_path": null, "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__current_timestamp" }, "macro.dbt.default__current_timestamp_backcompat": { "arguments": [], - "created_at": 1696458269.8033202, + "created_at": 1719485736.559911, "depends_on": { "macros": [] }, @@ -1759,14 +1855,12 @@ "patch_path": null, "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__current_timestamp_backcompat" }, "macro.dbt.default__current_timestamp_in_utc_backcompat": { "arguments": [], - "created_at": 1696458269.803849, + "created_at": 1719485736.560272, "depends_on": { "macros": [ "macro.dbt.current_timestamp_backcompat", @@ -1786,14 +1880,60 @@ "patch_path": null, "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat" }, + "macro.dbt.default__date": { + "arguments": [], + "created_at": 1719485736.531544, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__date", + "original_file_path": "macros/utils/date.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/date.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__date" + }, + "macro.dbt.default__date_spine": { + "arguments": [], + "created_at": 1719485736.53054, + "depends_on": { + "macros": [ + "macro.dbt.generate_series", + "macro.dbt.get_intervals_between", + "macro.dbt.dateadd" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__date_spine", + "original_file_path": "macros/utils/date_spine.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/date_spine.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__date_spine" + }, "macro.dbt.default__date_trunc": { "arguments": [], - "created_at": 1696458269.7975512, + "created_at": 1719485736.555618, "depends_on": { "macros": [] }, @@ -1810,14 +1950,12 @@ "patch_path": null, "path": "macros/utils/date_trunc.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__date_trunc" }, "macro.dbt.default__dateadd": { "arguments": [], - "created_at": 1696458269.7762759, + "created_at": 1719485736.537018, "depends_on": { "macros": [] }, @@ -1834,14 +1972,12 @@ "patch_path": null, "path": "macros/utils/dateadd.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__dateadd" }, "macro.dbt.default__datediff": { "arguments": [], - "created_at": 1696458269.7814112, + "created_at": 1719485736.540429, "depends_on": { "macros": [] }, @@ -1858,17 +1994,38 @@ "patch_path": null, "path": "macros/utils/datediff.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__datediff" }, + "macro.dbt.default__drop_materialized_view": { + "arguments": [], + "created_at": 1719485736.4865391, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", + "meta": {}, + "name": "default__drop_materialized_view", + "original_file_path": "macros/relations/materialized_view/drop.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/materialized_view/drop.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__drop_materialized_view" + }, "macro.dbt.default__drop_relation": { "arguments": [], - "created_at": 1696458269.8147898, + "created_at": 1719485736.4714549, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt.statement", + "macro.dbt.get_drop_sql" ] }, "description": "", @@ -1876,22 +2033,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", + "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "meta": {}, "name": "default__drop_relation", - "original_file_path": "macros/adapters/relation.sql", + "original_file_path": "macros/relations/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/relations/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__drop_relation" }, "macro.dbt.default__drop_schema": { "arguments": [], - "created_at": 1696458269.8013818, + "created_at": 1719485736.558672, "depends_on": { "macros": [ "macro.dbt.statement" @@ -1910,14 +2065,78 @@ "patch_path": null, "path": "macros/adapters/schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__drop_schema" }, + "macro.dbt.default__drop_schema_named": { + "arguments": [], + "created_at": 1719485736.476362, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__drop_schema_named", + "original_file_path": "macros/relations/schema.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/schema.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__drop_schema_named" + }, + "macro.dbt.default__drop_table": { + "arguments": [], + "created_at": 1719485736.505599, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", + "meta": {}, + "name": "default__drop_table", + "original_file_path": "macros/relations/table/drop.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/table/drop.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__drop_table" + }, + "macro.dbt.default__drop_view": { + "arguments": [], + "created_at": 1719485736.511198, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", + "meta": {}, + "name": "default__drop_view", + "original_file_path": "macros/relations/view/drop.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/view/drop.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__drop_view" + }, "macro.dbt.default__escape_single_quotes": { "arguments": [], - "created_at": 1696458269.777675, + "created_at": 1719485736.538025, "depends_on": { "macros": [] }, @@ -1934,14 +2153,12 @@ "patch_path": null, "path": "macros/utils/escape_single_quotes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__escape_single_quotes" }, "macro.dbt.default__except": { "arguments": [], - "created_at": 1696458269.7729568, + "created_at": 1719485736.526438, "depends_on": { "macros": [] }, @@ -1958,14 +2175,34 @@ "patch_path": null, "path": "macros/utils/except.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__except" }, + "macro.dbt.default__format_column": { + "arguments": [], + "created_at": 1719485736.504833, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "default__format_column", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/column/columns_spec_ddl.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__format_column" + }, "macro.dbt.default__generate_alias_name": { "arguments": [], - "created_at": 1696458269.7549078, + "created_at": 1719485736.466625, "depends_on": { "macros": [] }, @@ -1974,7 +2211,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", + "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 %}", "meta": {}, "name": "default__generate_alias_name", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", @@ -1982,14 +2219,12 @@ "patch_path": null, "path": "macros/get_custom_name/get_custom_alias.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__generate_alias_name" }, "macro.dbt.default__generate_database_name": { "arguments": [], - "created_at": 1696458269.758259, + "created_at": 1719485736.469049, "depends_on": { "macros": [] }, @@ -2006,14 +2241,12 @@ "patch_path": null, "path": "macros/get_custom_name/get_custom_database.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__generate_database_name" }, "macro.dbt.default__generate_schema_name": { "arguments": [], - "created_at": 1696458269.756475, + "created_at": 1719485736.4677172, "depends_on": { "macros": [] }, @@ -2030,14 +2263,82 @@ "patch_path": null, "path": "macros/get_custom_name/get_custom_schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__generate_schema_name" }, + "macro.dbt.default__generate_series": { + "arguments": [], + "created_at": 1719485736.535907, + "depends_on": { + "macros": [ + "macro.dbt.get_powers_of_two" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__generate_series", + "original_file_path": "macros/utils/generate_series.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/generate_series.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__generate_series" + }, + "macro.dbt.default__get_alter_materialized_view_as_sql": { + "arguments": [], + "created_at": 1719485736.4936142, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_alter_materialized_view_as_sql", + "original_file_path": "macros/relations/materialized_view/alter.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/materialized_view/alter.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql" + }, + "macro.dbt.default__get_assert_columns_equivalent": { + "arguments": [], + "created_at": 1719485736.501285, + "depends_on": { + "macros": [ + "macro.dbt.assert_columns_equivalent" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", + "meta": {}, + "name": "default__get_assert_columns_equivalent", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/column/columns_spec_ddl.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_assert_columns_equivalent" + }, "macro.dbt.default__get_batch_size": { "arguments": [], - "created_at": 1696458269.750355, + "created_at": 1719485736.4618182, "depends_on": { "macros": [] }, @@ -2054,14 +2355,12 @@ "patch_path": null, "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_batch_size" }, "macro.dbt.default__get_binding_char": { "arguments": [], - "created_at": 1696458269.749901, + "created_at": 1719485736.461474, "depends_on": { "macros": [] }, @@ -2078,14 +2377,12 @@ "patch_path": null, "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_binding_char" }, "macro.dbt.default__get_catalog": { "arguments": [], - "created_at": 1696458269.8372722, + "created_at": 1719485736.590454, "depends_on": { "macros": [] }, @@ -2102,17 +2399,60 @@ "patch_path": null, "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_catalog" }, + "macro.dbt.default__get_catalog_relations": { + "arguments": [], + "created_at": 1719485736.589964, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_catalog_relations", + "original_file_path": "macros/adapters/metadata.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/metadata.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_catalog_relations" + }, + "macro.dbt.default__get_column_names": { + "arguments": [], + "created_at": 1719485736.5100741, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_column_names", + "original_file_path": "macros/relations/table/create.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/table/create.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_column_names" + }, "macro.dbt.default__get_columns_in_query": { "arguments": [], - "created_at": 1696458269.8452191, + "created_at": 1719485736.599448, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt.statement", + "macro.dbt.get_empty_subquery_sql" ] }, "description": "", @@ -2120,7 +2460,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", + "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 %}", "meta": {}, "name": "default__get_columns_in_query", "original_file_path": "macros/adapters/columns.sql", @@ -2128,14 +2468,12 @@ "patch_path": null, "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_columns_in_query" }, "macro.dbt.default__get_columns_in_relation": { "arguments": [], - "created_at": 1696458269.843777, + "created_at": 1719485736.59628, "depends_on": { "macros": [] }, @@ -2152,14 +2490,38 @@ "patch_path": null, "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_columns_in_relation" }, + "macro.dbt.default__get_create_backup_sql": { + "arguments": [], + "created_at": 1719485736.47981, + "depends_on": { + "macros": [ + "macro.dbt.make_backup_relation", + "macro.dbt.get_drop_sql", + "macro.dbt.get_rename_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "default__get_create_backup_sql", + "original_file_path": "macros/relations/create_backup.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/create_backup.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_create_backup_sql" + }, "macro.dbt.default__get_create_index_sql": { "arguments": [], - "created_at": 1696458269.805347, + "created_at": 1719485736.561354, "depends_on": { "macros": [] }, @@ -2176,14 +2538,86 @@ "patch_path": null, "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_create_index_sql" }, + "macro.dbt.default__get_create_intermediate_sql": { + "arguments": [], + "created_at": 1719485736.475838, + "depends_on": { + "macros": [ + "macro.dbt.make_intermediate_relation", + "macro.dbt.get_drop_sql", + "macro.dbt.get_create_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "default__get_create_intermediate_sql", + "original_file_path": "macros/relations/create_intermediate.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/create_intermediate.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_create_intermediate_sql" + }, + "macro.dbt.default__get_create_materialized_view_as_sql": { + "arguments": [], + "created_at": 1719485736.494792, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_create_materialized_view_as_sql", + "original_file_path": "macros/relations/materialized_view/create.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/materialized_view/create.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql" + }, + "macro.dbt.default__get_create_sql": { + "arguments": [], + "created_at": 1719485736.483476, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "default__get_create_sql", + "original_file_path": "macros/relations/create.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/create.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_create_sql" + }, "macro.dbt.default__get_create_table_as_sql": { "arguments": [], - "created_at": 1696458269.720119, + "created_at": 1719485736.508211, "depends_on": { "macros": [ "macro.dbt.create_table_as" @@ -2197,19 +2631,17 @@ "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "meta": {}, "name": "default__get_create_table_as_sql", - "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/relations/table/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/table/create_table_as.sql", + "path": "macros/relations/table/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_create_table_as_sql" }, "macro.dbt.default__get_create_view_as_sql": { "arguments": [], - "created_at": 1696458269.7310889, + "created_at": 1719485736.515317, "depends_on": { "macros": [ "macro.dbt.create_view_as" @@ -2223,19 +2655,17 @@ "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "meta": {}, "name": "default__get_create_view_as_sql", - "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/relations/view/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/create_view_as.sql", + "path": "macros/relations/view/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_create_view_as_sql" }, "macro.dbt.default__get_csv_sql": { "arguments": [], - "created_at": 1696458269.749481, + "created_at": 1719485736.461133, "depends_on": { "macros": [] }, @@ -2252,14 +2682,12 @@ "patch_path": null, "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_csv_sql" }, "macro.dbt.default__get_dcl_statement_list": { "arguments": [], - "created_at": 1696458269.827488, + "created_at": 1719485736.5756311, "depends_on": { "macros": [ "macro.dbt.support_multiple_grantees_per_dcl_statement" @@ -2278,14 +2706,12 @@ "patch_path": null, "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_dcl_statement_list" }, "macro.dbt.default__get_delete_insert_merge_sql": { "arguments": [], - "created_at": 1696458269.6825862, + "created_at": 1719485736.415282, "depends_on": { "macros": [ "macro.dbt.get_quoted_csv" @@ -2296,7 +2722,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\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 );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\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 %}", + "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 %}", "meta": {}, "name": "default__get_delete_insert_merge_sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", @@ -2304,38 +2730,153 @@ "patch_path": null, "path": "macros/materializations/models/incremental/merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_delete_insert_merge_sql" }, - "macro.dbt.default__get_grant_sql": { + "macro.dbt.default__get_drop_backup_sql": { "arguments": [], - "created_at": 1696458269.825314, + "created_at": 1719485736.476908, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.make_backup_relation", + "macro.dbt.get_drop_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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", + "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 -%}", "meta": {}, - "name": "default__get_grant_sql", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "default__get_drop_backup_sql", + "original_file_path": "macros/relations/drop_backup.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/relations/drop_backup.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_drop_backup_sql" + }, + "macro.dbt.default__get_drop_index_sql": { + "arguments": [], + "created_at": 1719485736.562772, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_drop_index_sql", + "original_file_path": "macros/adapters/indexes.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/indexes.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_drop_index_sql" + }, + "macro.dbt.default__get_drop_sql": { + "arguments": [], + "created_at": 1719485736.471034, + "depends_on": { + "macros": [ + "macro.dbt.drop_view", + "macro.dbt.drop_table", + "macro.dbt.drop_materialized_view" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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", + "meta": {}, + "name": "default__get_drop_sql", + "original_file_path": "macros/relations/drop.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/drop.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_drop_sql" + }, + "macro.dbt.default__get_empty_schema_sql": { + "arguments": [], + "created_at": 1719485736.5985012, + "depends_on": { + "macros": [ + "macro.dbt.cast" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_empty_schema_sql", + "original_file_path": "macros/adapters/columns.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/columns.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_empty_schema_sql" + }, + "macro.dbt.default__get_empty_subquery_sql": { + "arguments": [], + "created_at": 1719485736.597066, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_empty_subquery_sql", + "original_file_path": "macros/adapters/columns.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/columns.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_empty_subquery_sql" + }, + "macro.dbt.default__get_grant_sql": { + "arguments": [], + "created_at": 1719485736.5742211, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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", + "meta": {}, + "name": "default__get_grant_sql", + "original_file_path": "macros/adapters/apply_grants.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_grant_sql" }, "macro.dbt.default__get_incremental_append_sql": { "arguments": [], - "created_at": 1696458269.687379, + "created_at": 1719485736.418623, "depends_on": { "macros": [ "macro.dbt.get_insert_into_sql" @@ -2354,14 +2895,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_incremental_append_sql" }, "macro.dbt.default__get_incremental_default_sql": { "arguments": [], - "created_at": 1696458269.690251, + "created_at": 1719485736.4215739, "depends_on": { "macros": [ "macro.dbt.get_incremental_append_sql" @@ -2380,14 +2919,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_incremental_default_sql" }, "macro.dbt.default__get_incremental_delete_insert_sql": { "arguments": [], - "created_at": 1696458269.688123, + "created_at": 1719485736.419171, "depends_on": { "macros": [ "macro.dbt.get_delete_insert_merge_sql" @@ -2398,7 +2935,7 @@ "node_color": null, "show": true }, - "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\"])) %}\n\n{% endmacro %}", + "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 %}", "meta": {}, "name": "default__get_incremental_delete_insert_sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", @@ -2406,14 +2943,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql" }, "macro.dbt.default__get_incremental_insert_overwrite_sql": { "arguments": [], - "created_at": 1696458269.689686, + "created_at": 1719485736.421212, "depends_on": { "macros": [ "macro.dbt.get_insert_overwrite_merge_sql" @@ -2424,7 +2959,7 @@ "node_color": null, "show": true }, - "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[\"predicates\"])) %}\n\n{% endmacro %}", + "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 %}", "meta": {}, "name": "default__get_incremental_insert_overwrite_sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", @@ -2432,14 +2967,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql" }, "macro.dbt.default__get_incremental_merge_sql": { "arguments": [], - "created_at": 1696458269.6889029, + "created_at": 1719485736.420272, "depends_on": { "macros": [ "macro.dbt.get_merge_sql" @@ -2450,7 +2983,7 @@ "node_color": null, "show": true }, - "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\"])) %}\n\n{% endmacro %}", + "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 %}", "meta": {}, "name": "default__get_incremental_merge_sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", @@ -2458,14 +2991,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_incremental_merge_sql" }, "macro.dbt.default__get_insert_overwrite_merge_sql": { "arguments": [], - "created_at": 1696458269.684117, + "created_at": 1719485736.416304, "depends_on": { "macros": [ "macro.dbt.get_quoted_csv" @@ -2484,14 +3015,81 @@ "patch_path": null, "path": "macros/materializations/models/incremental/merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql" }, + "macro.dbt.default__get_intervals_between": { + "arguments": [], + "created_at": 1719485736.5290911, + "depends_on": { + "macros": [ + "macro.dbt.statement", + "macro.dbt.datediff" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_intervals_between", + "original_file_path": "macros/utils/date_spine.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/date_spine.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_intervals_between" + }, + "macro.dbt.default__get_limit_subquery_sql": { + "arguments": [], + "created_at": 1719485736.581942, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_limit_subquery_sql", + "original_file_path": "macros/adapters/show.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/show.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_limit_subquery_sql" + }, + "macro.dbt.default__get_materialized_view_configuration_changes": { + "arguments": [], + "created_at": 1719485736.4943428, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "default__get_materialized_view_configuration_changes", + "original_file_path": "macros/relations/materialized_view/alter.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/materialized_view/alter.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes" + }, "macro.dbt.default__get_merge_sql": { "arguments": [], - "created_at": 1696458269.680794, + "created_at": 1719485736.413476, "depends_on": { "macros": [ "macro.dbt.get_quoted_csv", @@ -2503,7 +3101,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + 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 %}", + "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 %}", "meta": {}, "name": "default__get_merge_sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", @@ -2511,14 +3109,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_merge_sql" }, "macro.dbt.default__get_merge_update_columns": { "arguments": [], - "created_at": 1696458269.67032, + "created_at": 1719485736.399054, "depends_on": { "macros": [] }, @@ -2535,14 +3131,12 @@ "patch_path": null, "path": "macros/materializations/models/incremental/column_helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_merge_update_columns" }, "macro.dbt.default__get_or_create_relation": { "arguments": [], - "created_at": 1696458269.817579, + "created_at": 1719485736.568331, "depends_on": { "macros": [] }, @@ -2559,14 +3153,12 @@ "patch_path": null, "path": "macros/adapters/relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt.default__get_or_create_relation" }, - "macro.dbt.default__get_revoke_sql": { + "macro.dbt.default__get_powers_of_two": { "arguments": [], - "created_at": 1696458269.8259919, + "created_at": 1719485736.534994, "depends_on": { "macros": [] }, @@ -2575,22 +3167,20 @@ "node_color": null, "show": true }, - "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", + "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 %}", "meta": {}, - "name": "default__get_revoke_sql", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "default__get_powers_of_two", + "original_file_path": "macros/utils/generate_series.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/utils/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__get_revoke_sql" + "unique_id": "macro.dbt.default__get_powers_of_two" }, - "macro.dbt.default__get_show_grant_sql": { + "macro.dbt.default__get_relation_last_modified": { "arguments": [], - "created_at": 1696458269.824637, + "created_at": 1719485736.5935519, "depends_on": { "macros": [] }, @@ -2599,22 +3189,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__get_show_grant_sql", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "default__get_relation_last_modified", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__get_show_grant_sql" + "unique_id": "macro.dbt.default__get_relation_last_modified" }, - "macro.dbt.default__get_test_sql": { + "macro.dbt.default__get_relations": { "arguments": [], - "created_at": 1696458269.662534, + "created_at": 1719485736.592618, "depends_on": { "macros": [] }, @@ -2623,46 +3211,45 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "meta": {}, - "name": "default__get_test_sql", - "original_file_path": "macros/materializations/tests/helpers.sql", + "name": "default__get_relations", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/tests/helpers.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__get_test_sql" + "unique_id": "macro.dbt.default__get_relations" }, - "macro.dbt.default__get_true_sql": { + "macro.dbt.default__get_rename_intermediate_sql": { "arguments": [], - "created_at": 1696458269.6173341, + "created_at": 1719485736.485399, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.make_intermediate_relation", + "macro.dbt.get_rename_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", + "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 -%}", "meta": {}, - "name": "default__get_true_sql", - "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__get_rename_intermediate_sql", + "original_file_path": "macros/relations/rename_intermediate.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/helpers.sql", + "path": "macros/relations/rename_intermediate.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__get_true_sql" + "unique_id": "macro.dbt.default__get_rename_intermediate_sql" }, - "macro.dbt.default__get_where_subquery": { + "macro.dbt.default__get_rename_materialized_view_sql": { "arguments": [], - "created_at": 1696458269.6639218, + "created_at": 1719485736.491203, "depends_on": { "macros": [] }, @@ -2671,46 +3258,46 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__get_where_subquery", - "original_file_path": "macros/materializations/tests/where_subquery.sql", + "name": "default__get_rename_materialized_view_sql", + "original_file_path": "macros/relations/materialized_view/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/tests/where_subquery.sql", + "path": "macros/relations/materialized_view/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__get_where_subquery" + "unique_id": "macro.dbt.default__get_rename_materialized_view_sql" }, - "macro.dbt.default__handle_existing_table": { + "macro.dbt.default__get_rename_sql": { "arguments": [], - "created_at": 1696458269.727338, + "created_at": 1719485736.4781098, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_rename_view_sql", + "macro.dbt.get_rename_table_sql", + "macro.dbt.get_rename_materialized_view_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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", "meta": {}, - "name": "default__handle_existing_table", - "original_file_path": "macros/materializations/models/view/helpers.sql", + "name": "default__get_rename_sql", + "original_file_path": "macros/relations/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/helpers.sql", + "path": "macros/relations/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__handle_existing_table" + "unique_id": "macro.dbt.default__get_rename_sql" }, - "macro.dbt.default__hash": { + "macro.dbt.default__get_rename_table_sql": { "arguments": [], - "created_at": 1696458269.783129, + "created_at": 1719485736.507071, "depends_on": { "macros": [] }, @@ -2719,22 +3306,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", + "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 %}", "meta": {}, - "name": "default__hash", - "original_file_path": "macros/utils/hash.sql", + "name": "default__get_rename_table_sql", + "original_file_path": "macros/relations/table/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/hash.sql", + "path": "macros/relations/table/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__hash" + "unique_id": "macro.dbt.default__get_rename_table_sql" }, - "macro.dbt.default__information_schema_name": { + "macro.dbt.default__get_rename_view_sql": { "arguments": [], - "created_at": 1696458269.8378282, + "created_at": 1719485736.514697, "depends_on": { "macros": [] }, @@ -2743,22 +3328,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", + "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 %}", "meta": {}, - "name": "default__information_schema_name", - "original_file_path": "macros/adapters/metadata.sql", + "name": "default__get_rename_view_sql", + "original_file_path": "macros/relations/view/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/relations/view/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__information_schema_name" + "unique_id": "macro.dbt.default__get_rename_view_sql" }, - "macro.dbt.default__intersect": { + "macro.dbt.default__get_replace_materialized_view_sql": { "arguments": [], - "created_at": 1696458269.776896, + "created_at": 1719485736.4885828, "depends_on": { "macros": [] }, @@ -2767,25 +3350,31 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__intersect", - "original_file_path": "macros/utils/intersect.sql", + "name": "default__get_replace_materialized_view_sql", + "original_file_path": "macros/relations/materialized_view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/intersect.sql", + "path": "macros/relations/materialized_view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__intersect" + "unique_id": "macro.dbt.default__get_replace_materialized_view_sql" }, - "macro.dbt.default__last_day": { + "macro.dbt.default__get_replace_sql": { "arguments": [], - "created_at": 1696458269.794904, + "created_at": 1719485736.475151, "depends_on": { "macros": [ - "macro.dbt.default_last_day" + "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": "", @@ -2793,22 +3382,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", + "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 %}", "meta": {}, - "name": "default__last_day", - "original_file_path": "macros/utils/last_day.sql", + "name": "default__get_replace_sql", + "original_file_path": "macros/relations/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/last_day.sql", + "path": "macros/relations/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__last_day" + "unique_id": "macro.dbt.default__get_replace_sql" }, - "macro.dbt.default__length": { + "macro.dbt.default__get_replace_table_sql": { "arguments": [], - "created_at": 1696458269.7753239, + "created_at": 1719485736.506342, "depends_on": { "macros": [] }, @@ -2817,22 +3404,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", + "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 %}", "meta": {}, - "name": "default__length", - "original_file_path": "macros/utils/length.sql", + "name": "default__get_replace_table_sql", + "original_file_path": "macros/relations/table/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/length.sql", + "path": "macros/relations/table/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__length" + "unique_id": "macro.dbt.default__get_replace_table_sql" }, - "macro.dbt.default__list_relations_without_caching": { + "macro.dbt.default__get_replace_view_sql": { "arguments": [], - "created_at": 1696458269.839978, + "created_at": 1719485736.512308, "depends_on": { "macros": [] }, @@ -2841,101 +3426,88 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__list_relations_without_caching", - "original_file_path": "macros/adapters/metadata.sql", + "name": "default__get_replace_view_sql", + "original_file_path": "macros/relations/view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/relations/view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__list_relations_without_caching" + "unique_id": "macro.dbt.default__get_replace_view_sql" }, - "macro.dbt.default__list_schemas": { + "macro.dbt.default__get_revoke_sql": { "arguments": [], - "created_at": 1696458269.83854, + "created_at": 1719485736.574667, "depends_on": { - "macros": [ - "macro.dbt.information_schema_name", - "macro.dbt.run_query" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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", "meta": {}, - "name": "default__list_schemas", - "original_file_path": "macros/adapters/metadata.sql", + "name": "default__get_revoke_sql", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__list_schemas" + "unique_id": "macro.dbt.default__get_revoke_sql" }, - "macro.dbt.default__listagg": { + "macro.dbt.default__get_select_subquery": { "arguments": [], - "created_at": 1696458269.780426, + "created_at": 1719485736.510467, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_column_names" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__listagg", - "original_file_path": "macros/utils/listagg.sql", + "name": "default__get_select_subquery", + "original_file_path": "macros/relations/table/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/listagg.sql", + "path": "macros/relations/table/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__listagg" + "unique_id": "macro.dbt.default__get_select_subquery" }, - "macro.dbt.default__load_csv_rows": { + "macro.dbt.default__get_show_grant_sql": { "arguments": [], - "created_at": 1696458269.753568, + "created_at": 1719485736.573777, "depends_on": { - "macros": [ - "macro.dbt.get_batch_size", - "macro.dbt.get_seed_column_quoted_csv", - "macro.dbt.get_binding_char" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "meta": {}, - "name": "default__load_csv_rows", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__get_show_grant_sql", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__load_csv_rows" + "unique_id": "macro.dbt.default__get_show_grant_sql" }, - "macro.dbt.default__make_backup_relation": { + "macro.dbt.default__get_show_indexes_sql": { "arguments": [], - "created_at": 1696458269.814139, + "created_at": 1719485736.563092, "depends_on": { "macros": [] }, @@ -2944,25 +3516,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__make_backup_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__get_show_indexes_sql", + "original_file_path": "macros/adapters/indexes.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__make_backup_relation" + "unique_id": "macro.dbt.default__get_show_indexes_sql" }, - "macro.dbt.default__make_intermediate_relation": { + "macro.dbt.default__get_table_columns_and_constraints": { "arguments": [], - "created_at": 1696458269.812382, + "created_at": 1719485736.497637, "depends_on": { "macros": [ - "macro.dbt.default__make_temp_relation" + "macro.dbt.table_columns_and_constraints" ] }, "description": "", @@ -2970,22 +3540,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", + "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "meta": {}, - "name": "default__make_intermediate_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__get_table_columns_and_constraints", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/relations/column/columns_spec_ddl.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__make_intermediate_relation" + "unique_id": "macro.dbt.default__get_table_columns_and_constraints" }, - "macro.dbt.default__make_temp_relation": { + "macro.dbt.default__get_test_sql": { "arguments": [], - "created_at": 1696458269.8132212, + "created_at": 1719485736.372639, "depends_on": { "macros": [] }, @@ -2994,74 +3562,66 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__make_temp_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__get_test_sql", + "original_file_path": "macros/materializations/tests/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/materializations/tests/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__make_temp_relation" + "unique_id": "macro.dbt.default__get_test_sql" }, - "macro.dbt.default__persist_docs": { + "macro.dbt.default__get_true_sql": { "arguments": [], - "created_at": 1696458269.834239, + "created_at": 1719485736.3555431, "depends_on": { - "macros": [ - "macro.dbt.run_query", - "macro.dbt.alter_relation_comment", - "macro.dbt.alter_column_comment" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "meta": {}, - "name": "default__persist_docs", - "original_file_path": "macros/adapters/persist_docs.sql", + "name": "default__get_true_sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/persist_docs.sql", + "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__persist_docs" + "unique_id": "macro.dbt.default__get_true_sql" }, - "macro.dbt.default__position": { + "macro.dbt.default__get_unit_test_sql": { "arguments": [], - "created_at": 1696458269.785729, + "created_at": 1719485736.3736708, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.string_literal" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", + "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 %}", "meta": {}, - "name": "default__position", - "original_file_path": "macros/utils/position.sql", + "name": "default__get_unit_test_sql", + "original_file_path": "macros/materializations/tests/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/position.sql", + "path": "macros/materializations/tests/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__position" + "unique_id": "macro.dbt.default__get_unit_test_sql" }, - "macro.dbt.default__post_snapshot": { + "macro.dbt.default__get_where_subquery": { "arguments": [], - "created_at": 1696458269.6169112, + "created_at": 1719485736.374502, "depends_on": { "macros": [] }, @@ -3070,48 +3630,42 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__post_snapshot", - "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__get_where_subquery", + "original_file_path": "macros/materializations/tests/where_subquery.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/helpers.sql", + "path": "macros/materializations/tests/where_subquery.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__post_snapshot" + "unique_id": "macro.dbt.default__get_where_subquery" }, - "macro.dbt.default__rename_relation": { + "macro.dbt.default__handle_existing_table": { "arguments": [], - "created_at": 1696458269.8161411, + "created_at": 1719485736.514176, "depends_on": { - "macros": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__rename_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__handle_existing_table", + "original_file_path": "macros/relations/view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/relations/view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__rename_relation" + "unique_id": "macro.dbt.default__handle_existing_table" }, - "macro.dbt.default__replace": { + "macro.dbt.default__hash": { "arguments": [], - "created_at": 1696458269.77388, + "created_at": 1719485736.541434, "depends_on": { "macros": [] }, @@ -3120,48 +3674,42 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "meta": {}, - "name": "default__replace", - "original_file_path": "macros/utils/replace.sql", + "name": "default__hash", + "original_file_path": "macros/utils/hash.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/replace.sql", + "path": "macros/utils/hash.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__replace" + "unique_id": "macro.dbt.default__hash" }, - "macro.dbt.default__reset_csv_table": { + "macro.dbt.default__information_schema_name": { "arguments": [], - "created_at": 1696458269.748949, + "created_at": 1719485736.590823, "depends_on": { - "macros": [ - "macro.dbt.create_csv_table" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "meta": {}, - "name": "default__reset_csv_table", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__information_schema_name", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__reset_csv_table" + "unique_id": "macro.dbt.default__information_schema_name" }, - "macro.dbt.default__right": { + "macro.dbt.default__intersect": { "arguments": [], - "created_at": 1696458269.778592, + "created_at": 1719485736.537451, "depends_on": { "macros": [] }, @@ -3170,72 +3718,66 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", + "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "meta": {}, - "name": "default__right", - "original_file_path": "macros/utils/right.sql", + "name": "default__intersect", + "original_file_path": "macros/utils/intersect.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/right.sql", + "path": "macros/utils/intersect.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__right" + "unique_id": "macro.dbt.default__intersect" }, - "macro.dbt.default__safe_cast": { + "macro.dbt.default__last_day": { "arguments": [], - "created_at": 1696458269.782259, + "created_at": 1719485736.55349, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default_last_day" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "meta": {}, - "name": "default__safe_cast", - "original_file_path": "macros/utils/safe_cast.sql", + "name": "default__last_day", + "original_file_path": "macros/utils/last_day.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/safe_cast.sql", + "path": "macros/utils/last_day.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__safe_cast" + "unique_id": "macro.dbt.default__last_day" }, - "macro.dbt.default__snapshot_get_time": { + "macro.dbt.default__length": { "arguments": [], - "created_at": 1696458269.8029382, + "created_at": 1719485736.536426, "depends_on": { - "macros": [ - "macro.dbt.current_timestamp" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", + "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "meta": {}, - "name": "default__snapshot_get_time", - "original_file_path": "macros/adapters/timestamps.sql", + "name": "default__length", + "original_file_path": "macros/utils/length.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/timestamps.sql", + "path": "macros/utils/length.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__snapshot_get_time" + "unique_id": "macro.dbt.default__length" }, - "macro.dbt.default__snapshot_hash_arguments": { + "macro.dbt.default__list_relations_without_caching": { "arguments": [], - "created_at": 1696458269.601996, + "created_at": 1719485736.592287, "depends_on": { "macros": [] }, @@ -3244,96 +3786,93 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__snapshot_hash_arguments", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "default__list_relations_without_caching", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__snapshot_hash_arguments" + "unique_id": "macro.dbt.default__list_relations_without_caching" }, - "macro.dbt.default__snapshot_merge_sql": { + "macro.dbt.default__list_schemas": { "arguments": [], - "created_at": 1696458269.595372, + "created_at": 1719485736.591269, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.information_schema_name", + "macro.dbt.run_query" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__snapshot_merge_sql", - "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", + "name": "default__list_schemas", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/snapshot_merge.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__snapshot_merge_sql" + "unique_id": "macro.dbt.default__list_schemas" }, - "macro.dbt.default__snapshot_staging_table": { + "macro.dbt.default__listagg": { "arguments": [], - "created_at": 1696458269.619116, + "created_at": 1719485736.539655, "depends_on": { - "macros": [ - "macro.dbt.snapshot_get_time" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__snapshot_staging_table", - "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__listagg", + "original_file_path": "macros/utils/listagg.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/helpers.sql", + "path": "macros/utils/listagg.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__snapshot_staging_table" + "unique_id": "macro.dbt.default__listagg" }, - "macro.dbt.default__snapshot_string_as_time": { + "macro.dbt.default__load_csv_rows": { "arguments": [], - "created_at": 1696458269.60375, + "created_at": 1719485736.465408, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_batch_size", + "macro.dbt.get_seed_column_quoted_csv", + "macro.dbt.get_binding_char" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__snapshot_string_as_time", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "default__load_csv_rows", + "original_file_path": "macros/materializations/seeds/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__snapshot_string_as_time" + "unique_id": "macro.dbt.default__load_csv_rows" }, - "macro.dbt.default__split_part": { + "macro.dbt.default__make_backup_relation": { "arguments": [], - "created_at": 1696458269.796368, + "created_at": 1719485736.5670989, "depends_on": { "macros": [] }, @@ -3342,46 +3881,44 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__split_part", - "original_file_path": "macros/utils/split_part.sql", + "name": "default__make_backup_relation", + "original_file_path": "macros/adapters/relation.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/split_part.sql", + "path": "macros/adapters/relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__split_part" + "unique_id": "macro.dbt.default__make_backup_relation" }, - "macro.dbt.default__string_literal": { + "macro.dbt.default__make_intermediate_relation": { "arguments": [], - "created_at": 1696458269.786437, + "created_at": 1719485736.56591, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__make_temp_relation" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", + "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "meta": {}, - "name": "default__string_literal", - "original_file_path": "macros/utils/literal.sql", + "name": "default__make_intermediate_relation", + "original_file_path": "macros/adapters/relation.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/literal.sql", + "path": "macros/adapters/relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__string_literal" + "unique_id": "macro.dbt.default__make_intermediate_relation" }, - "macro.dbt.default__support_multiple_grantees_per_dcl_statement": { + "macro.dbt.default__make_temp_relation": { "arguments": [], - "created_at": 1696458269.823607, + "created_at": 1719485736.566462, "depends_on": { "macros": [] }, @@ -3390,72 +3927,68 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", + "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 %}", "meta": {}, - "name": "default__support_multiple_grantees_per_dcl_statement", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "default__make_temp_relation", + "original_file_path": "macros/adapters/relation.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/adapters/relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement" + "unique_id": "macro.dbt.default__make_temp_relation" }, - "macro.dbt.default__test_accepted_values": { + "macro.dbt.default__persist_docs": { "arguments": [], - "created_at": 1696458269.761441, + "created_at": 1719485736.586432, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.run_query", + "macro.dbt.alter_relation_comment", + "macro.dbt.alter_column_comment" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__test_accepted_values", - "original_file_path": "macros/generic_test_sql/accepted_values.sql", + "name": "default__persist_docs", + "original_file_path": "macros/adapters/persist_docs.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/generic_test_sql/accepted_values.sql", + "path": "macros/adapters/persist_docs.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__test_accepted_values" + "unique_id": "macro.dbt.default__persist_docs" }, - "macro.dbt.default__test_not_null": { + "macro.dbt.default__position": { "arguments": [], - "created_at": 1696458269.7597172, + "created_at": 1719485736.543534, "depends_on": { - "macros": [ - "macro.dbt.should_store_failures" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "meta": {}, - "name": "default__test_not_null", - "original_file_path": "macros/generic_test_sql/not_null.sql", + "name": "default__position", + "original_file_path": "macros/utils/position.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/generic_test_sql/not_null.sql", + "path": "macros/utils/position.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__test_not_null" + "unique_id": "macro.dbt.default__position" }, - "macro.dbt.default__test_relationships": { + "macro.dbt.default__post_snapshot": { "arguments": [], - "created_at": 1696458269.759, + "created_at": 1719485736.3552608, "depends_on": { "macros": [] }, @@ -3464,22 +3997,20 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "meta": {}, - "name": "default__test_relationships", - "original_file_path": "macros/generic_test_sql/relationships.sql", + "name": "default__post_snapshot", + "original_file_path": "macros/materializations/snapshots/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/generic_test_sql/relationships.sql", + "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__test_relationships" + "unique_id": "macro.dbt.default__post_snapshot" }, - "macro.dbt.default__test_unique": { + "macro.dbt.default__refresh_materialized_view": { "arguments": [], - "created_at": 1696458269.760334, + "created_at": 1719485736.49013, "depends_on": { "macros": [] }, @@ -3488,22 +4019,20 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "default__test_unique", - "original_file_path": "macros/generic_test_sql/unique.sql", + "name": "default__refresh_materialized_view", + "original_file_path": "macros/relations/materialized_view/refresh.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/generic_test_sql/unique.sql", + "path": "macros/relations/materialized_view/refresh.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__test_unique" + "unique_id": "macro.dbt.default__refresh_materialized_view" }, - "macro.dbt.default__truncate_relation": { + "macro.dbt.default__rename_relation": { "arguments": [], - "created_at": 1696458269.815354, + "created_at": 1719485736.4786189, "depends_on": { "macros": [ "macro.dbt.statement" @@ -3514,22 +4043,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__truncate_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__rename_relation", + "original_file_path": "macros/relations/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/relations/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__truncate_relation" + "unique_id": "macro.dbt.default__rename_relation" }, - "macro.dbt.default__type_bigint": { + "macro.dbt.default__replace": { "arguments": [], - "created_at": 1696458269.790592, + "created_at": 1719485736.533091, "depends_on": { "macros": [] }, @@ -3538,46 +4065,44 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__type_bigint", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__replace", + "original_file_path": "macros/utils/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/utils/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_bigint" + "unique_id": "macro.dbt.default__replace" }, - "macro.dbt.default__type_boolean": { + "macro.dbt.default__reset_csv_table": { "arguments": [], - "created_at": 1696458269.791612, + "created_at": 1719485736.460783, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.create_csv_table" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", + "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 %}", "meta": {}, - "name": "default__type_boolean", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__reset_csv_table", + "original_file_path": "macros/materializations/seeds/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_boolean" + "unique_id": "macro.dbt.default__reset_csv_table" }, - "macro.dbt.default__type_float": { + "macro.dbt.default__resolve_model_name": { "arguments": [], - "created_at": 1696458269.789509, + "created_at": 1719485736.615371, "depends_on": { "macros": [] }, @@ -3586,22 +4111,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", + "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "meta": {}, - "name": "default__type_float", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__resolve_model_name", + "original_file_path": "macros/python_model/python.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/python_model/python.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_float" + "unique_id": "macro.dbt.default__resolve_model_name" }, - "macro.dbt.default__type_int": { + "macro.dbt.default__right": { "arguments": [], - "created_at": 1696458269.7910988, + "created_at": 1719485736.538501, "depends_on": { "macros": [] }, @@ -3610,22 +4133,20 @@ "node_color": null, "show": true }, - "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "meta": {}, - "name": "default__type_int", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__right", + "original_file_path": "macros/utils/right.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/utils/right.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_int" + "unique_id": "macro.dbt.default__right" }, - "macro.dbt.default__type_numeric": { + "macro.dbt.default__safe_cast": { "arguments": [], - "created_at": 1696458269.790067, + "created_at": 1719485736.540907, "depends_on": { "macros": [] }, @@ -3634,46 +4155,44 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__type_numeric", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__safe_cast", + "original_file_path": "macros/utils/safe_cast.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/utils/safe_cast.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_numeric" + "unique_id": "macro.dbt.default__safe_cast" }, - "macro.dbt.default__type_string": { + "macro.dbt.default__snapshot_get_time": { "arguments": [], - "created_at": 1696458269.788338, + "created_at": 1719485736.559646, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.current_timestamp" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", + "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "meta": {}, - "name": "default__type_string", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__snapshot_get_time", + "original_file_path": "macros/adapters/timestamps.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/adapters/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_string" + "unique_id": "macro.dbt.default__snapshot_get_time" }, - "macro.dbt.default__type_timestamp": { + "macro.dbt.default__snapshot_hash_arguments": { "arguments": [], - "created_at": 1696458269.788992, + "created_at": 1719485736.345648, "depends_on": { "macros": [] }, @@ -3682,73 +4201,66 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "default__type_timestamp", - "original_file_path": "macros/utils/data_types.sql", + "name": "default__snapshot_hash_arguments", + "original_file_path": "macros/materializations/snapshots/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/materializations/snapshots/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default__type_timestamp" + "unique_id": "macro.dbt.default__snapshot_hash_arguments" }, - "macro.dbt.default_last_day": { + "macro.dbt.default__snapshot_merge_sql": { "arguments": [], - "created_at": 1696458269.7946408, + "created_at": 1719485736.340331, "depends_on": { - "macros": [ - "macro.dbt.dateadd", - "macro.dbt.date_trunc" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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", + "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 %}", "meta": {}, - "name": "default_last_day", - "original_file_path": "macros/utils/last_day.sql", + "name": "default__snapshot_merge_sql", + "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/last_day.sql", + "path": "macros/materializations/snapshots/snapshot_merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.default_last_day" + "unique_id": "macro.dbt.default__snapshot_merge_sql" }, - "macro.dbt.diff_column_data_types": { + "macro.dbt.default__snapshot_staging_table": { "arguments": [], - "created_at": 1696458269.6687229, + "created_at": 1719485736.356719, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.snapshot_get_time" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "diff_column_data_types", - "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "default__snapshot_staging_table", + "original_file_path": "macros/materializations/snapshots/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/column_helpers.sql", + "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.diff_column_data_types" + "unique_id": "macro.dbt.default__snapshot_staging_table" }, - "macro.dbt.diff_columns": { + "macro.dbt.default__snapshot_string_as_time": { "arguments": [], - "created_at": 1696458269.667535, + "created_at": 1719485736.346766, "depends_on": { "macros": [] }, @@ -3757,48 +4269,42 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "diff_columns", - "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "default__snapshot_string_as_time", + "original_file_path": "macros/materializations/snapshots/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/column_helpers.sql", + "path": "macros/materializations/snapshots/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.diff_columns" + "unique_id": "macro.dbt.default__snapshot_string_as_time" }, - "macro.dbt.drop_relation": { + "macro.dbt.default__split_part": { "arguments": [], - "created_at": 1696458269.814443, + "created_at": 1719485736.554402, "depends_on": { - "macros": [ - "macro.dbt.default__drop_relation" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "drop_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__split_part", + "original_file_path": "macros/utils/split_part.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/utils/split_part.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.drop_relation" + "unique_id": "macro.dbt.default__split_part" }, - "macro.dbt.drop_relation_if_exists": { + "macro.dbt.default__string_literal": { "arguments": [], - "created_at": 1696458269.8185081, + "created_at": 1719485736.544776, "depends_on": { "macros": [] }, @@ -3807,77 +4313,67 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", + "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "meta": {}, - "name": "drop_relation_if_exists", - "original_file_path": "macros/adapters/relation.sql", + "name": "default__string_literal", + "original_file_path": "macros/utils/literal.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/utils/literal.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.drop_relation_if_exists" + "unique_id": "macro.dbt.default__string_literal" }, - "macro.dbt.drop_schema": { + "macro.dbt.default__support_multiple_grantees_per_dcl_statement": { "arguments": [], - "created_at": 1696458269.8010921, + "created_at": 1719485736.573099, "depends_on": { - "macros": [ - "macro.dbt_postgres.postgres__drop_schema" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", + "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "meta": {}, - "name": "drop_schema", - "original_file_path": "macros/adapters/schema.sql", + "name": "default__support_multiple_grantees_per_dcl_statement", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/schema.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.drop_schema" + "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement" }, - "macro.dbt.escape_single_quotes": { + "macro.dbt.default__test_accepted_values": { "arguments": [], - "created_at": 1696458269.777445, + "created_at": 1719485736.517527, "depends_on": { - "macros": [ - "macro.dbt.default__escape_single_quotes" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "escape_single_quotes", - "original_file_path": "macros/utils/escape_single_quotes.sql", + "name": "default__test_accepted_values", + "original_file_path": "macros/generic_test_sql/accepted_values.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/escape_single_quotes.sql", + "path": "macros/generic_test_sql/accepted_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.escape_single_quotes" + "unique_id": "macro.dbt.default__test_accepted_values" }, - "macro.dbt.except": { + "macro.dbt.default__test_not_null": { "arguments": [], - "created_at": 1696458269.7728372, + "created_at": 1719485736.516648, "depends_on": { "macros": [ - "macro.dbt.default__except" + "macro.dbt.should_store_failures" ] }, "description": "", @@ -3885,77 +4381,67 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "except", - "original_file_path": "macros/utils/except.sql", + "name": "default__test_not_null", + "original_file_path": "macros/generic_test_sql/not_null.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/except.sql", + "path": "macros/generic_test_sql/not_null.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.except" + "unique_id": "macro.dbt.default__test_not_null" }, - "macro.dbt.generate_alias_name": { + "macro.dbt.default__test_relationships": { "arguments": [], - "created_at": 1696458269.7544892, + "created_at": 1719485736.516331, "depends_on": { - "macros": [ - "macro.dbt.default__generate_alias_name" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "generate_alias_name", - "original_file_path": "macros/get_custom_name/get_custom_alias.sql", + "name": "default__test_relationships", + "original_file_path": "macros/generic_test_sql/relationships.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/get_custom_name/get_custom_alias.sql", + "path": "macros/generic_test_sql/relationships.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.generate_alias_name" + "unique_id": "macro.dbt.default__test_relationships" }, - "macro.dbt.generate_database_name": { + "macro.dbt.default__test_unique": { "arguments": [], - "created_at": 1696458269.757828, + "created_at": 1719485736.5169122, "depends_on": { - "macros": [ - "macro.dbt.default__generate_database_name" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "generate_database_name", - "original_file_path": "macros/get_custom_name/get_custom_database.sql", + "name": "default__test_unique", + "original_file_path": "macros/generic_test_sql/unique.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/get_custom_name/get_custom_database.sql", + "path": "macros/generic_test_sql/unique.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.generate_database_name" + "unique_id": "macro.dbt.default__test_unique" }, - "macro.dbt.generate_schema_name": { + "macro.dbt.default__truncate_relation": { "arguments": [], - "created_at": 1696458269.756017, + "created_at": 1719485736.5674748, "depends_on": { "macros": [ - "macro.dbt.default__generate_schema_name" + "macro.dbt.statement" ] }, "description": "", @@ -3963,22 +4449,20 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "meta": {}, - "name": "generate_schema_name", - "original_file_path": "macros/get_custom_name/get_custom_schema.sql", + "name": "default__truncate_relation", + "original_file_path": "macros/adapters/relation.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/get_custom_name/get_custom_schema.sql", + "path": "macros/adapters/relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.generate_schema_name" + "unique_id": "macro.dbt.default__truncate_relation" }, - "macro.dbt.generate_schema_name_for_env": { + "macro.dbt.default__type_bigint": { "arguments": [], - "created_at": 1696458269.756963, + "created_at": 1719485736.5486028, "depends_on": { "macros": [] }, @@ -3987,181 +4471,155 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "meta": {}, - "name": "generate_schema_name_for_env", - "original_file_path": "macros/get_custom_name/get_custom_schema.sql", + "name": "default__type_bigint", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/get_custom_name/get_custom_schema.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.generate_schema_name_for_env" + "unique_id": "macro.dbt.default__type_bigint" }, - "macro.dbt.get_batch_size": { + "macro.dbt.default__type_boolean": { "arguments": [], - "created_at": 1696458269.750157, + "created_at": 1719485736.550734, "depends_on": { - "macros": [ - "macro.dbt.default__get_batch_size" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", + "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "meta": {}, - "name": "get_batch_size", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__type_boolean", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_batch_size" + "unique_id": "macro.dbt.default__type_boolean" }, - "macro.dbt.get_binding_char": { + "macro.dbt.default__type_float": { "arguments": [], - "created_at": 1696458269.749717, + "created_at": 1719485736.5472598, "depends_on": { - "macros": [ - "macro.dbt.default__get_binding_char" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", + "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "meta": {}, - "name": "get_binding_char", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__type_float", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_binding_char" + "unique_id": "macro.dbt.default__type_float" }, - "macro.dbt.get_catalog": { + "macro.dbt.default__type_int": { "arguments": [], - "created_at": 1696458269.836847, + "created_at": 1719485736.549174, "depends_on": { - "macros": [ - "macro.dbt_postgres.postgres__get_catalog" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", + "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "meta": {}, - "name": "get_catalog", - "original_file_path": "macros/adapters/metadata.sql", + "name": "default__type_int", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_catalog" + "unique_id": "macro.dbt.default__type_int" }, - "macro.dbt.get_columns_in_query": { + "macro.dbt.default__type_numeric": { "arguments": [], - "created_at": 1696458269.844657, + "created_at": 1719485736.547792, "depends_on": { - "macros": [ - "macro.dbt.default__get_columns_in_query" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", + "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "meta": {}, - "name": "get_columns_in_query", - "original_file_path": "macros/adapters/columns.sql", + "name": "default__type_numeric", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/columns.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_columns_in_query" + "unique_id": "macro.dbt.default__type_numeric" }, - "macro.dbt.get_columns_in_relation": { + "macro.dbt.default__type_string": { "arguments": [], - "created_at": 1696458269.843055, + "created_at": 1719485736.5461628, "depends_on": { - "macros": [ - "macro.dbt_postgres.postgres__get_columns_in_relation" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "meta": {}, - "name": "get_columns_in_relation", - "original_file_path": "macros/adapters/columns.sql", + "name": "default__type_string", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/columns.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_columns_in_relation" + "unique_id": "macro.dbt.default__type_string" }, - "macro.dbt.get_create_index_sql": { + "macro.dbt.default__type_timestamp": { "arguments": [], - "created_at": 1696458269.8050802, + "created_at": 1719485736.5468001, "depends_on": { - "macros": [ - "macro.dbt_postgres.postgres__get_create_index_sql" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", + "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "meta": {}, - "name": "get_create_index_sql", - "original_file_path": "macros/adapters/indexes.sql", + "name": "default__type_timestamp", + "original_file_path": "macros/utils/data_types.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/indexes.sql", + "path": "macros/utils/data_types.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_create_index_sql" + "unique_id": "macro.dbt.default__type_timestamp" }, - "macro.dbt.get_create_table_as_sql": { + "macro.dbt.default__validate_sql": { "arguments": [], - "created_at": 1696458269.719821, + "created_at": 1719485736.570561, "depends_on": { "macros": [ - "macro.dbt.default__get_create_table_as_sql" + "macro.dbt.statement" ] }, "description": "", @@ -4169,25 +4627,24 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_create_table_as_sql", - "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "name": "default__validate_sql", + "original_file_path": "macros/adapters/validate_sql.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/table/create_table_as.sql", + "path": "macros/adapters/validate_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_create_table_as_sql" + "unique_id": "macro.dbt.default__validate_sql" }, - "macro.dbt.get_create_view_as_sql": { + "macro.dbt.default_last_day": { "arguments": [], - "created_at": 1696458269.730824, + "created_at": 1719485736.5533261, "depends_on": { "macros": [ - "macro.dbt.default__get_create_view_as_sql" + "macro.dbt.dateadd", + "macro.dbt.date_trunc" ] }, "description": "", @@ -4195,77 +4652,67 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", + "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", "meta": {}, - "name": "get_create_view_as_sql", - "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "name": "default_last_day", + "original_file_path": "macros/utils/last_day.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/create_view_as.sql", + "path": "macros/utils/last_day.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_create_view_as_sql" + "unique_id": "macro.dbt.default_last_day" }, - "macro.dbt.get_csv_sql": { + "macro.dbt.diff_column_data_types": { "arguments": [], - "created_at": 1696458269.749263, + "created_at": 1719485736.397441, "depends_on": { - "macros": [ - "macro.dbt.default__get_csv_sql" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_csv_sql", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "diff_column_data_types", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/materializations/models/incremental/column_helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_csv_sql" + "unique_id": "macro.dbt.diff_column_data_types" }, - "macro.dbt.get_dcl_statement_list": { + "macro.dbt.diff_columns": { "arguments": [], - "created_at": 1696458269.826365, + "created_at": 1719485736.396736, "depends_on": { - "macros": [ - "macro.dbt.default__get_dcl_statement_list" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_dcl_statement_list", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "diff_columns", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/materializations/models/incremental/column_helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_dcl_statement_list" + "unique_id": "macro.dbt.diff_columns" }, - "macro.dbt.get_delete_insert_merge_sql": { + "macro.dbt.drop_materialized_view": { "arguments": [], - "created_at": 1696458269.6812491, + "created_at": 1719485736.486141, "depends_on": { "macros": [ - "macro.dbt.default__get_delete_insert_merge_sql" + "macro.dbt_postgres.postgres__drop_materialized_view" ] }, "description": "", @@ -4273,25 +4720,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", + "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "meta": {}, - "name": "get_delete_insert_merge_sql", - "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "drop_materialized_view", + "original_file_path": "macros/relations/materialized_view/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/merge.sql", + "path": "macros/relations/materialized_view/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_delete_insert_merge_sql" + "unique_id": "macro.dbt.drop_materialized_view" }, - "macro.dbt.get_grant_sql": { + "macro.dbt.drop_relation": { "arguments": [], - "created_at": 1696458269.8250072, + "created_at": 1719485736.471232, "depends_on": { "macros": [ - "macro.dbt.default__get_grant_sql" + "macro.dbt.default__drop_relation" ] }, "description": "", @@ -4299,51 +4744,45 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", + "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "meta": {}, - "name": "get_grant_sql", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "drop_relation", + "original_file_path": "macros/relations/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/relations/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_grant_sql" + "unique_id": "macro.dbt.drop_relation" }, - "macro.dbt.get_incremental_append_sql": { + "macro.dbt.drop_relation_if_exists": { "arguments": [], - "created_at": 1696458269.686978, + "created_at": 1719485736.471669, "depends_on": { - "macros": [ - "macro.dbt.default__get_incremental_append_sql" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", + "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "meta": {}, - "name": "get_incremental_append_sql", - "original_file_path": "macros/materializations/models/incremental/strategies.sql", + "name": "drop_relation_if_exists", + "original_file_path": "macros/relations/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/strategies.sql", + "path": "macros/relations/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_incremental_append_sql" + "unique_id": "macro.dbt.drop_relation_if_exists" }, - "macro.dbt.get_incremental_default_sql": { + "macro.dbt.drop_schema": { "arguments": [], - "created_at": 1696458269.690001, + "created_at": 1719485736.558478, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__get_incremental_default_sql" + "macro.dbt_postgres.postgres__drop_schema" ] }, "description": "", @@ -4351,25 +4790,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", + "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "meta": {}, - "name": "get_incremental_default_sql", - "original_file_path": "macros/materializations/models/incremental/strategies.sql", + "name": "drop_schema", + "original_file_path": "macros/adapters/schema.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/strategies.sql", + "path": "macros/adapters/schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_incremental_default_sql" + "unique_id": "macro.dbt.drop_schema" }, - "macro.dbt.get_incremental_delete_insert_sql": { + "macro.dbt.drop_schema_named": { "arguments": [], - "created_at": 1696458269.6876879, + "created_at": 1719485736.4761379, "depends_on": { "macros": [ - "macro.dbt.default__get_incremental_delete_insert_sql" + "macro.dbt.default__drop_schema_named" ] }, "description": "", @@ -4377,25 +4814,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "meta": {}, - "name": "get_incremental_delete_insert_sql", - "original_file_path": "macros/materializations/models/incremental/strategies.sql", + "name": "drop_schema_named", + "original_file_path": "macros/relations/schema.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/strategies.sql", + "path": "macros/relations/schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_incremental_delete_insert_sql" + "unique_id": "macro.dbt.drop_schema_named" }, - "macro.dbt.get_incremental_insert_overwrite_sql": { + "macro.dbt.drop_table": { "arguments": [], - "created_at": 1696458269.6892319, + "created_at": 1719485736.505447, "depends_on": { "macros": [ - "macro.dbt.default__get_incremental_insert_overwrite_sql" + "macro.dbt_postgres.postgres__drop_table" ] }, "description": "", @@ -4403,25 +4838,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "meta": {}, - "name": "get_incremental_insert_overwrite_sql", - "original_file_path": "macros/materializations/models/incremental/strategies.sql", + "name": "drop_table", + "original_file_path": "macros/relations/table/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/strategies.sql", + "path": "macros/relations/table/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql" + "unique_id": "macro.dbt.drop_table" }, - "macro.dbt.get_incremental_merge_sql": { + "macro.dbt.drop_view": { "arguments": [], - "created_at": 1696458269.688441, + "created_at": 1719485736.511067, "depends_on": { "macros": [ - "macro.dbt.default__get_incremental_merge_sql" + "macro.dbt_postgres.postgres__drop_view" ] }, "description": "", @@ -4429,25 +4862,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", + "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "meta": {}, - "name": "get_incremental_merge_sql", - "original_file_path": "macros/materializations/models/incremental/strategies.sql", + "name": "drop_view", + "original_file_path": "macros/relations/view/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/strategies.sql", + "path": "macros/relations/view/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_incremental_merge_sql" + "unique_id": "macro.dbt.drop_view" }, - "macro.dbt.get_insert_into_sql": { + "macro.dbt.escape_single_quotes": { "arguments": [], - "created_at": 1696458269.6907241, + "created_at": 1719485736.537864, "depends_on": { "macros": [ - "macro.dbt.get_quoted_csv" + "macro.dbt.default__escape_single_quotes" ] }, "description": "", @@ -4455,25 +4886,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "meta": {}, - "name": "get_insert_into_sql", - "original_file_path": "macros/materializations/models/incremental/strategies.sql", + "name": "escape_single_quotes", + "original_file_path": "macros/utils/escape_single_quotes.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/strategies.sql", + "path": "macros/utils/escape_single_quotes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_insert_into_sql" + "unique_id": "macro.dbt.escape_single_quotes" }, - "macro.dbt.get_insert_overwrite_merge_sql": { + "macro.dbt.except": { "arguments": [], - "created_at": 1696458269.683062, + "created_at": 1719485736.5260952, "depends_on": { "macros": [ - "macro.dbt.default__get_insert_overwrite_merge_sql" + "macro.dbt.default__except" ] }, "description": "", @@ -4481,25 +4910,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "meta": {}, - "name": "get_insert_overwrite_merge_sql", - "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "except", + "original_file_path": "macros/utils/except.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/merge.sql", + "path": "macros/utils/except.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_insert_overwrite_merge_sql" + "unique_id": "macro.dbt.except" }, - "macro.dbt.get_merge_sql": { + "macro.dbt.format_columns": { "arguments": [], - "created_at": 1696458269.67798, + "created_at": 1719485736.504094, "depends_on": { "macros": [ - "macro.dbt.default__get_merge_sql" + "macro.dbt.default__format_column" ] }, "description": "", @@ -4507,25 +4934,25 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", + "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 %}", "meta": {}, - "name": "get_merge_sql", - "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "format_columns", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/merge.sql", + "path": "macros/relations/column/columns_spec_ddl.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_merge_sql" + "unique_id": "macro.dbt.format_columns" }, - "macro.dbt.get_merge_update_columns": { + "macro.dbt.format_row": { "arguments": [], - "created_at": 1696458269.6691232, + "created_at": 1719485736.611443, "depends_on": { "macros": [ - "macro.dbt.default__get_merge_update_columns" + "macro.dbt.string_literal", + "macro.dbt.escape_single_quotes", + "macro.dbt.safe_cast" ] }, "description": "", @@ -4533,25 +4960,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 -%}", "meta": {}, - "name": "get_merge_update_columns", - "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "format_row", + "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/column_helpers.sql", + "path": "macros/unit_test_sql/get_fixture_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_merge_update_columns" + "unique_id": "macro.dbt.format_row" }, - "macro.dbt.get_or_create_relation": { + "macro.dbt.generate_alias_name": { "arguments": [], - "created_at": 1696458269.816565, + "created_at": 1719485736.466082, "depends_on": { "macros": [ - "macro.dbt.default__get_or_create_relation" + "macro.dbt.default__generate_alias_name" ] }, "description": "", @@ -4559,49 +4984,47 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_or_create_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "generate_alias_name", + "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/get_custom_name/get_custom_alias.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_or_create_relation" + "unique_id": "macro.dbt.generate_alias_name" }, - "macro.dbt.get_quoted_csv": { + "macro.dbt.generate_database_name": { "arguments": [], - "created_at": 1696458269.666624, + "created_at": 1719485736.468485, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__generate_database_name" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_quoted_csv", - "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "generate_database_name", + "original_file_path": "macros/get_custom_name/get_custom_database.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/column_helpers.sql", + "path": "macros/get_custom_name/get_custom_database.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_quoted_csv" + "unique_id": "macro.dbt.generate_database_name" }, - "macro.dbt.get_revoke_sql": { + "macro.dbt.generate_schema_name": { "arguments": [], - "created_at": 1696458269.825689, + "created_at": 1719485736.467374, "depends_on": { "macros": [ - "macro.dbt.default__get_revoke_sql" + "macro.dbt.default__generate_schema_name" ] }, "description": "", @@ -4609,22 +5032,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "get_revoke_sql", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "generate_schema_name", + "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/get_custom_name/get_custom_schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_revoke_sql" + "unique_id": "macro.dbt.generate_schema_name" }, - "macro.dbt.get_seed_column_quoted_csv": { + "macro.dbt.generate_schema_name_for_env": { "arguments": [], - "created_at": 1696458269.75114, + "created_at": 1719485736.46803, "depends_on": { "macros": [] }, @@ -4633,25 +5054,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_seed_column_quoted_csv", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "generate_schema_name_for_env", + "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/get_custom_name/get_custom_schema.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_seed_column_quoted_csv" + "unique_id": "macro.dbt.generate_schema_name_for_env" }, - "macro.dbt.get_show_grant_sql": { + "macro.dbt.generate_series": { "arguments": [], - "created_at": 1696458269.8244731, + "created_at": 1719485736.5352, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__get_show_grant_sql" + "macro.dbt.default__generate_series" ] }, "description": "", @@ -4659,25 +5078,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", + "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "meta": {}, - "name": "get_show_grant_sql", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "generate_series", + "original_file_path": "macros/utils/generate_series.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/utils/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_show_grant_sql" + "unique_id": "macro.dbt.generate_series" }, - "macro.dbt.get_test_sql": { + "macro.dbt.get_alter_materialized_view_as_sql": { "arguments": [], - "created_at": 1696458269.662025, + "created_at": 1719485736.492841, "depends_on": { "macros": [ - "macro.dbt.default__get_test_sql" + "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql" ] }, "description": "", @@ -4685,25 +5102,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "get_test_sql", - "original_file_path": "macros/materializations/tests/helpers.sql", + "name": "get_alter_materialized_view_as_sql", + "original_file_path": "macros/relations/materialized_view/alter.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/tests/helpers.sql", + "path": "macros/relations/materialized_view/alter.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_test_sql" + "unique_id": "macro.dbt.get_alter_materialized_view_as_sql" }, - "macro.dbt.get_true_sql": { + "macro.dbt.get_assert_columns_equivalent": { "arguments": [], - "created_at": 1696458269.617147, + "created_at": 1719485736.5009642, "depends_on": { "macros": [ - "macro.dbt.default__get_true_sql" + "macro.dbt.default__get_assert_columns_equivalent" ] }, "description": "", @@ -4711,25 +5126,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", + "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "meta": {}, - "name": "get_true_sql", - "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "get_assert_columns_equivalent", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/helpers.sql", + "path": "macros/relations/column/columns_spec_ddl.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_true_sql" + "unique_id": "macro.dbt.get_assert_columns_equivalent" }, - "macro.dbt.get_where_subquery": { + "macro.dbt.get_batch_size": { "arguments": [], - "created_at": 1696458269.663287, + "created_at": 1719485736.461688, "depends_on": { "macros": [ - "macro.dbt.default__get_where_subquery" + "macro.dbt.default__get_batch_size" ] }, "description": "", @@ -4737,25 +5150,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", + "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "meta": {}, - "name": "get_where_subquery", - "original_file_path": "macros/materializations/tests/where_subquery.sql", + "name": "get_batch_size", + "original_file_path": "macros/materializations/seeds/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/tests/where_subquery.sql", + "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.get_where_subquery" + "unique_id": "macro.dbt.get_batch_size" }, - "macro.dbt.handle_existing_table": { + "macro.dbt.get_binding_char": { "arguments": [], - "created_at": 1696458269.7268028, + "created_at": 1719485736.461306, "depends_on": { "macros": [ - "macro.dbt.default__handle_existing_table" + "macro.dbt.default__get_binding_char" ] }, "description": "", @@ -4763,25 +5174,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", + "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "meta": {}, - "name": "handle_existing_table", - "original_file_path": "macros/materializations/models/view/helpers.sql", + "name": "get_binding_char", + "original_file_path": "macros/materializations/seeds/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/helpers.sql", + "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.handle_existing_table" + "unique_id": "macro.dbt.get_binding_char" }, - "macro.dbt.hash": { + "macro.dbt.get_catalog": { "arguments": [], - "created_at": 1696458269.7828329, + "created_at": 1719485736.590185, "depends_on": { "macros": [ - "macro.dbt.default__hash" + "macro.dbt_postgres.postgres__get_catalog" ] }, "description": "", @@ -4789,25 +5198,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", + "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "meta": {}, - "name": "hash", - "original_file_path": "macros/utils/hash.sql", + "name": "get_catalog", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/hash.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.hash" + "unique_id": "macro.dbt.get_catalog" }, - "macro.dbt.in_transaction": { + "macro.dbt.get_catalog_relations": { "arguments": [], - "created_at": 1696458269.591626, + "created_at": 1719485736.5896802, "depends_on": { "macros": [ - "macro.dbt.make_hook_config" + "macro.dbt_postgres.postgres__get_catalog_relations" ] }, "description": "", @@ -4815,49 +5222,47 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", + "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "meta": {}, - "name": "in_transaction", - "original_file_path": "macros/materializations/hooks.sql", + "name": "get_catalog_relations", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/hooks.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.in_transaction" + "unique_id": "macro.dbt.get_catalog_relations" }, - "macro.dbt.incremental_validate_on_schema_change": { + "macro.dbt.get_column_schema_from_query": { "arguments": [], - "created_at": 1696458269.708918, + "created_at": 1719485736.598866, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_empty_subquery_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "incremental_validate_on_schema_change", - "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "get_column_schema_from_query", + "original_file_path": "macros/adapters/columns.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/on_schema_change.sql", + "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.incremental_validate_on_schema_change" + "unique_id": "macro.dbt.get_column_schema_from_query" }, - "macro.dbt.information_schema_name": { + "macro.dbt.get_columns_in_query": { "arguments": [], - "created_at": 1696458269.837573, + "created_at": 1719485736.5990841, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__information_schema_name" + "macro.dbt.default__get_columns_in_query" ] }, "description": "", @@ -4865,25 +5270,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", + "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "meta": {}, - "name": "information_schema_name", - "original_file_path": "macros/adapters/metadata.sql", + "name": "get_columns_in_query", + "original_file_path": "macros/adapters/columns.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.information_schema_name" + "unique_id": "macro.dbt.get_columns_in_query" }, - "macro.dbt.intersect": { + "macro.dbt.get_columns_in_relation": { "arguments": [], - "created_at": 1696458269.776766, + "created_at": 1719485736.596093, "depends_on": { "macros": [ - "macro.dbt.default__intersect" + "macro.dbt_postgres.postgres__get_columns_in_relation" ] }, "description": "", @@ -4891,25 +5294,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", + "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "meta": {}, - "name": "intersect", - "original_file_path": "macros/utils/intersect.sql", + "name": "get_columns_in_relation", + "original_file_path": "macros/adapters/columns.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/intersect.sql", + "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.intersect" + "unique_id": "macro.dbt.get_columns_in_relation" }, - "macro.dbt.is_incremental": { + "macro.dbt.get_create_backup_sql": { "arguments": [], - "created_at": 1696458269.6853771, + "created_at": 1719485736.478982, "depends_on": { "macros": [ - "macro.dbt.should_full_refresh" + "macro.dbt.default__get_create_backup_sql" ] }, "description": "", @@ -4917,25 +5318,23 @@ "node_color": null, "show": true }, - "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 %}", + "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", "meta": {}, - "name": "is_incremental", - "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", + "name": "get_create_backup_sql", + "original_file_path": "macros/relations/create_backup.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/is_incremental.sql", + "path": "macros/relations/create_backup.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.is_incremental" + "unique_id": "macro.dbt.get_create_backup_sql" }, - "macro.dbt.last_day": { + "macro.dbt.get_create_index_sql": { "arguments": [], - "created_at": 1696458269.794115, + "created_at": 1719485736.561203, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__last_day" + "macro.dbt_postgres.postgres__get_create_index_sql" ] }, "description": "", @@ -4943,25 +5342,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", + "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "meta": {}, - "name": "last_day", - "original_file_path": "macros/utils/last_day.sql", + "name": "get_create_index_sql", + "original_file_path": "macros/adapters/indexes.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/last_day.sql", + "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.last_day" + "unique_id": "macro.dbt.get_create_index_sql" }, - "macro.dbt.length": { + "macro.dbt.get_create_intermediate_sql": { "arguments": [], - "created_at": 1696458269.775149, + "created_at": 1719485736.4755762, "depends_on": { "macros": [ - "macro.dbt.default__length" + "macro.dbt.default__get_create_intermediate_sql" ] }, "description": "", @@ -4969,25 +5366,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", + "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", "meta": {}, - "name": "length", - "original_file_path": "macros/utils/length.sql", + "name": "get_create_intermediate_sql", + "original_file_path": "macros/relations/create_intermediate.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/length.sql", + "path": "macros/relations/create_intermediate.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.length" + "unique_id": "macro.dbt.get_create_intermediate_sql" }, - "macro.dbt.list_relations_without_caching": { + "macro.dbt.get_create_materialized_view_as_sql": { "arguments": [], - "created_at": 1696458269.839705, + "created_at": 1719485736.4946408, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__list_relations_without_caching" + "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql" ] }, "description": "", @@ -4995,25 +5390,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "list_relations_without_caching", - "original_file_path": "macros/adapters/metadata.sql", + "name": "get_create_materialized_view_as_sql", + "original_file_path": "macros/relations/materialized_view/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/relations/materialized_view/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.list_relations_without_caching" + "unique_id": "macro.dbt.get_create_materialized_view_as_sql" }, - "macro.dbt.list_schemas": { + "macro.dbt.get_create_sql": { "arguments": [], - "created_at": 1696458269.838121, + "created_at": 1719485736.481704, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__list_schemas" + "macro.dbt.default__get_create_sql" ] }, "description": "", @@ -5021,25 +5414,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", + "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", "meta": {}, - "name": "list_schemas", - "original_file_path": "macros/adapters/metadata.sql", + "name": "get_create_sql", + "original_file_path": "macros/relations/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/metadata.sql", + "path": "macros/relations/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.list_schemas" + "unique_id": "macro.dbt.get_create_sql" }, - "macro.dbt.listagg": { + "macro.dbt.get_create_table_as_sql": { "arguments": [], - "created_at": 1696458269.779763, + "created_at": 1719485736.50801, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__listagg" + "macro.dbt.default__get_create_table_as_sql" ] }, "description": "", @@ -5047,49 +5438,47 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "listagg", - "original_file_path": "macros/utils/listagg.sql", + "name": "get_create_table_as_sql", + "original_file_path": "macros/relations/table/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/listagg.sql", + "path": "macros/relations/table/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.listagg" + "unique_id": "macro.dbt.get_create_table_as_sql" }, - "macro.dbt.load_cached_relation": { + "macro.dbt.get_create_view_as_sql": { "arguments": [], - "created_at": 1696458269.817961, + "created_at": 1719485736.515145, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_create_view_as_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "meta": {}, - "name": "load_cached_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "get_create_view_as_sql", + "original_file_path": "macros/relations/view/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/relations/view/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.load_cached_relation" + "unique_id": "macro.dbt.get_create_view_as_sql" }, - "macro.dbt.load_csv_rows": { + "macro.dbt.get_csv_sql": { "arguments": [], - "created_at": 1696458269.751443, + "created_at": 1719485736.460989, "depends_on": { "macros": [ - "macro.dbt.default__load_csv_rows" + "macro.dbt.default__get_csv_sql" ] }, "description": "", @@ -5097,25 +5486,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", + "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 %}", "meta": {}, - "name": "load_csv_rows", + "name": "get_csv_sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "package_name": "dbt", "patch_path": null, "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.load_csv_rows" + "unique_id": "macro.dbt.get_csv_sql" }, - "macro.dbt.load_relation": { + "macro.dbt.get_dcl_statement_list": { "arguments": [], - "created_at": 1696458269.8181918, + "created_at": 1719485736.574908, "depends_on": { "macros": [ - "macro.dbt.load_cached_relation" + "macro.dbt.default__get_dcl_statement_list" ] }, "description": "", @@ -5123,25 +5510,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "load_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "get_dcl_statement_list", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.load_relation" + "unique_id": "macro.dbt.get_dcl_statement_list" }, - "macro.dbt.make_backup_relation": { + "macro.dbt.get_delete_insert_merge_sql": { "arguments": [], - "created_at": 1696458269.813613, + "created_at": 1719485736.414207, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__make_backup_relation" + "macro.dbt.default__get_delete_insert_merge_sql" ] }, "description": "", @@ -5149,49 +5534,47 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "make_backup_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "get_delete_insert_merge_sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/materializations/models/incremental/merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.make_backup_relation" + "unique_id": "macro.dbt.get_delete_insert_merge_sql" }, - "macro.dbt.make_hook_config": { + "macro.dbt.get_drop_backup_sql": { "arguments": [], - "created_at": 1696458269.591149, + "created_at": 1719485736.476695, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_drop_backup_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", + "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", "meta": {}, - "name": "make_hook_config", - "original_file_path": "macros/materializations/hooks.sql", + "name": "get_drop_backup_sql", + "original_file_path": "macros/relations/drop_backup.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/hooks.sql", + "path": "macros/relations/drop_backup.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.make_hook_config" + "unique_id": "macro.dbt.get_drop_backup_sql" }, - "macro.dbt.make_intermediate_relation": { + "macro.dbt.get_drop_index_sql": { "arguments": [], - "created_at": 1696458269.8121102, + "created_at": 1719485736.562388, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__make_intermediate_relation" + "macro.dbt_postgres.postgres__get_drop_index_sql" ] }, "description": "", @@ -5199,25 +5582,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", + "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "meta": {}, - "name": "make_intermediate_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "get_drop_index_sql", + "original_file_path": "macros/adapters/indexes.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.make_intermediate_relation" + "unique_id": "macro.dbt.get_drop_index_sql" }, - "macro.dbt.make_temp_relation": { + "macro.dbt.get_drop_sql": { "arguments": [], - "created_at": 1696458269.812738, + "created_at": 1719485736.470603, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__make_temp_relation" + "macro.dbt.default__get_drop_sql" ] }, "description": "", @@ -5225,40 +5606,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", + "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", "meta": {}, - "name": "make_temp_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "get_drop_sql", + "original_file_path": "macros/relations/drop.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/relations/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.make_temp_relation" + "unique_id": "macro.dbt.get_drop_sql" }, - "macro.dbt.materialization_incremental_default": { + "macro.dbt.get_empty_schema_sql": { "arguments": [], - "created_at": 1696458269.699362, + "created_at": 1719485736.597257, "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" + "macro.dbt.default__get_empty_schema_sql" ] }, "description": "", @@ -5266,37 +5630,23 @@ "node_color": null, "show": true }, - "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 comparison 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('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, '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 %}", + "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "meta": {}, - "name": "materialization_incremental_default", - "original_file_path": "macros/materializations/models/incremental/incremental.sql", + "name": "get_empty_schema_sql", + "original_file_path": "macros/adapters/columns.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/incremental.sql", + "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "supported_languages": [ - "sql" - ], - "tags": [], - "unique_id": "macro.dbt.materialization_incremental_default" + "supported_languages": null, + "unique_id": "macro.dbt.get_empty_schema_sql" }, - "macro.dbt.materialization_seed_default": { + "macro.dbt.get_empty_subquery_sql": { "arguments": [], - "created_at": 1696458269.737411, + "created_at": 1719485736.596842, "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" + "macro.dbt.default__get_empty_subquery_sql" ] }, "description": "", @@ -5304,40 +5654,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "materialization_seed_default", - "original_file_path": "macros/materializations/seeds/seed.sql", + "name": "get_empty_subquery_sql", + "original_file_path": "macros/adapters/columns.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/seed.sql", + "path": "macros/adapters/columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "supported_languages": [ - "sql" - ], - "tags": [], - "unique_id": "macro.dbt.materialization_seed_default" + "supported_languages": null, + "unique_id": "macro.dbt.get_empty_subquery_sql" }, - "macro.dbt.materialization_snapshot_default": { + "macro.dbt.get_expected_sql": { "arguments": [], - "created_at": 1696458269.65698, + "created_at": 1719485736.608841, "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" + "macro.dbt.format_row" ] }, "description": "", @@ -5345,37 +5678,25 @@ "node_color": null, "show": true }, - "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 comparison 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 %}", + "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 %}", "meta": {}, - "name": "materialization_snapshot_default", - "original_file_path": "macros/materializations/snapshots/snapshot.sql", + "name": "get_expected_sql", + "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/snapshot.sql", + "path": "macros/unit_test_sql/get_fixture_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "supported_languages": [ - "sql" - ], - "tags": [], - "unique_id": "macro.dbt.materialization_snapshot_default" + "supported_languages": null, + "unique_id": "macro.dbt.get_expected_sql" }, - "macro.dbt.materialization_table_default": { + "macro.dbt.get_fixture_sql": { "arguments": [], - "created_at": 1696458269.718855, + "created_at": 1719485736.607797, "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" + "macro.dbt.load_relation", + "macro.dbt.safe_cast", + "macro.dbt.format_row" ] }, "description": "", @@ -5383,30 +5704,23 @@ "node_color": null, "show": true }, - "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 comparison 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 {{ 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 %}", + "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 %}", "meta": {}, - "name": "materialization_table_default", - "original_file_path": "macros/materializations/models/table/table.sql", + "name": "get_fixture_sql", + "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/table/table.sql", + "path": "macros/unit_test_sql/get_fixture_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "supported_languages": [ - "sql" - ], - "tags": [], - "unique_id": "macro.dbt.materialization_table_default" + "supported_languages": null, + "unique_id": "macro.dbt.get_fixture_sql" }, - "macro.dbt.materialization_test_default": { + "macro.dbt.get_grant_sql": { "arguments": [], - "created_at": 1696458269.660993, + "created_at": 1719485736.574021, "depends_on": { "macros": [ - "macro.dbt.should_store_failures", - "macro.dbt.statement", - "macro.dbt.create_table_as", - "macro.dbt.get_test_sql" + "macro.dbt.default__get_grant_sql" ] }, "description": "", @@ -5414,36 +5728,23 @@ "node_color": null, "show": true }, - "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 {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, 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 -%}", + "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "meta": {}, - "name": "materialization_test_default", - "original_file_path": "macros/materializations/tests/test.sql", + "name": "get_grant_sql", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/tests/test.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "supported_languages": [ - "sql" - ], - "tags": [], - "unique_id": "macro.dbt.materialization_test_default" + "supported_languages": null, + "unique_id": "macro.dbt.get_grant_sql" }, - "macro.dbt.materialization_view_default": { + "macro.dbt.get_incremental_append_sql": { "arguments": [], - "created_at": 1696458269.726018, + "created_at": 1719485736.418218, "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" + "macro.dbt.default__get_incremental_append_sql" ] }, "description": "", @@ -5451,51 +5752,47 @@ "node_color": null, "show": true }, - "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 comparison 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 {{ adapter.rename_relation(existing_relation, backup_relation) }}\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 -%}", + "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "meta": {}, - "name": "materialization_view_default", - "original_file_path": "macros/materializations/models/view/view.sql", + "name": "get_incremental_append_sql", + "original_file_path": "macros/materializations/models/incremental/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/view/view.sql", + "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", - "supported_languages": [ - "sql" - ], - "tags": [], - "unique_id": "macro.dbt.materialization_view_default" + "supported_languages": null, + "unique_id": "macro.dbt.get_incremental_append_sql" }, - "macro.dbt.noop_statement": { + "macro.dbt.get_incremental_default_sql": { "arguments": [], - "created_at": 1696458269.7650838, + "created_at": 1719485736.421412, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt_postgres.postgres__get_incremental_default_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "meta": {}, - "name": "noop_statement", - "original_file_path": "macros/etc/statement.sql", + "name": "get_incremental_default_sql", + "original_file_path": "macros/materializations/models/incremental/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/etc/statement.sql", + "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.noop_statement" + "unique_id": "macro.dbt.get_incremental_default_sql" }, - "macro.dbt.partition_range": { + "macro.dbt.get_incremental_delete_insert_sql": { "arguments": [], - "created_at": 1696458269.7719522, + "created_at": 1719485736.4188569, "depends_on": { "macros": [ - "macro.dbt.dates_in_range" + "macro.dbt.default__get_incremental_delete_insert_sql" ] }, "description": "", @@ -5503,25 +5800,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "partition_range", - "original_file_path": "macros/etc/datetime.sql", + "name": "get_incremental_delete_insert_sql", + "original_file_path": "macros/materializations/models/incremental/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/etc/datetime.sql", + "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.partition_range" + "unique_id": "macro.dbt.get_incremental_delete_insert_sql" }, - "macro.dbt.persist_docs": { + "macro.dbt.get_incremental_insert_overwrite_sql": { "arguments": [], - "created_at": 1696458269.833451, + "created_at": 1719485736.420912, "depends_on": { "macros": [ - "macro.dbt.default__persist_docs" + "macro.dbt.default__get_incremental_insert_overwrite_sql" ] }, "description": "", @@ -5529,25 +5824,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "persist_docs", - "original_file_path": "macros/adapters/persist_docs.sql", + "name": "get_incremental_insert_overwrite_sql", + "original_file_path": "macros/materializations/models/incremental/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/persist_docs.sql", + "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.persist_docs" + "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql" }, - "macro.dbt.position": { + "macro.dbt.get_incremental_merge_sql": { "arguments": [], - "created_at": 1696458269.7855082, + "created_at": 1719485736.419648, "depends_on": { "macros": [ - "macro.dbt.default__position" + "macro.dbt.default__get_incremental_merge_sql" ] }, "description": "", @@ -5555,25 +5848,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", + "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "meta": {}, - "name": "position", - "original_file_path": "macros/utils/position.sql", + "name": "get_incremental_merge_sql", + "original_file_path": "macros/materializations/models/incremental/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/position.sql", + "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.position" + "unique_id": "macro.dbt.get_incremental_merge_sql" }, - "macro.dbt.post_snapshot": { + "macro.dbt.get_insert_into_sql": { "arguments": [], - "created_at": 1696458269.6167622, + "created_at": 1719485736.4218738, "depends_on": { "macros": [ - "macro.dbt.default__post_snapshot" + "macro.dbt.get_quoted_csv" ] }, "description": "", @@ -5581,26 +5872,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "post_snapshot", - "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "get_insert_into_sql", + "original_file_path": "macros/materializations/models/incremental/strategies.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/helpers.sql", + "path": "macros/materializations/models/incremental/strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.post_snapshot" + "unique_id": "macro.dbt.get_insert_into_sql" }, - "macro.dbt.process_schema_changes": { + "macro.dbt.get_insert_overwrite_merge_sql": { "arguments": [], - "created_at": 1696458269.714473, + "created_at": 1719485736.415607, "depends_on": { "macros": [ - "macro.dbt.check_for_schema_changes", - "macro.dbt.sync_column_schemas" + "macro.dbt.default__get_insert_overwrite_merge_sql" ] }, "description": "", @@ -5608,77 +5896,71 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "process_schema_changes", - "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "get_insert_overwrite_merge_sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/on_schema_change.sql", + "path": "macros/materializations/models/incremental/merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.process_schema_changes" + "unique_id": "macro.dbt.get_insert_overwrite_merge_sql" }, - "macro.dbt.py_current_timestring": { + "macro.dbt.get_intervals_between": { "arguments": [], - "created_at": 1696458269.7723362, + "created_at": 1719485736.527589, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_intervals_between" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "py_current_timestring", - "original_file_path": "macros/etc/datetime.sql", + "name": "get_intervals_between", + "original_file_path": "macros/utils/date_spine.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/etc/datetime.sql", + "path": "macros/utils/date_spine.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.py_current_timestring" + "unique_id": "macro.dbt.get_intervals_between" }, - "macro.dbt.py_script_comment": { + "macro.dbt.get_limit_subquery_sql": { "arguments": [], - "created_at": 1696458269.853185, + "created_at": 1719485736.58177, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_limit_subquery_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", + "macro_sql": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", "meta": {}, - "name": "py_script_comment", - "original_file_path": "macros/python_model/python.sql", + "name": "get_limit_subquery_sql", + "original_file_path": "macros/adapters/show.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/python_model/python.sql", + "path": "macros/adapters/show.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.py_script_comment" + "unique_id": "macro.dbt.get_limit_subquery_sql" }, - "macro.dbt.py_script_postfix": { + "macro.dbt.get_materialized_view_configuration_changes": { "arguments": [], - "created_at": 1696458269.85307, + "created_at": 1719485736.494153, "depends_on": { "macros": [ - "macro.dbt.build_ref_function", - "macro.dbt.build_source_function", - "macro.dbt.build_config_dict", - "macro.dbt.is_incremental", - "macro.dbt.py_script_comment" + "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes" ] }, "description": "", @@ -5686,25 +5968,23 @@ "node_color": null, "show": true }, - "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 def __repr__(self):\n return '{{ this }}'\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: ref(*args, 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 %}", + "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 %}", "meta": {}, - "name": "py_script_postfix", - "original_file_path": "macros/python_model/python.sql", + "name": "get_materialized_view_configuration_changes", + "original_file_path": "macros/relations/materialized_view/alter.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/python_model/python.sql", + "path": "macros/relations/materialized_view/alter.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.py_script_postfix" + "unique_id": "macro.dbt.get_materialized_view_configuration_changes" }, - "macro.dbt.rename_relation": { + "macro.dbt.get_merge_sql": { "arguments": [], - "created_at": 1696458269.815678, + "created_at": 1719485736.410901, "depends_on": { "macros": [ - "macro.dbt.default__rename_relation" + "macro.dbt.default__get_merge_sql" ] }, "description": "", @@ -5712,25 +5992,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "rename_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "get_merge_sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/materializations/models/incremental/merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.rename_relation" + "unique_id": "macro.dbt.get_merge_sql" }, - "macro.dbt.replace": { + "macro.dbt.get_merge_update_columns": { "arguments": [], - "created_at": 1696458269.7736168, + "created_at": 1719485736.397727, "depends_on": { "macros": [ - "macro.dbt.default__replace" + "macro.dbt.default__get_merge_update_columns" ] }, "description": "", @@ -5738,25 +6016,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", + "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 %}", "meta": {}, - "name": "replace", - "original_file_path": "macros/utils/replace.sql", + "name": "get_merge_update_columns", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/replace.sql", + "path": "macros/materializations/models/incremental/column_helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.replace" + "unique_id": "macro.dbt.get_merge_update_columns" }, - "macro.dbt.reset_csv_table": { + "macro.dbt.get_or_create_relation": { "arguments": [], - "created_at": 1696458269.748157, + "created_at": 1719485736.567741, "depends_on": { "macros": [ - "macro.dbt.default__reset_csv_table" + "macro.dbt.default__get_or_create_relation" ] }, "description": "", @@ -5764,25 +6040,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "reset_csv_table", - "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "get_or_create_relation", + "original_file_path": "macros/adapters/relation.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/seeds/helpers.sql", + "path": "macros/adapters/relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.reset_csv_table" + "unique_id": "macro.dbt.get_or_create_relation" }, - "macro.dbt.right": { + "macro.dbt.get_powers_of_two": { "arguments": [], - "created_at": 1696458269.778283, + "created_at": 1719485736.534465, "depends_on": { "macros": [ - "macro.dbt.default__right" + "macro.dbt.default__get_powers_of_two" ] }, "description": "", @@ -5790,51 +6064,45 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", + "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "meta": {}, - "name": "right", - "original_file_path": "macros/utils/right.sql", + "name": "get_powers_of_two", + "original_file_path": "macros/utils/generate_series.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/right.sql", + "path": "macros/utils/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.right" + "unique_id": "macro.dbt.get_powers_of_two" }, - "macro.dbt.run_hooks": { + "macro.dbt.get_quoted_csv": { "arguments": [], - "created_at": 1696458269.590806, + "created_at": 1719485736.395989, "depends_on": { - "macros": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "run_hooks", - "original_file_path": "macros/materializations/hooks.sql", + "name": "get_quoted_csv", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/hooks.sql", + "path": "macros/materializations/models/incremental/column_helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.run_hooks" + "unique_id": "macro.dbt.get_quoted_csv" }, - "macro.dbt.run_query": { + "macro.dbt.get_relation_last_modified": { "arguments": [], - "created_at": 1696458269.765571, + "created_at": 1719485736.593024, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt.default__get_relation_last_modified" ] }, "description": "", @@ -5842,25 +6110,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "meta": {}, - "name": "run_query", - "original_file_path": "macros/etc/statement.sql", + "name": "get_relation_last_modified", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/etc/statement.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.run_query" + "unique_id": "macro.dbt.get_relation_last_modified" }, - "macro.dbt.safe_cast": { + "macro.dbt.get_relations": { "arguments": [], - "created_at": 1696458269.7820318, + "created_at": 1719485736.592459, "depends_on": { "macros": [ - "macro.dbt.default__safe_cast" + "macro.dbt_postgres.postgres__get_relations" ] }, "description": "", @@ -5868,73 +6134,71 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", + "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "meta": {}, - "name": "safe_cast", - "original_file_path": "macros/utils/safe_cast.sql", + "name": "get_relations", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/safe_cast.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.safe_cast" + "unique_id": "macro.dbt.get_relations" }, - "macro.dbt.set_sql_header": { + "macro.dbt.get_rename_intermediate_sql": { "arguments": [], - "created_at": 1696458269.592764, + "created_at": 1719485736.484606, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_rename_intermediate_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", + "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", "meta": {}, - "name": "set_sql_header", - "original_file_path": "macros/materializations/configs.sql", + "name": "get_rename_intermediate_sql", + "original_file_path": "macros/relations/rename_intermediate.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/configs.sql", + "path": "macros/relations/rename_intermediate.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.set_sql_header" + "unique_id": "macro.dbt.get_rename_intermediate_sql" }, - "macro.dbt.should_full_refresh": { + "macro.dbt.get_rename_materialized_view_sql": { "arguments": [], - "created_at": 1696458269.593334, + "created_at": 1719485736.4909282, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt_postgres.postgres__get_rename_materialized_view_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "should_full_refresh", - "original_file_path": "macros/materializations/configs.sql", + "name": "get_rename_materialized_view_sql", + "original_file_path": "macros/relations/materialized_view/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/configs.sql", + "path": "macros/relations/materialized_view/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.should_full_refresh" + "unique_id": "macro.dbt.get_rename_materialized_view_sql" }, - "macro.dbt.should_revoke": { + "macro.dbt.get_rename_sql": { "arguments": [], - "created_at": 1696458269.824169, + "created_at": 1719485736.47766, "depends_on": { "macros": [ - "macro.dbt.copy_grants" + "macro.dbt.default__get_rename_sql" ] }, "description": "", @@ -5942,49 +6206,47 @@ "node_color": null, "show": true }, - "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 %}", + "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", "meta": {}, - "name": "should_revoke", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "get_rename_sql", + "original_file_path": "macros/relations/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/relations/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.should_revoke" + "unique_id": "macro.dbt.get_rename_sql" }, - "macro.dbt.should_store_failures": { + "macro.dbt.get_rename_table_sql": { "arguments": [], - "created_at": 1696458269.593961, + "created_at": 1719485736.5068932, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt_postgres.postgres__get_rename_table_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "meta": {}, - "name": "should_store_failures", - "original_file_path": "macros/materializations/configs.sql", + "name": "get_rename_table_sql", + "original_file_path": "macros/relations/table/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/configs.sql", + "path": "macros/relations/table/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.should_store_failures" + "unique_id": "macro.dbt.get_rename_table_sql" }, - "macro.dbt.snapshot_check_all_get_existing_columns": { + "macro.dbt.get_rename_view_sql": { "arguments": [], - "created_at": 1696458269.6062112, + "created_at": 1719485736.5145411, "depends_on": { "macros": [ - "macro.dbt.get_columns_in_query" + "macro.dbt_postgres.postgres__get_rename_view_sql" ] }, "description": "", @@ -5992,28 +6254,23 @@ "node_color": null, "show": true }, - "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 select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) 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 %}", + "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "meta": {}, - "name": "snapshot_check_all_get_existing_columns", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "get_rename_view_sql", + "original_file_path": "macros/relations/view/rename.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/relations/view/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns" + "unique_id": "macro.dbt.get_rename_view_sql" }, - "macro.dbt.snapshot_check_strategy": { + "macro.dbt.get_replace_materialized_view_sql": { "arguments": [], - "created_at": 1696458269.6088378, + "created_at": 1719485736.487545, "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" + "macro.dbt.default__get_replace_materialized_view_sql" ] }, "description": "", @@ -6021,25 +6278,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "meta": {}, - "name": "snapshot_check_strategy", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "get_replace_materialized_view_sql", + "original_file_path": "macros/relations/materialized_view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/relations/materialized_view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_check_strategy" + "unique_id": "macro.dbt.get_replace_materialized_view_sql" }, - "macro.dbt.snapshot_get_time": { + "macro.dbt.get_replace_sql": { "arguments": [], - "created_at": 1696458269.80277, + "created_at": 1719485736.4724941, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__snapshot_get_time" + "macro.dbt.default__get_replace_sql" ] }, "description": "", @@ -6047,25 +6302,23 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", + "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 %}", "meta": {}, - "name": "snapshot_get_time", - "original_file_path": "macros/adapters/timestamps.sql", + "name": "get_replace_sql", + "original_file_path": "macros/relations/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/timestamps.sql", + "path": "macros/relations/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_get_time" + "unique_id": "macro.dbt.get_replace_sql" }, - "macro.dbt.snapshot_hash_arguments": { + "macro.dbt.get_replace_table_sql": { "arguments": [], - "created_at": 1696458269.6016371, + "created_at": 1719485736.506175, "depends_on": { "macros": [ - "macro.dbt.default__snapshot_hash_arguments" + "macro.dbt_postgres.postgres__get_replace_table_sql" ] }, "description": "", @@ -6073,25 +6326,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", + "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "meta": {}, - "name": "snapshot_hash_arguments", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "get_replace_table_sql", + "original_file_path": "macros/relations/table/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/relations/table/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_hash_arguments" + "unique_id": "macro.dbt.get_replace_table_sql" }, - "macro.dbt.snapshot_merge_sql": { + "macro.dbt.get_replace_view_sql": { "arguments": [], - "created_at": 1696458269.594904, + "created_at": 1719485736.5121448, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__snapshot_merge_sql" + "macro.dbt_postgres.postgres__get_replace_view_sql" ] }, "description": "", @@ -6099,25 +6350,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", + "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "meta": {}, - "name": "snapshot_merge_sql", - "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", + "name": "get_replace_view_sql", + "original_file_path": "macros/relations/view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/snapshot_merge.sql", + "path": "macros/relations/view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_merge_sql" + "unique_id": "macro.dbt.get_replace_view_sql" }, - "macro.dbt.snapshot_staging_table": { + "macro.dbt.get_revoke_sql": { "arguments": [], - "created_at": 1696458269.617667, + "created_at": 1719485736.574466, "depends_on": { "macros": [ - "macro.dbt.default__snapshot_staging_table" + "macro.dbt.default__get_revoke_sql" ] }, "description": "", @@ -6125,51 +6374,45 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "meta": {}, - "name": "snapshot_staging_table", - "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "get_revoke_sql", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/helpers.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_staging_table" + "unique_id": "macro.dbt.get_revoke_sql" }, - "macro.dbt.snapshot_string_as_time": { + "macro.dbt.get_seed_column_quoted_csv": { "arguments": [], - "created_at": 1696458269.603466, + "created_at": 1719485736.462852, "depends_on": { - "macros": [ - "macro.dbt_postgres.postgres__snapshot_string_as_time" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", + "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 %}", "meta": {}, - "name": "snapshot_string_as_time", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "get_seed_column_quoted_csv", + "original_file_path": "macros/materializations/seeds/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/materializations/seeds/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_string_as_time" + "unique_id": "macro.dbt.get_seed_column_quoted_csv" }, - "macro.dbt.snapshot_timestamp_strategy": { + "macro.dbt.get_select_subquery": { "arguments": [], - "created_at": 1696458269.603195, + "created_at": 1719485736.510276, "depends_on": { "macros": [ - "macro.dbt.snapshot_hash_arguments" + "macro.dbt.default__get_select_subquery" ] }, "description": "", @@ -6177,25 +6420,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "meta": {}, - "name": "snapshot_timestamp_strategy", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "get_select_subquery", + "original_file_path": "macros/relations/table/create.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/relations/table/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.snapshot_timestamp_strategy" + "unique_id": "macro.dbt.get_select_subquery" }, - "macro.dbt.split_part": { + "macro.dbt.get_show_grant_sql": { "arguments": [], - "created_at": 1696458269.795978, + "created_at": 1719485736.573664, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__split_part" + "macro.dbt_postgres.postgres__get_show_grant_sql" ] }, "description": "", @@ -6203,97 +6444,95 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "meta": {}, - "name": "split_part", - "original_file_path": "macros/utils/split_part.sql", + "name": "get_show_grant_sql", + "original_file_path": "macros/adapters/apply_grants.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/split_part.sql", + "path": "macros/adapters/apply_grants.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.split_part" + "unique_id": "macro.dbt.get_show_grant_sql" }, - "macro.dbt.sql_convert_columns_in_relation": { + "macro.dbt.get_show_indexes_sql": { "arguments": [], - "created_at": 1696458269.844328, + "created_at": 1719485736.562955, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt_postgres.postgres__get_show_indexes_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "meta": {}, - "name": "sql_convert_columns_in_relation", - "original_file_path": "macros/adapters/columns.sql", + "name": "get_show_indexes_sql", + "original_file_path": "macros/adapters/indexes.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/columns.sql", + "path": "macros/adapters/indexes.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.sql_convert_columns_in_relation" + "unique_id": "macro.dbt.get_show_indexes_sql" }, - "macro.dbt.statement": { + "macro.dbt.get_show_sql": { "arguments": [], - "created_at": 1696458269.764031, + "created_at": 1719485736.581328, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_limit_subquery_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "statement", - "original_file_path": "macros/etc/statement.sql", + "name": "get_show_sql", + "original_file_path": "macros/adapters/show.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/etc/statement.sql", + "path": "macros/adapters/show.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.statement" + "unique_id": "macro.dbt.get_show_sql" }, - "macro.dbt.strategy_dispatch": { + "macro.dbt.get_table_columns_and_constraints": { "arguments": [], - "created_at": 1696458269.601364, + "created_at": 1719485736.497471, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.default__get_table_columns_and_constraints" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "meta": {}, - "name": "strategy_dispatch", - "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "get_table_columns_and_constraints", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/snapshots/strategies.sql", + "path": "macros/relations/column/columns_spec_ddl.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.strategy_dispatch" + "unique_id": "macro.dbt.get_table_columns_and_constraints" }, - "macro.dbt.string_literal": { + "macro.dbt.get_test_sql": { "arguments": [], - "created_at": 1696458269.786274, + "created_at": 1719485736.37231, "depends_on": { "macros": [ - "macro.dbt.default__string_literal" + "macro.dbt.default__get_test_sql" ] }, "description": "", @@ -6301,25 +6540,23 @@ "node_color": null, "show": true }, - "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", + "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 %}", "meta": {}, - "name": "string_literal", - "original_file_path": "macros/utils/literal.sql", + "name": "get_test_sql", + "original_file_path": "macros/materializations/tests/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/literal.sql", + "path": "macros/materializations/tests/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.string_literal" + "unique_id": "macro.dbt.get_test_sql" }, - "macro.dbt.support_multiple_grantees_per_dcl_statement": { + "macro.dbt.get_true_sql": { "arguments": [], - "created_at": 1696458269.823423, + "created_at": 1719485736.355415, "depends_on": { "macros": [ - "macro.dbt.default__support_multiple_grantees_per_dcl_statement" + "macro.dbt.default__get_true_sql" ] }, "description": "", @@ -6327,26 +6564,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", + "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "meta": {}, - "name": "support_multiple_grantees_per_dcl_statement", - "original_file_path": "macros/adapters/apply_grants.sql", + "name": "get_true_sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/apply_grants.sql", + "path": "macros/materializations/snapshots/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement" + "unique_id": "macro.dbt.get_true_sql" }, - "macro.dbt.sync_column_schemas": { + "macro.dbt.get_unit_test_sql": { "arguments": [], - "created_at": 1696458269.713077, + "created_at": 1719485736.3730109, "depends_on": { "macros": [ - "macro.dbt.alter_relation_add_remove_columns", - "macro.dbt.alter_column_type" + "macro.dbt.default__get_unit_test_sql" ] }, "description": "", @@ -6354,25 +6588,23 @@ "node_color": null, "show": true }, - "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 %}", + "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 %}", "meta": {}, - "name": "sync_column_schemas", - "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "get_unit_test_sql", + "original_file_path": "macros/materializations/tests/helpers.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/materializations/models/incremental/on_schema_change.sql", + "path": "macros/materializations/tests/helpers.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.sync_column_schemas" + "unique_id": "macro.dbt.get_unit_test_sql" }, - "macro.dbt.test_accepted_values": { + "macro.dbt.get_where_subquery": { "arguments": [], - "created_at": 1696458269.854999, + "created_at": 1719485736.3740978, "depends_on": { "macros": [ - "macro.dbt.default__test_accepted_values" + "macro.dbt.default__get_where_subquery" ] }, "description": "", @@ -6380,25 +6612,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "meta": {}, - "name": "test_accepted_values", - "original_file_path": "tests/generic/builtin.sql", + "name": "get_where_subquery", + "original_file_path": "macros/materializations/tests/where_subquery.sql", "package_name": "dbt", "patch_path": null, - "path": "tests/generic/builtin.sql", + "path": "macros/materializations/tests/where_subquery.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.test_accepted_values" + "unique_id": "macro.dbt.get_where_subquery" }, - "macro.dbt.test_not_null": { + "macro.dbt.handle_existing_table": { "arguments": [], - "created_at": 1696458269.854527, + "created_at": 1719485736.513942, "depends_on": { "macros": [ - "macro.dbt.default__test_not_null" + "macro.dbt.default__handle_existing_table" ] }, "description": "", @@ -6406,25 +6636,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", + "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "meta": {}, - "name": "test_not_null", - "original_file_path": "tests/generic/builtin.sql", + "name": "handle_existing_table", + "original_file_path": "macros/relations/view/replace.sql", "package_name": "dbt", "patch_path": null, - "path": "tests/generic/builtin.sql", + "path": "macros/relations/view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.test_not_null" + "unique_id": "macro.dbt.handle_existing_table" }, - "macro.dbt.test_relationships": { + "macro.dbt.hash": { "arguments": [], - "created_at": 1696458269.855469, + "created_at": 1719485736.5412428, "depends_on": { "macros": [ - "macro.dbt.default__test_relationships" + "macro.dbt.default__hash" ] }, "description": "", @@ -6432,25 +6660,23 @@ "node_color": null, "show": true }, - "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 %}", + "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "meta": {}, - "name": "test_relationships", - "original_file_path": "tests/generic/builtin.sql", + "name": "hash", + "original_file_path": "macros/utils/hash.sql", "package_name": "dbt", "patch_path": null, - "path": "tests/generic/builtin.sql", + "path": "macros/utils/hash.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.test_relationships" + "unique_id": "macro.dbt.hash" }, - "macro.dbt.test_unique": { + "macro.dbt.in_transaction": { "arguments": [], - "created_at": 1696458269.854142, + "created_at": 1719485736.336884, "depends_on": { "macros": [ - "macro.dbt.default__test_unique" + "macro.dbt.make_hook_config" ] }, "description": "", @@ -6458,25 +6684,45 @@ "node_color": null, "show": true }, - "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", + "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "meta": {}, - "name": "test_unique", - "original_file_path": "tests/generic/builtin.sql", + "name": "in_transaction", + "original_file_path": "macros/materializations/hooks.sql", "package_name": "dbt", "patch_path": null, - "path": "tests/generic/builtin.sql", + "path": "macros/materializations/hooks.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.test_unique" + "unique_id": "macro.dbt.in_transaction" }, - "macro.dbt.truncate_relation": { + "macro.dbt.incremental_validate_on_schema_change": { + "arguments": [], + "created_at": 1719485736.437581, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "incremental_validate_on_schema_change", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.incremental_validate_on_schema_change" + }, + "macro.dbt.information_schema_name": { "arguments": [], - "created_at": 1696458269.8150861, + "created_at": 1719485736.590652, "depends_on": { "macros": [ - "macro.dbt.default__truncate_relation" + "macro.dbt_postgres.postgres__information_schema_name" ] }, "description": "", @@ -6484,25 +6730,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "meta": {}, - "name": "truncate_relation", - "original_file_path": "macros/adapters/relation.sql", + "name": "information_schema_name", + "original_file_path": "macros/adapters/metadata.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/adapters/relation.sql", + "path": "macros/adapters/metadata.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.truncate_relation" + "unique_id": "macro.dbt.information_schema_name" }, - "macro.dbt.type_bigint": { + "macro.dbt.intersect": { "arguments": [], - "created_at": 1696458269.7903318, + "created_at": 1719485736.537264, "depends_on": { "macros": [ - "macro.dbt.default__type_bigint" + "macro.dbt.default__intersect" ] }, "description": "", @@ -6510,25 +6754,23 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "meta": {}, - "name": "type_bigint", - "original_file_path": "macros/utils/data_types.sql", + "name": "intersect", + "original_file_path": "macros/utils/intersect.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/utils/intersect.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_bigint" + "unique_id": "macro.dbt.intersect" }, - "macro.dbt.type_boolean": { + "macro.dbt.is_incremental": { "arguments": [], - "created_at": 1696458269.791368, + "created_at": 1719485736.417088, "depends_on": { "macros": [ - "macro.dbt.default__type_boolean" + "macro.dbt.should_full_refresh" ] }, "description": "", @@ -6536,25 +6778,23 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "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 %}", "meta": {}, - "name": "type_boolean", - "original_file_path": "macros/utils/data_types.sql", + "name": "is_incremental", + "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/materializations/models/incremental/is_incremental.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_boolean" + "unique_id": "macro.dbt.is_incremental" }, - "macro.dbt.type_float": { + "macro.dbt.last_day": { "arguments": [], - "created_at": 1696458269.789262, + "created_at": 1719485736.553028, "depends_on": { "macros": [ - "macro.dbt.default__type_float" + "macro.dbt_postgres.postgres__last_day" ] }, "description": "", @@ -6562,25 +6802,23 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "meta": {}, - "name": "type_float", - "original_file_path": "macros/utils/data_types.sql", + "name": "last_day", + "original_file_path": "macros/utils/last_day.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/utils/last_day.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_float" + "unique_id": "macro.dbt.last_day" }, - "macro.dbt.type_int": { + "macro.dbt.length": { "arguments": [], - "created_at": 1696458269.790855, + "created_at": 1719485736.536302, "depends_on": { "macros": [ - "macro.dbt.default__type_int" + "macro.dbt.default__length" ] }, "description": "", @@ -6588,25 +6826,2248 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "meta": {}, - "name": "type_int", - "original_file_path": "macros/utils/data_types.sql", + "name": "length", + "original_file_path": "macros/utils/length.sql", "package_name": "dbt", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/utils/length.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_int" + "unique_id": "macro.dbt.length" + }, + "macro.dbt.list_relations_without_caching": { + "arguments": [], + "created_at": 1719485736.592111, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__list_relations_without_caching" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", + "meta": {}, + "name": "list_relations_without_caching", + "original_file_path": "macros/adapters/metadata.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/metadata.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.list_relations_without_caching" + }, + "macro.dbt.list_schemas": { + "arguments": [], + "created_at": 1719485736.591011, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__list_schemas" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", + "meta": {}, + "name": "list_schemas", + "original_file_path": "macros/adapters/metadata.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/metadata.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.list_schemas" + }, + "macro.dbt.listagg": { + "arguments": [], + "created_at": 1719485736.5392041, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__listagg" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "listagg", + "original_file_path": "macros/utils/listagg.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/listagg.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.listagg" + }, + "macro.dbt.load_cached_relation": { + "arguments": [], + "created_at": 1719485736.568574, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "load_cached_relation", + "original_file_path": "macros/adapters/relation.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/relation.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.load_cached_relation" + }, + "macro.dbt.load_csv_rows": { + "arguments": [], + "created_at": 1719485736.4631271, + "depends_on": { + "macros": [ + "macro.dbt.default__load_csv_rows" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", + "meta": {}, + "name": "load_csv_rows", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/seeds/helpers.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.load_csv_rows" + }, + "macro.dbt.load_relation": { + "arguments": [], + "created_at": 1719485736.568728, + "depends_on": { + "macros": [ + "macro.dbt.load_cached_relation" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", + "meta": {}, + "name": "load_relation", + "original_file_path": "macros/adapters/relation.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/relation.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.load_relation" + }, + "macro.dbt.make_backup_relation": { + "arguments": [], + "created_at": 1719485736.566729, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__make_backup_relation" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "make_backup_relation", + "original_file_path": "macros/adapters/relation.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/relation.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.make_backup_relation" + }, + "macro.dbt.make_hook_config": { + "arguments": [], + "created_at": 1719485736.336577, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", + "meta": {}, + "name": "make_hook_config", + "original_file_path": "macros/materializations/hooks.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/hooks.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.make_hook_config" + }, + "macro.dbt.make_intermediate_relation": { + "arguments": [], + "created_at": 1719485736.565727, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__make_intermediate_relation" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", + "meta": {}, + "name": "make_intermediate_relation", + "original_file_path": "macros/adapters/relation.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/relation.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.make_intermediate_relation" + }, + "macro.dbt.make_temp_relation": { + "arguments": [], + "created_at": 1719485736.5661461, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__make_temp_relation" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", + "meta": {}, + "name": "make_temp_relation", + "original_file_path": "macros/adapters/relation.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/relation.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.make_temp_relation" + }, + "macro.dbt.materialization_clone_default": { + "arguments": [], + "created_at": 1719485736.448061, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "materialization_clone_default", + "original_file_path": "macros/materializations/models/clone/clone.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/clone/clone.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_clone_default" + }, + "macro.dbt.materialization_incremental_default": { + "arguments": [], + "created_at": 1719485736.4306219, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialization_incremental_default", + "original_file_path": "macros/materializations/models/incremental/incremental.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/incremental/incremental.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_incremental_default" + }, + "macro.dbt.materialization_materialized_view_default": { + "arguments": [], + "created_at": 1719485736.383056, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialization_materialized_view_default", + "original_file_path": "macros/materializations/models/materialized_view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/materialized_view.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_materialized_view_default" + }, + "macro.dbt.materialization_seed_default": { + "arguments": [], + "created_at": 1719485736.4520829, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialization_seed_default", + "original_file_path": "macros/materializations/seeds/seed.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/seeds/seed.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_seed_default" + }, + "macro.dbt.materialization_snapshot_default": { + "arguments": [], + "created_at": 1719485736.3679821, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialization_snapshot_default", + "original_file_path": "macros/materializations/snapshots/snapshot.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/snapshot.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_snapshot_default" + }, + "macro.dbt.materialization_table_default": { + "arguments": [], + "created_at": 1719485736.3933172, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialization_table_default", + "original_file_path": "macros/materializations/models/table.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/table.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_table_default" + }, + "macro.dbt.materialization_test_default": { + "arguments": [], + "created_at": 1719485736.370986, + "depends_on": { + "macros": [ + "macro.dbt.should_store_failures", + "macro.dbt.statement", + "macro.dbt.get_create_sql", + "macro.dbt.get_test_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "materialization_test_default", + "original_file_path": "macros/materializations/tests/test.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/tests/test.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_test_default" + }, + "macro.dbt.materialization_unit_default": { + "arguments": [], + "created_at": 1719485736.3763871, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "materialization_unit_default", + "original_file_path": "macros/materializations/tests/unit.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/tests/unit.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_unit_default" + }, + "macro.dbt.materialization_view_default": { + "arguments": [], + "created_at": 1719485736.390083, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 -%}", + "meta": {}, + "name": "materialization_view_default", + "original_file_path": "macros/materializations/models/view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/view.sql", + "resource_type": "macro", + "supported_languages": [ + "sql" + ], + "unique_id": "macro.dbt.materialization_view_default" + }, + "macro.dbt.materialized_view_execute_build_sql": { + "arguments": [], + "created_at": 1719485736.386875, + "depends_on": { + "macros": [ + "macro.dbt.run_hooks", + "macro.dbt.statement", + "macro.dbt.should_revoke", + "macro.dbt.apply_grants", + "macro.dbt.persist_docs" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialized_view_execute_build_sql", + "original_file_path": "macros/materializations/models/materialized_view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/materialized_view.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.materialized_view_execute_build_sql" + }, + "macro.dbt.materialized_view_execute_no_op": { + "arguments": [], + "created_at": 1719485736.385866, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialized_view_execute_no_op", + "original_file_path": "macros/materializations/models/materialized_view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/materialized_view.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.materialized_view_execute_no_op" + }, + "macro.dbt.materialized_view_get_build_sql": { + "arguments": [], + "created_at": 1719485736.385609, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialized_view_get_build_sql", + "original_file_path": "macros/materializations/models/materialized_view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/materialized_view.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.materialized_view_get_build_sql" + }, + "macro.dbt.materialized_view_setup": { + "arguments": [], + "created_at": 1719485736.3838332, + "depends_on": { + "macros": [ + "macro.dbt.load_cached_relation", + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialized_view_setup", + "original_file_path": "macros/materializations/models/materialized_view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/materialized_view.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.materialized_view_setup" + }, + "macro.dbt.materialized_view_teardown": { + "arguments": [], + "created_at": 1719485736.384107, + "depends_on": { + "macros": [ + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "materialized_view_teardown", + "original_file_path": "macros/materializations/models/materialized_view.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/materialized_view.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.materialized_view_teardown" + }, + "macro.dbt.noop_statement": { + "arguments": [], + "created_at": 1719485736.5199249, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "noop_statement", + "original_file_path": "macros/etc/statement.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/etc/statement.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.noop_statement" + }, + "macro.dbt.partition_range": { + "arguments": [], + "created_at": 1719485736.5252612, + "depends_on": { + "macros": [ + "macro.dbt.dates_in_range" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "partition_range", + "original_file_path": "macros/etc/datetime.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/etc/datetime.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.partition_range" + }, + "macro.dbt.persist_docs": { + "arguments": [], + "created_at": 1719485736.585922, + "depends_on": { + "macros": [ + "macro.dbt.default__persist_docs" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "persist_docs", + "original_file_path": "macros/adapters/persist_docs.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/persist_docs.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.persist_docs" + }, + "macro.dbt.position": { + "arguments": [], + "created_at": 1719485736.543356, + "depends_on": { + "macros": [ + "macro.dbt.default__position" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", + "meta": {}, + "name": "position", + "original_file_path": "macros/utils/position.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/position.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.position" + }, + "macro.dbt.post_snapshot": { + "arguments": [], + "created_at": 1719485736.355165, + "depends_on": { + "macros": [ + "macro.dbt.default__post_snapshot" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", + "meta": {}, + "name": "post_snapshot", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/helpers.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.post_snapshot" + }, + "macro.dbt.process_schema_changes": { + "arguments": [], + "created_at": 1719485736.44261, + "depends_on": { + "macros": [ + "macro.dbt.check_for_schema_changes", + "macro.dbt.sync_column_schemas" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "process_schema_changes", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.process_schema_changes" + }, + "macro.dbt.py_current_timestring": { + "arguments": [], + "created_at": 1719485736.5255191, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "py_current_timestring", + "original_file_path": "macros/etc/datetime.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/etc/datetime.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.py_current_timestring" + }, + "macro.dbt.py_script_comment": { + "arguments": [], + "created_at": 1719485736.6181471, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", + "meta": {}, + "name": "py_script_comment", + "original_file_path": "macros/python_model/python.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/python_model/python.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.py_script_comment" + }, + "macro.dbt.py_script_postfix": { + "arguments": [], + "created_at": 1719485736.618067, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "py_script_postfix", + "original_file_path": "macros/python_model/python.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/python_model/python.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.py_script_postfix" + }, + "macro.dbt.refresh_materialized_view": { + "arguments": [], + "created_at": 1719485736.489407, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__refresh_materialized_view" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", + "meta": {}, + "name": "refresh_materialized_view", + "original_file_path": "macros/relations/materialized_view/refresh.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/materialized_view/refresh.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.refresh_materialized_view" + }, + "macro.dbt.rename_relation": { + "arguments": [], + "created_at": 1719485736.478327, + "depends_on": { + "macros": [ + "macro.dbt.default__rename_relation" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", + "meta": {}, + "name": "rename_relation", + "original_file_path": "macros/relations/rename.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/rename.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.rename_relation" + }, + "macro.dbt.replace": { + "arguments": [], + "created_at": 1719485736.532748, + "depends_on": { + "macros": [ + "macro.dbt.default__replace" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", + "meta": {}, + "name": "replace", + "original_file_path": "macros/utils/replace.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/replace.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.replace" + }, + "macro.dbt.reset_csv_table": { + "arguments": [], + "created_at": 1719485736.460277, + "depends_on": { + "macros": [ + "macro.dbt.default__reset_csv_table" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "reset_csv_table", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/seeds/helpers.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.reset_csv_table" + }, + "macro.dbt.resolve_model_name": { + "arguments": [], + "created_at": 1719485736.614536, + "depends_on": { + "macros": [ + "macro.dbt.default__resolve_model_name" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", + "meta": {}, + "name": "resolve_model_name", + "original_file_path": "macros/python_model/python.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/python_model/python.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.resolve_model_name" + }, + "macro.dbt.right": { + "arguments": [], + "created_at": 1719485736.538353, + "depends_on": { + "macros": [ + "macro.dbt.default__right" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", + "meta": {}, + "name": "right", + "original_file_path": "macros/utils/right.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/right.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.right" + }, + "macro.dbt.run_hooks": { + "arguments": [], + "created_at": 1719485736.336357, + "depends_on": { + "macros": [ + "macro.dbt.statement" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "run_hooks", + "original_file_path": "macros/materializations/hooks.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/hooks.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.run_hooks" + }, + "macro.dbt.run_query": { + "arguments": [], + "created_at": 1719485736.5202482, + "depends_on": { + "macros": [ + "macro.dbt.statement" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "run_query", + "original_file_path": "macros/etc/statement.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/etc/statement.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.run_query" + }, + "macro.dbt.safe_cast": { + "arguments": [], + "created_at": 1719485736.540742, + "depends_on": { + "macros": [ + "macro.dbt.default__safe_cast" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", + "meta": {}, + "name": "safe_cast", + "original_file_path": "macros/utils/safe_cast.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/safe_cast.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.safe_cast" + }, + "macro.dbt.set_sql_header": { + "arguments": [], + "created_at": 1719485736.338798, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", + "meta": {}, + "name": "set_sql_header", + "original_file_path": "macros/materializations/configs.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/configs.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.set_sql_header" + }, + "macro.dbt.should_full_refresh": { + "arguments": [], + "created_at": 1719485736.339242, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "should_full_refresh", + "original_file_path": "macros/materializations/configs.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/configs.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.should_full_refresh" + }, + "macro.dbt.should_revoke": { + "arguments": [], + "created_at": 1719485736.573465, + "depends_on": { + "macros": [ + "macro.dbt.copy_grants" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "should_revoke", + "original_file_path": "macros/adapters/apply_grants.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/apply_grants.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.should_revoke" + }, + "macro.dbt.should_store_failures": { + "arguments": [], + "created_at": 1719485736.339565, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "should_store_failures", + "original_file_path": "macros/materializations/configs.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/configs.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.should_store_failures" + }, + "macro.dbt.snapshot_check_all_get_existing_columns": { + "arguments": [], + "created_at": 1719485736.3482602, + "depends_on": { + "macros": [ + "macro.dbt.get_columns_in_query" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "snapshot_check_all_get_existing_columns", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/strategies.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns" + }, + "macro.dbt.snapshot_check_strategy": { + "arguments": [], + "created_at": 1719485736.3500328, + "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": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "snapshot_check_strategy", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/strategies.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_check_strategy" + }, + "macro.dbt.snapshot_get_time": { + "arguments": [], + "created_at": 1719485736.55953, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__snapshot_get_time" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "snapshot_get_time", + "original_file_path": "macros/adapters/timestamps.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/timestamps.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_get_time" + }, + "macro.dbt.snapshot_hash_arguments": { + "arguments": [], + "created_at": 1719485736.3454158, + "depends_on": { + "macros": [ + "macro.dbt.default__snapshot_hash_arguments" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", + "meta": {}, + "name": "snapshot_hash_arguments", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/strategies.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_hash_arguments" + }, + "macro.dbt.snapshot_merge_sql": { + "arguments": [], + "created_at": 1719485736.3400362, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__snapshot_merge_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", + "meta": {}, + "name": "snapshot_merge_sql", + "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/snapshot_merge.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_merge_sql" + }, + "macro.dbt.snapshot_staging_table": { + "arguments": [], + "created_at": 1719485736.355765, + "depends_on": { + "macros": [ + "macro.dbt.default__snapshot_staging_table" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "snapshot_staging_table", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/helpers.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_staging_table" + }, + "macro.dbt.snapshot_string_as_time": { + "arguments": [], + "created_at": 1719485736.3465831, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__snapshot_string_as_time" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", + "meta": {}, + "name": "snapshot_string_as_time", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/strategies.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_string_as_time" + }, + "macro.dbt.snapshot_timestamp_strategy": { + "arguments": [], + "created_at": 1719485736.346405, + "depends_on": { + "macros": [ + "macro.dbt.snapshot_hash_arguments" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "snapshot_timestamp_strategy", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/strategies.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.snapshot_timestamp_strategy" + }, + "macro.dbt.split_part": { + "arguments": [], + "created_at": 1719485736.55408, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__split_part" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "split_part", + "original_file_path": "macros/utils/split_part.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/split_part.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.split_part" + }, + "macro.dbt.sql_convert_columns_in_relation": { + "arguments": [], + "created_at": 1719485736.59661, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "sql_convert_columns_in_relation", + "original_file_path": "macros/adapters/columns.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/columns.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.sql_convert_columns_in_relation" + }, + "macro.dbt.statement": { + "arguments": [], + "created_at": 1719485736.51912, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "statement", + "original_file_path": "macros/etc/statement.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/etc/statement.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.statement" + }, + "macro.dbt.strategy_dispatch": { + "arguments": [], + "created_at": 1719485736.345131, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "strategy_dispatch", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/snapshots/strategies.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.strategy_dispatch" + }, + "macro.dbt.string_literal": { + "arguments": [], + "created_at": 1719485736.543961, + "depends_on": { + "macros": [ + "macro.dbt.default__string_literal" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "string_literal", + "original_file_path": "macros/utils/literal.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/literal.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.string_literal" + }, + "macro.dbt.support_multiple_grantees_per_dcl_statement": { + "arguments": [], + "created_at": 1719485736.572978, + "depends_on": { + "macros": [ + "macro.dbt.default__support_multiple_grantees_per_dcl_statement" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", + "meta": {}, + "name": "support_multiple_grantees_per_dcl_statement", + "original_file_path": "macros/adapters/apply_grants.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/apply_grants.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement" + }, + "macro.dbt.sync_column_schemas": { + "arguments": [], + "created_at": 1719485736.4416761, + "depends_on": { + "macros": [ + "macro.dbt.alter_relation_add_remove_columns", + "macro.dbt.alter_column_type" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "sync_column_schemas", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.sync_column_schemas" + }, + "macro.dbt.table_columns_and_constraints": { + "arguments": [], + "created_at": 1719485736.500673, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "table_columns_and_constraints", + "original_file_path": "macros/relations/column/columns_spec_ddl.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/relations/column/columns_spec_ddl.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.table_columns_and_constraints" + }, + "macro.dbt.test_accepted_values": { + "arguments": [], + "created_at": 1719485736.6202009, + "depends_on": { + "macros": [ + "macro.dbt.default__test_accepted_values" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "test_accepted_values", + "original_file_path": "tests/generic/builtin.sql", + "package_name": "dbt", + "patch_path": null, + "path": "tests/generic/builtin.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.test_accepted_values" + }, + "macro.dbt.test_not_null": { + "arguments": [], + "created_at": 1719485736.619859, + "depends_on": { + "macros": [ + "macro.dbt.default__test_not_null" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", + "meta": {}, + "name": "test_not_null", + "original_file_path": "tests/generic/builtin.sql", + "package_name": "dbt", + "patch_path": null, + "path": "tests/generic/builtin.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.test_not_null" + }, + "macro.dbt.test_relationships": { + "arguments": [], + "created_at": 1719485736.620512, + "depends_on": { + "macros": [ + "macro.dbt.default__test_relationships" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "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 %}", + "meta": {}, + "name": "test_relationships", + "original_file_path": "tests/generic/builtin.sql", + "package_name": "dbt", + "patch_path": null, + "path": "tests/generic/builtin.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.test_relationships" + }, + "macro.dbt.test_unique": { + "arguments": [], + "created_at": 1719485736.619491, + "depends_on": { + "macros": [ + "macro.dbt.default__test_unique" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", + "meta": {}, + "name": "test_unique", + "original_file_path": "tests/generic/builtin.sql", + "package_name": "dbt", + "patch_path": null, + "path": "tests/generic/builtin.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.test_unique" + }, + "macro.dbt.truncate_relation": { + "arguments": [], + "created_at": 1719485736.567298, + "depends_on": { + "macros": [ + "macro.dbt.default__truncate_relation" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "meta": {}, + "name": "truncate_relation", + "original_file_path": "macros/adapters/relation.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/relation.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.truncate_relation" + }, + "macro.dbt.type_bigint": { + "arguments": [], + "created_at": 1719485736.548424, + "depends_on": { + "macros": [ + "macro.dbt.default__type_bigint" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_bigint", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_bigint" + }, + "macro.dbt.type_boolean": { + "arguments": [], + "created_at": 1719485736.55002, + "depends_on": { + "macros": [ + "macro.dbt.default__type_boolean" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_boolean", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_boolean" + }, + "macro.dbt.type_float": { + "arguments": [], + "created_at": 1719485736.547037, + "depends_on": { + "macros": [ + "macro.dbt.default__type_float" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_float", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_float" + }, + "macro.dbt.type_int": { + "arguments": [], + "created_at": 1719485736.54878, + "depends_on": { + "macros": [ + "macro.dbt.default__type_int" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_int", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_int" + }, + "macro.dbt.type_numeric": { + "arguments": [], + "created_at": 1719485736.547442, + "depends_on": { + "macros": [ + "macro.dbt.default__type_numeric" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_numeric", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_numeric" + }, + "macro.dbt.type_string": { + "arguments": [], + "created_at": 1719485736.545998, + "depends_on": { + "macros": [ + "macro.dbt.default__type_string" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_string", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_string" + }, + "macro.dbt.type_timestamp": { + "arguments": [], + "created_at": 1719485736.546634, + "depends_on": { + "macros": [ + "macro.dbt.default__type_timestamp" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "meta": {}, + "name": "type_timestamp", + "original_file_path": "macros/utils/data_types.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/utils/data_types.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.type_timestamp" + }, + "macro.dbt.validate_sql": { + "arguments": [], + "created_at": 1719485736.5702772, + "depends_on": { + "macros": [ + "macro.dbt.default__validate_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", + "meta": {}, + "name": "validate_sql", + "original_file_path": "macros/adapters/validate_sql.sql", + "package_name": "dbt", + "patch_path": null, + "path": "macros/adapters/validate_sql.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt.validate_sql" + }, + "macro.dbt_postgres.postgres__alter_column_comment": { + "arguments": [], + "created_at": 1719485736.314291, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres_escape_comment" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__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 = postgres_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 %}", + "meta": {}, + "name": "postgres__alter_column_comment", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/adapters.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__alter_column_comment" + }, + "macro.dbt_postgres.postgres__alter_relation_comment": { + "arguments": [], + "created_at": 1719485736.312385, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres_escape_comment" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", + "meta": {}, + "name": "postgres__alter_relation_comment", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/adapters.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment" + }, + "macro.dbt_postgres.postgres__any_value": { + "arguments": [], + "created_at": 1719485736.332639, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", + "meta": {}, + "name": "postgres__any_value", + "original_file_path": "macros/utils/any_value.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/utils/any_value.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__any_value" + }, + "macro.dbt_postgres.postgres__check_schema_exists": { + "arguments": [], + "created_at": 1719485736.309761, + "depends_on": { + "macros": [ + "macro.dbt.statement" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", + "meta": {}, + "name": "postgres__check_schema_exists", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/adapters.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__check_schema_exists" + }, + "macro.dbt_postgres.postgres__copy_grants": { + "arguments": [], + "created_at": 1719485736.3146439, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", + "meta": {}, + "name": "postgres__copy_grants", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/adapters.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__copy_grants" + }, + "macro.dbt_postgres.postgres__create_schema": { + "arguments": [], + "created_at": 1719485736.306344, + "depends_on": { + "macros": [ + "macro.dbt.statement" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", + "meta": {}, + "name": "postgres__create_schema", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/adapters.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__create_schema" + }, + "macro.dbt_postgres.postgres__create_table_as": { + "arguments": [], + "created_at": 1719485736.3053398, + "depends_on": { + "macros": [ + "macro.dbt.get_assert_columns_equivalent", + "macro.dbt.get_table_columns_and_constraints", + "macro.dbt.default__get_column_names", + "macro.dbt.get_select_subquery" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", + "meta": {}, + "name": "postgres__create_table_as", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/adapters.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__create_table_as" + }, + "macro.dbt_postgres.postgres__current_timestamp": { + "arguments": [], + "created_at": 1719485736.2888992, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", + "meta": {}, + "name": "postgres__current_timestamp", + "original_file_path": "macros/timestamps.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/timestamps.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__current_timestamp" + }, + "macro.dbt_postgres.postgres__current_timestamp_backcompat": { + "arguments": [], + "created_at": 1719485736.289357, + "depends_on": { + "macros": [ + "macro.dbt.type_timestamp" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", + "meta": {}, + "name": "postgres__current_timestamp_backcompat", + "original_file_path": "macros/timestamps.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/timestamps.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat" + }, + "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": { + "arguments": [], + "created_at": 1719485736.289477, + "depends_on": { + "macros": [ + "macro.dbt.type_timestamp" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", + "meta": {}, + "name": "postgres__current_timestamp_in_utc_backcompat", + "original_file_path": "macros/timestamps.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/timestamps.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat" + }, + "macro.dbt_postgres.postgres__dateadd": { + "arguments": [], + "created_at": 1719485736.328303, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", + "meta": {}, + "name": "postgres__dateadd", + "original_file_path": "macros/utils/dateadd.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/utils/dateadd.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__dateadd" + }, + "macro.dbt_postgres.postgres__datediff": { + "arguments": [], + "created_at": 1719485736.332466, + "depends_on": { + "macros": [ + "macro.dbt.datediff" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", + "meta": {}, + "name": "postgres__datediff", + "original_file_path": "macros/utils/datediff.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/utils/datediff.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__datediff" + }, + "macro.dbt_postgres.postgres__describe_materialized_view": { + "arguments": [], + "created_at": 1719485736.320213, + "depends_on": { + "macros": [ + "macro.dbt.run_query", + "macro.dbt.get_show_indexes_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", + "meta": {}, + "name": "postgres__describe_materialized_view", + "original_file_path": "macros/relations/materialized_view/describe.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/relations/materialized_view/describe.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view" + }, + "macro.dbt_postgres.postgres__drop_materialized_view": { + "arguments": [], + "created_at": 1719485736.319324, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", + "meta": {}, + "name": "postgres__drop_materialized_view", + "original_file_path": "macros/relations/materialized_view/drop.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/relations/materialized_view/drop.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view" }, - "macro.dbt.type_numeric": { + "macro.dbt_postgres.postgres__drop_schema": { "arguments": [], - "created_at": 1696458269.789772, + "created_at": 1719485736.307206, "depends_on": { "macros": [ - "macro.dbt.default__type_numeric" + "macro.dbt.statement" ] }, "description": "", @@ -6614,77 +9075,68 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "meta": {}, - "name": "type_numeric", - "original_file_path": "macros/utils/data_types.sql", - "package_name": "dbt", + "name": "postgres__drop_schema", + "original_file_path": "macros/adapters.sql", + "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_numeric" + "unique_id": "macro.dbt_postgres.postgres__drop_schema" }, - "macro.dbt.type_string": { + "macro.dbt_postgres.postgres__drop_table": { "arguments": [], - "created_at": 1696458269.788082, + "created_at": 1719485736.3256729, "depends_on": { - "macros": [ - "macro.dbt.default__type_string" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "meta": {}, - "name": "type_string", - "original_file_path": "macros/utils/data_types.sql", - "package_name": "dbt", + "name": "postgres__drop_table", + "original_file_path": "macros/relations/table/drop.sql", + "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/relations/table/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_string" + "unique_id": "macro.dbt_postgres.postgres__drop_table" }, - "macro.dbt.type_timestamp": { + "macro.dbt_postgres.postgres__drop_view": { "arguments": [], - "created_at": 1696458269.788734, + "created_at": 1719485736.327039, "depends_on": { - "macros": [ - "macro.dbt.default__type_timestamp" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "meta": {}, - "name": "type_timestamp", - "original_file_path": "macros/utils/data_types.sql", - "package_name": "dbt", + "name": "postgres__drop_view", + "original_file_path": "macros/relations/view/drop.sql", + "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/utils/data_types.sql", + "path": "macros/relations/view/drop.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/global_project", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt.type_timestamp" + "unique_id": "macro.dbt_postgres.postgres__drop_view" }, - "macro.dbt_postgres.postgres__alter_column_comment": { + "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": { "arguments": [], - "created_at": 1696458269.575566, + "created_at": 1719485736.3214989, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres_escape_comment" + "macro.dbt.get_replace_sql", + "macro.dbt_postgres.postgres__update_indexes_on_materialized_view" ] }, "description": "", @@ -6692,25 +9144,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__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 = postgres_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 %}", + "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "meta": {}, - "name": "postgres__alter_column_comment", - "original_file_path": "macros/adapters.sql", + "name": "postgres__get_alter_materialized_view_as_sql", + "original_file_path": "macros/relations/materialized_view/alter.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/adapters.sql", + "path": "macros/relations/materialized_view/alter.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__alter_column_comment" + "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql" }, - "macro.dbt_postgres.postgres__alter_relation_comment": { + "macro.dbt_postgres.postgres__get_catalog": { "arguments": [], - "created_at": 1696458269.574534, + "created_at": 1719485736.292309, "depends_on": { "macros": [ - "macro.dbt_postgres.postgres_escape_comment" + "macro.dbt_postgres.postgres__get_catalog_relations" ] }, "description": "", @@ -6718,49 +9168,48 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "meta": {}, - "name": "postgres__alter_relation_comment", - "original_file_path": "macros/adapters.sql", + "name": "postgres__get_catalog", + "original_file_path": "macros/catalog.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/adapters.sql", + "path": "macros/catalog.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment" + "unique_id": "macro.dbt_postgres.postgres__get_catalog" }, - "macro.dbt_postgres.postgres__any_value": { + "macro.dbt_postgres.postgres__get_catalog_relations": { "arguments": [], - "created_at": 1696458269.586868, + "created_at": 1719485736.2918808, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", + "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "meta": {}, - "name": "postgres__any_value", - "original_file_path": "macros/utils/any_value.sql", + "name": "postgres__get_catalog_relations", + "original_file_path": "macros/catalog.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/utils/any_value.sql", + "path": "macros/catalog.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__any_value" + "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations" }, - "macro.dbt_postgres.postgres__check_schema_exists": { + "macro.dbt_postgres.postgres__get_columns_in_relation": { "arguments": [], - "created_at": 1696458269.570358, + "created_at": 1719485736.308002, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt.statement", + "macro.dbt.sql_convert_columns_in_relation" ] }, "description": "", @@ -6768,22 +9217,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", + "macro_sql": "{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}", "meta": {}, - "name": "postgres__check_schema_exists", + "name": "postgres__get_columns_in_relation", "original_file_path": "macros/adapters.sql", "package_name": "dbt_postgres", "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__check_schema_exists" + "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation" }, - "macro.dbt_postgres.postgres__copy_grants": { + "macro.dbt_postgres.postgres__get_create_index_sql": { "arguments": [], - "created_at": 1696458269.57614, + "created_at": 1719485736.30595, "depends_on": { "macros": [] }, @@ -6792,25 +9239,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "meta": {}, - "name": "postgres__copy_grants", + "name": "postgres__get_create_index_sql", "original_file_path": "macros/adapters.sql", "package_name": "dbt_postgres", "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__copy_grants" + "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql" }, - "macro.dbt_postgres.postgres__create_schema": { + "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": { "arguments": [], - "created_at": 1696458269.566682, + "created_at": 1719485736.3255181, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt.get_create_index_sql" ] }, "description": "", @@ -6818,22 +9263,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}\n {%- endfor -%}\n\n{% endmacro %}", "meta": {}, - "name": "postgres__create_schema", - "original_file_path": "macros/adapters.sql", + "name": "postgres__get_create_materialized_view_as_sql", + "original_file_path": "macros/relations/materialized_view/create.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/adapters.sql", + "path": "macros/relations/materialized_view/create.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__create_schema" + "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql" }, - "macro.dbt_postgres.postgres__create_table_as": { + "macro.dbt_postgres.postgres__get_drop_index_sql": { "arguments": [], - "created_at": 1696458269.5653162, + "created_at": 1719485736.3150148, "depends_on": { "macros": [] }, @@ -6842,49 +9285,48 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", + "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "meta": {}, - "name": "postgres__create_table_as", + "name": "postgres__get_drop_index_sql", "original_file_path": "macros/adapters.sql", "package_name": "dbt_postgres", "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__create_table_as" + "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql" }, - "macro.dbt_postgres.postgres__current_timestamp": { + "macro.dbt_postgres.postgres__get_incremental_default_sql": { "arguments": [], - "created_at": 1696458269.5499048, + "created_at": 1719485736.316301, "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_incremental_delete_insert_sql", + "macro.dbt.get_incremental_append_sql" + ] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", + "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "meta": {}, - "name": "postgres__current_timestamp", - "original_file_path": "macros/timestamps.sql", + "name": "postgres__get_incremental_default_sql", + "original_file_path": "macros/materializations/incremental_strategies.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/timestamps.sql", + "path": "macros/materializations/incremental_strategies.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__current_timestamp" + "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql" }, - "macro.dbt_postgres.postgres__current_timestamp_backcompat": { + "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": { "arguments": [], - "created_at": 1696458269.551879, + "created_at": 1719485736.324945, "depends_on": { "macros": [ - "macro.dbt.type_timestamp" + "macro.dbt_postgres.postgres__describe_materialized_view" ] }, "description": "", @@ -6892,25 +9334,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "meta": {}, - "name": "postgres__current_timestamp_backcompat", - "original_file_path": "macros/timestamps.sql", + "name": "postgres__get_materialized_view_configuration_changes", + "original_file_path": "macros/relations/materialized_view/alter.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/timestamps.sql", + "path": "macros/relations/materialized_view/alter.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat" + "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes" }, - "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": { + "macro.dbt_postgres.postgres__get_relations": { "arguments": [], - "created_at": 1696458269.5520551, + "created_at": 1719485736.293338, "depends_on": { "macros": [ - "macro.dbt.type_timestamp" + "macro.dbt.statement" ] }, "description": "", @@ -6918,22 +9358,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v', 'm')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "meta": {}, - "name": "postgres__current_timestamp_in_utc_backcompat", - "original_file_path": "macros/timestamps.sql", + "name": "postgres__get_relations", + "original_file_path": "macros/relations.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/timestamps.sql", + "path": "macros/relations.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat" + "unique_id": "macro.dbt_postgres.postgres__get_relations" }, - "macro.dbt_postgres.postgres__dateadd": { + "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": { "arguments": [], - "created_at": 1696458269.579446, + "created_at": 1719485736.3205602, "depends_on": { "macros": [] }, @@ -6942,77 +9380,69 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "meta": {}, - "name": "postgres__dateadd", - "original_file_path": "macros/utils/dateadd.sql", + "name": "postgres__get_rename_materialized_view_sql", + "original_file_path": "macros/relations/materialized_view/rename.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/utils/dateadd.sql", + "path": "macros/relations/materialized_view/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__dateadd" + "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql" }, - "macro.dbt_postgres.postgres__datediff": { + "macro.dbt_postgres.postgres__get_rename_table_sql": { "arguments": [], - "created_at": 1696458269.586445, + "created_at": 1719485736.326884, "depends_on": { - "macros": [ - "macro.dbt.datediff" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", + "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "meta": {}, - "name": "postgres__datediff", - "original_file_path": "macros/utils/datediff.sql", + "name": "postgres__get_rename_table_sql", + "original_file_path": "macros/relations/table/rename.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/utils/datediff.sql", + "path": "macros/relations/table/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__datediff" + "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql" }, - "macro.dbt_postgres.postgres__drop_schema": { + "macro.dbt_postgres.postgres__get_rename_view_sql": { "arguments": [], - "created_at": 1696458269.567198, + "created_at": 1719485736.32807, "depends_on": { - "macros": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "docs": { "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", + "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "meta": {}, - "name": "postgres__drop_schema", - "original_file_path": "macros/adapters.sql", + "name": "postgres__get_rename_view_sql", + "original_file_path": "macros/relations/view/rename.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/adapters.sql", + "path": "macros/relations/view/rename.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__drop_schema" + "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql" }, - "macro.dbt_postgres.postgres__get_catalog": { + "macro.dbt_postgres.postgres__get_replace_table_sql": { "arguments": [], - "created_at": 1696458269.5540092, + "created_at": 1719485736.326431, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt.get_assert_columns_equivalent", + "macro.dbt.get_table_columns_and_constraints", + "macro.dbt.get_select_subquery" ] }, "description": "", @@ -7020,26 +9450,23 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", + "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\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\n{%- endmacro %}", "meta": {}, - "name": "postgres__get_catalog", - "original_file_path": "macros/catalog.sql", + "name": "postgres__get_replace_table_sql", + "original_file_path": "macros/relations/table/replace.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/catalog.sql", + "path": "macros/relations/table/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__get_catalog" + "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql" }, - "macro.dbt_postgres.postgres__get_columns_in_relation": { + "macro.dbt_postgres.postgres__get_replace_view_sql": { "arguments": [], - "created_at": 1696458269.568068, + "created_at": 1719485736.327884, "depends_on": { "macros": [ - "macro.dbt.statement", - "macro.dbt.sql_convert_columns_in_relation" + "macro.dbt.get_assert_columns_equivalent" ] }, "description": "", @@ -7047,22 +9474,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__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 {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\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 %}", + "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace 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\n{%- endmacro %}", "meta": {}, - "name": "postgres__get_columns_in_relation", - "original_file_path": "macros/adapters.sql", + "name": "postgres__get_replace_view_sql", + "original_file_path": "macros/relations/view/replace.sql", "package_name": "dbt_postgres", "patch_path": null, - "path": "macros/adapters.sql", + "path": "macros/relations/view/replace.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation" + "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql" }, - "macro.dbt_postgres.postgres__get_create_index_sql": { + "macro.dbt_postgres.postgres__get_show_grant_sql": { "arguments": [], - "created_at": 1696458269.566161, + "created_at": 1719485736.314513, "depends_on": { "macros": [] }, @@ -7071,49 +9496,20 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }});\n{%- endmacro %}", + "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "meta": {}, - "name": "postgres__get_create_index_sql", + "name": "postgres__get_show_grant_sql", "original_file_path": "macros/adapters.sql", "package_name": "dbt_postgres", "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", - "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql" - }, - "macro.dbt_postgres.postgres__get_incremental_default_sql": { - "arguments": [], - "created_at": 1696458269.577235, - "depends_on": { - "macros": [ - "macro.dbt.get_incremental_delete_insert_sql", - "macro.dbt.get_incremental_append_sql" - ] - }, - "description": "", - "docs": { - "node_color": null, - "show": true - }, - "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", - "meta": {}, - "name": "postgres__get_incremental_default_sql", - "original_file_path": "macros/materializations/incremental_strategies.sql", - "package_name": "dbt_postgres", - "patch_path": null, - "path": "macros/materializations/incremental_strategies.sql", - "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql" + "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql" }, - "macro.dbt_postgres.postgres__get_show_grant_sql": { + "macro.dbt_postgres.postgres__get_show_indexes_sql": { "arguments": [], - "created_at": 1696458269.575934, + "created_at": 1719485736.31486, "depends_on": { "macros": [] }, @@ -7122,22 +9518,20 @@ "node_color": null, "show": true }, - "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", + "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "meta": {}, - "name": "postgres__get_show_grant_sql", + "name": "postgres__get_show_indexes_sql", "original_file_path": "macros/adapters.sql", "package_name": "dbt_postgres", "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], - "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql" + "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql" }, "macro.dbt_postgres.postgres__information_schema_name": { "arguments": [], - "created_at": 1696458269.568956, + "created_at": 1719485736.308933, "depends_on": { "macros": [] }, @@ -7154,14 +9548,12 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__information_schema_name" }, "macro.dbt_postgres.postgres__last_day": { "arguments": [], - "created_at": 1696458269.587851, + "created_at": 1719485736.333154, "depends_on": { "macros": [ "macro.dbt.dateadd", @@ -7182,14 +9574,12 @@ "patch_path": null, "path": "macros/utils/last_day.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__last_day" }, "macro.dbt_postgres.postgres__list_relations_without_caching": { "arguments": [], - "created_at": 1696458269.568678, + "created_at": 1719485736.308728, "depends_on": { "macros": [ "macro.dbt.statement" @@ -7200,7 +9590,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres__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 tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", + "macro_sql": "{% macro postgres__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 tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n matviewname as name,\n schemaname as schema,\n 'materialized_view' as type\n from pg_matviews\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "meta": {}, "name": "postgres__list_relations_without_caching", "original_file_path": "macros/adapters.sql", @@ -7208,14 +9598,12 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching" }, "macro.dbt_postgres.postgres__list_schemas": { "arguments": [], - "created_at": 1696458269.569512, + "created_at": 1719485736.309331, "depends_on": { "macros": [ "macro.dbt.statement" @@ -7234,14 +9622,12 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__list_schemas" }, "macro.dbt_postgres.postgres__listagg": { "arguments": [], - "created_at": 1696458269.5807512, + "created_at": 1719485736.329083, "depends_on": { "macros": [] }, @@ -7258,14 +9644,12 @@ "patch_path": null, "path": "macros/utils/listagg.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__listagg" }, "macro.dbt_postgres.postgres__make_backup_relation": { "arguments": [], - "created_at": 1696458269.5734138, + "created_at": 1719485736.311583, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__make_relation_with_suffix" @@ -7284,14 +9668,12 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__make_backup_relation" }, "macro.dbt_postgres.postgres__make_intermediate_relation": { "arguments": [], - "created_at": 1696458269.5723772, + "created_at": 1719485736.3109372, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__make_relation_with_suffix" @@ -7310,14 +9692,12 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation" }, "macro.dbt_postgres.postgres__make_relation_with_suffix": { "arguments": [], - "created_at": 1696458269.5720162, + "created_at": 1719485736.31072, "depends_on": { "macros": [] }, @@ -7334,14 +9714,12 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix" }, "macro.dbt_postgres.postgres__make_temp_relation": { "arguments": [], - "created_at": 1696458269.572947, + "created_at": 1719485736.31129, "depends_on": { "macros": [ "macro.dbt_postgres.postgres__make_relation_with_suffix" @@ -7360,14 +9738,34 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__make_temp_relation" }, + "macro.dbt_postgres.postgres__refresh_materialized_view": { + "arguments": [], + "created_at": 1719485736.32038, + "depends_on": { + "macros": [] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", + "meta": {}, + "name": "postgres__refresh_materialized_view", + "original_file_path": "macros/relations/materialized_view/refresh.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/relations/materialized_view/refresh.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view" + }, "macro.dbt_postgres.postgres__snapshot_get_time": { "arguments": [], - "created_at": 1696458269.5516999, + "created_at": 1719485736.289238, "depends_on": { "macros": [ "macro.dbt.current_timestamp" @@ -7386,14 +9784,12 @@ "patch_path": null, "path": "macros/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time" }, "macro.dbt_postgres.postgres__snapshot_merge_sql": { "arguments": [], - "created_at": 1696458269.5788622, + "created_at": 1719485736.318985, "depends_on": { "macros": [] }, @@ -7410,14 +9806,12 @@ "patch_path": null, "path": "macros/materializations/snapshot_merge.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql" }, "macro.dbt_postgres.postgres__snapshot_string_as_time": { "arguments": [], - "created_at": 1696458269.551509, + "created_at": 1719485736.289119, "depends_on": { "macros": [] }, @@ -7434,14 +9828,12 @@ "patch_path": null, "path": "macros/timestamps.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time" }, "macro.dbt_postgres.postgres__split_part": { "arguments": [], - "created_at": 1696458269.588754, + "created_at": 1719485736.334007, "depends_on": { "macros": [ "macro.dbt.default__split_part", @@ -7461,14 +9853,37 @@ "patch_path": null, "path": "macros/utils/split_part.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres__split_part" }, + "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": { + "arguments": [], + "created_at": 1719485736.3239639, + "depends_on": { + "macros": [ + "macro.dbt_postgres.postgres__get_drop_index_sql", + "macro.dbt_postgres.postgres__get_create_index_sql" + ] + }, + "description": "", + "docs": { + "node_color": null, + "show": true + }, + "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }};\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", + "meta": {}, + "name": "postgres__update_indexes_on_materialized_view", + "original_file_path": "macros/relations/materialized_view/alter.sql", + "package_name": "dbt_postgres", + "patch_path": null, + "path": "macros/relations/materialized_view/alter.sql", + "resource_type": "macro", + "supported_languages": null, + "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view" + }, "macro.dbt_postgres.postgres_escape_comment": { "arguments": [], - "created_at": 1696458269.5741508, + "created_at": 1719485736.3121421, "depends_on": { "macros": [] }, @@ -7485,17 +9900,15 @@ "patch_path": null, "path": "macros/adapters.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres_escape_comment" }, "macro.dbt_postgres.postgres_get_relations": { "arguments": [], - "created_at": 1696458269.555246, + "created_at": 1719485736.2934961, "depends_on": { "macros": [ - "macro.dbt.statement" + "macro.dbt_postgres.postgres__get_relations" ] }, "description": "", @@ -7503,7 +9916,7 @@ "node_color": null, "show": true }, - "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", + "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "meta": {}, "name": "postgres_get_relations", "original_file_path": "macros/relations.sql", @@ -7511,14 +9924,12 @@ "patch_path": null, "path": "macros/relations.sql", "resource_type": "macro", - "root_path": "/Users/julian/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dbt/include/postgres", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_postgres.postgres_get_relations" }, "macro.dbt_utils._bigquery__get_matching_schemata": { "arguments": [], - "created_at": 1696458269.967883, + "created_at": 1719485736.7140338, "depends_on": { "macros": [ "macro.dbt.run_query" @@ -7537,14 +9948,12 @@ "patch_path": null, "path": "macros/sql/get_tables_by_pattern_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata" }, "macro.dbt_utils._is_ephemeral": { "arguments": [], - "created_at": 1696458269.911734, + "created_at": 1719485736.667329, "depends_on": { "macros": [] }, @@ -7561,14 +9970,12 @@ "patch_path": null, "path": "macros/jinja_helpers/_is_ephemeral.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils._is_ephemeral" }, "macro.dbt_utils._is_relation": { "arguments": [], - "created_at": 1696458269.907017, + "created_at": 1719485736.6636631, "depends_on": { "macros": [] }, @@ -7585,14 +9992,12 @@ "patch_path": null, "path": "macros/jinja_helpers/_is_relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils._is_relation" }, "macro.dbt_utils.bigquery__deduplicate": { "arguments": [], - "created_at": 1696458269.95776, + "created_at": 1719485736.703784, "depends_on": { "macros": [] }, @@ -7609,14 +10014,12 @@ "patch_path": null, "path": "macros/sql/deduplicate.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.bigquery__deduplicate" }, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": { "arguments": [], - "created_at": 1696458269.9670799, + "created_at": 1719485736.713356, "depends_on": { "macros": [ "macro.dbt_utils._bigquery__get_matching_schemata", @@ -7636,14 +10039,12 @@ "patch_path": null, "path": "macros/sql/get_tables_by_pattern_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql" }, "macro.dbt_utils.bigquery__haversine_distance": { "arguments": [], - "created_at": 1696458269.9946911, + "created_at": 1719485736.73806, "depends_on": { "macros": [ "macro.dbt_utils.degrees_to_radians" @@ -7662,14 +10063,12 @@ "patch_path": null, "path": "macros/sql/haversine_distance.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.bigquery__haversine_distance" }, "macro.dbt_utils.databricks__get_table_types_sql": { "arguments": [], - "created_at": 1696458269.98752, + "created_at": 1719485736.73151, "depends_on": { "macros": [] }, @@ -7686,14 +10085,12 @@ "patch_path": null, "path": "macros/sql/get_table_types_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.databricks__get_table_types_sql" }, "macro.dbt_utils.date_spine": { "arguments": [], - "created_at": 1696458269.914428, + "created_at": 1719485736.669255, "depends_on": { "macros": [ "macro.dbt_utils.default__date_spine" @@ -7712,14 +10109,12 @@ "patch_path": null, "path": "macros/sql/date_spine.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.date_spine" }, "macro.dbt_utils.deduplicate": { "arguments": [], - "created_at": 1696458269.9561112, + "created_at": 1719485736.7012029, "depends_on": { "macros": [ "macro.dbt_utils.postgres__deduplicate" @@ -7738,14 +10133,12 @@ "patch_path": null, "path": "macros/sql/deduplicate.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.deduplicate" }, "macro.dbt_utils.default__date_spine": { "arguments": [], - "created_at": 1696458269.915016, + "created_at": 1719485736.669651, "depends_on": { "macros": [ "macro.dbt_utils.generate_series", @@ -7766,14 +10159,12 @@ "patch_path": null, "path": "macros/sql/date_spine.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__date_spine" }, "macro.dbt_utils.default__deduplicate": { "arguments": [], - "created_at": 1696458269.956494, + "created_at": 1719485736.701886, "depends_on": { "macros": [] }, @@ -7790,14 +10181,12 @@ "patch_path": null, "path": "macros/sql/deduplicate.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__deduplicate" }, "macro.dbt_utils.default__generate_series": { "arguments": [], - "created_at": 1696458269.925334, + "created_at": 1719485736.678598, "depends_on": { "macros": [ "macro.dbt_utils.get_powers_of_two" @@ -7816,14 +10205,12 @@ "patch_path": null, "path": "macros/sql/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__generate_series" }, "macro.dbt_utils.default__generate_surrogate_key": { "arguments": [], - "created_at": 1696458269.985795, + "created_at": 1719485736.730099, "depends_on": { "macros": [ "macro.dbt.type_string", @@ -7844,14 +10231,12 @@ "patch_path": null, "path": "macros/sql/generate_surrogate_key.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__generate_surrogate_key" }, "macro.dbt_utils.default__get_column_values": { "arguments": [], - "created_at": 1696458269.9728918, + "created_at": 1719485736.717495, "depends_on": { "macros": [ "macro.dbt_utils._is_ephemeral", @@ -7872,14 +10257,12 @@ "patch_path": null, "path": "macros/sql/get_column_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_column_values" }, "macro.dbt_utils.default__get_filtered_columns_in_relation": { "arguments": [], - "created_at": 1696458269.979146, + "created_at": 1719485736.722564, "depends_on": { "macros": [ "macro.dbt_utils._is_relation", @@ -7899,14 +10282,12 @@ "patch_path": null, "path": "macros/sql/get_filtered_columns_in_relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation" }, "macro.dbt_utils.default__get_intervals_between": { "arguments": [], - "created_at": 1696458269.914051, + "created_at": 1719485736.668746, "depends_on": { "macros": [ "macro.dbt.statement", @@ -7926,14 +10307,12 @@ "patch_path": null, "path": "macros/sql/date_spine.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_intervals_between" }, "macro.dbt_utils.default__get_powers_of_two": { "arguments": [], - "created_at": 1696458269.923839, + "created_at": 1719485736.677862, "depends_on": { "macros": [] }, @@ -7950,14 +10329,12 @@ "patch_path": null, "path": "macros/sql/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_powers_of_two" }, "macro.dbt_utils.default__get_query_results_as_dict": { "arguments": [], - "created_at": 1696458269.9838238, + "created_at": 1719485736.727696, "depends_on": { "macros": [ "macro.dbt.statement" @@ -7976,14 +10353,12 @@ "patch_path": null, "path": "macros/sql/get_query_results_as_dict.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_query_results_as_dict" }, "macro.dbt_utils.default__get_relations_by_pattern": { "arguments": [], - "created_at": 1696458269.921258, + "created_at": 1719485736.674046, "depends_on": { "macros": [ "macro.dbt.statement", @@ -8003,14 +10378,12 @@ "patch_path": null, "path": "macros/sql/get_relations_by_pattern.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_relations_by_pattern" }, "macro.dbt_utils.default__get_relations_by_prefix": { "arguments": [], - "created_at": 1696458269.928546, + "created_at": 1719485736.680293, "depends_on": { "macros": [ "macro.dbt.statement", @@ -8030,14 +10403,12 @@ "patch_path": null, "path": "macros/sql/get_relations_by_prefix.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_relations_by_prefix" }, "macro.dbt_utils.default__get_single_value": { "arguments": [], - "created_at": 1696458269.989894, + "created_at": 1719485736.7332969, "depends_on": { "macros": [ "macro.dbt.statement" @@ -8056,14 +10427,12 @@ "patch_path": null, "path": "macros/sql/get_single_value.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_single_value" }, "macro.dbt_utils.default__get_table_types_sql": { "arguments": [], - "created_at": 1696458269.987062, + "created_at": 1719485736.73105, "depends_on": { "macros": [] }, @@ -8080,14 +10449,12 @@ "patch_path": null, "path": "macros/sql/get_table_types_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_table_types_sql" }, "macro.dbt_utils.default__get_tables_by_pattern_sql": { "arguments": [], - "created_at": 1696458269.965835, + "created_at": 1719485736.7122319, "depends_on": { "macros": [ "macro.dbt_utils.get_table_types_sql" @@ -8106,14 +10473,12 @@ "patch_path": null, "path": "macros/sql/get_tables_by_pattern_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql" }, "macro.dbt_utils.default__get_tables_by_prefix_sql": { "arguments": [], - "created_at": 1696458269.930016, + "created_at": 1719485736.681414, "depends_on": { "macros": [ "macro.dbt_utils.get_tables_by_pattern_sql" @@ -8132,14 +10497,12 @@ "patch_path": null, "path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql" }, "macro.dbt_utils.default__get_url_host": { "arguments": [], - "created_at": 1696458269.857218, + "created_at": 1719485736.621399, "depends_on": { "macros": [ "macro.dbt.split_part", @@ -8161,14 +10524,12 @@ "patch_path": null, "path": "macros/web/get_url_host.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_url_host" }, "macro.dbt_utils.default__get_url_parameter": { "arguments": [], - "created_at": 1696458269.860918, + "created_at": 1719485736.624197, "depends_on": { "macros": [ "macro.dbt.split_part" @@ -8187,14 +10548,12 @@ "patch_path": null, "path": "macros/web/get_url_parameter.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_url_parameter" }, "macro.dbt_utils.default__get_url_path": { "arguments": [], - "created_at": 1696458269.859402, + "created_at": 1719485736.6228778, "depends_on": { "macros": [ "macro.dbt.replace", @@ -8219,14 +10578,12 @@ "patch_path": null, "path": "macros/web/get_url_path.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__get_url_path" }, "macro.dbt_utils.default__group_by": { "arguments": [], - "created_at": 1696458269.954616, + "created_at": 1719485736.700402, "depends_on": { "macros": [] }, @@ -8243,14 +10600,12 @@ "patch_path": null, "path": "macros/sql/groupby.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__group_by" }, "macro.dbt_utils.default__haversine_distance": { "arguments": [], - "created_at": 1696458269.993296, + "created_at": 1719485736.736367, "depends_on": { "macros": [] }, @@ -8267,14 +10622,12 @@ "patch_path": null, "path": "macros/sql/haversine_distance.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__haversine_distance" }, "macro.dbt_utils.default__log_info": { "arguments": [], - "created_at": 1696458269.908833, + "created_at": 1719485736.665316, "depends_on": { "macros": [ "macro.dbt_utils.pretty_log_format" @@ -8293,14 +10646,12 @@ "patch_path": null, "path": "macros/jinja_helpers/log_info.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__log_info" }, "macro.dbt_utils.default__nullcheck": { "arguments": [], - "created_at": 1696458269.9623308, + "created_at": 1719485736.7089212, "depends_on": { "macros": [] }, @@ -8317,14 +10668,12 @@ "patch_path": null, "path": "macros/sql/nullcheck.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__nullcheck" }, "macro.dbt_utils.default__nullcheck_table": { "arguments": [], - "created_at": 1696458269.9181361, + "created_at": 1719485736.6715178, "depends_on": { "macros": [ "macro.dbt_utils._is_relation", @@ -8345,14 +10694,12 @@ "patch_path": null, "path": "macros/sql/nullcheck_table.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__nullcheck_table" }, "macro.dbt_utils.default__pivot": { "arguments": [], - "created_at": 1696458269.976574, + "created_at": 1719485736.720366, "depends_on": { "macros": [ "macro.dbt.escape_single_quotes", @@ -8372,14 +10719,12 @@ "patch_path": null, "path": "macros/sql/pivot.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__pivot" }, "macro.dbt_utils.default__pretty_log_format": { "arguments": [], - "created_at": 1696458269.906094, + "created_at": 1719485736.66297, "depends_on": { "macros": [ "macro.dbt_utils.pretty_time" @@ -8398,14 +10743,12 @@ "patch_path": null, "path": "macros/jinja_helpers/pretty_log_format.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__pretty_log_format" }, "macro.dbt_utils.default__pretty_time": { "arguments": [], - "created_at": 1696458269.90797, + "created_at": 1719485736.66434, "depends_on": { "macros": [] }, @@ -8422,14 +10765,12 @@ "patch_path": null, "path": "macros/jinja_helpers/pretty_time.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__pretty_time" }, "macro.dbt_utils.default__safe_add": { "arguments": [], - "created_at": 1696458269.961039, + "created_at": 1719485736.707396, "depends_on": { "macros": [] }, @@ -8446,14 +10787,12 @@ "patch_path": null, "path": "macros/sql/safe_add.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__safe_add" }, "macro.dbt_utils.default__safe_divide": { "arguments": [], - "created_at": 1696458269.941708, + "created_at": 1719485736.689852, "depends_on": { "macros": [] }, @@ -8470,14 +10809,12 @@ "patch_path": null, "path": "macros/sql/safe_divide.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__safe_divide" }, "macro.dbt_utils.default__safe_subtract": { "arguments": [], - "created_at": 1696458269.916886, + "created_at": 1719485736.670645, "depends_on": { "macros": [] }, @@ -8494,14 +10831,12 @@ "patch_path": null, "path": "macros/sql/safe_subtract.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__safe_subtract" }, "macro.dbt_utils.default__star": { "arguments": [], - "created_at": 1696458269.935112, + "created_at": 1719485736.685639, "depends_on": { "macros": [ "macro.dbt_utils._is_relation", @@ -8522,14 +10857,12 @@ "patch_path": null, "path": "macros/sql/star.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__star" }, "macro.dbt_utils.default__surrogate_key": { "arguments": [], - "created_at": 1696458269.959094, + "created_at": 1719485736.7051, "depends_on": { "macros": [] }, @@ -8546,14 +10879,12 @@ "patch_path": null, "path": "macros/sql/surrogate_key.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__surrogate_key" }, "macro.dbt_utils.default__test_accepted_range": { "arguments": [], - "created_at": 1696458269.8764522, + "created_at": 1719485736.6358259, "depends_on": { "macros": [] }, @@ -8570,14 +10901,12 @@ "patch_path": null, "path": "macros/generic_tests/accepted_range.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_accepted_range" }, "macro.dbt_utils.default__test_at_least_one": { "arguments": [], - "created_at": 1696458269.880932, + "created_at": 1719485736.638953, "depends_on": { "macros": [] }, @@ -8594,14 +10923,12 @@ "patch_path": null, "path": "macros/generic_tests/at_least_one.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_at_least_one" }, "macro.dbt_utils.default__test_cardinality_equality": { "arguments": [], - "created_at": 1696458269.884924, + "created_at": 1719485736.646685, "depends_on": { "macros": [ "macro.dbt.except" @@ -8620,14 +10947,12 @@ "patch_path": null, "path": "macros/generic_tests/cardinality_equality.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_cardinality_equality" }, "macro.dbt_utils.default__test_equal_rowcount": { "arguments": [], - "created_at": 1696458269.867796, + "created_at": 1719485736.629295, "depends_on": { "macros": [] }, @@ -8644,14 +10969,12 @@ "patch_path": null, "path": "macros/generic_tests/equal_rowcount.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_equal_rowcount" }, "macro.dbt_utils.default__test_equality": { "arguments": [], - "created_at": 1696458269.8951738, + "created_at": 1719485736.654316, "depends_on": { "macros": [ "macro.dbt_utils._is_relation", @@ -8672,14 +10995,12 @@ "patch_path": null, "path": "macros/generic_tests/equality.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_equality" }, "macro.dbt_utils.default__test_expression_is_true": { "arguments": [], - "created_at": 1696458269.8862998, + "created_at": 1719485736.6476219, "depends_on": { "macros": [ "macro.dbt.should_store_failures" @@ -8698,14 +11019,12 @@ "patch_path": null, "path": "macros/generic_tests/expression_is_true.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_expression_is_true" }, "macro.dbt_utils.default__test_fewer_rows_than": { "arguments": [], - "created_at": 1696458269.864535, + "created_at": 1719485736.626648, "depends_on": { "macros": [] }, @@ -8722,14 +11041,12 @@ "patch_path": null, "path": "macros/generic_tests/fewer_rows_than.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_fewer_rows_than" }, "macro.dbt_utils.default__test_mutually_exclusive_ranges": { "arguments": [], - "created_at": 1696458269.90514, + "created_at": 1719485736.662267, "depends_on": { "macros": [] }, @@ -8746,14 +11063,12 @@ "patch_path": null, "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges" }, "macro.dbt_utils.default__test_not_accepted_values": { "arguments": [], - "created_at": 1696458269.8782852, + "created_at": 1719485736.636965, "depends_on": { "macros": [] }, @@ -8770,14 +11085,12 @@ "patch_path": null, "path": "macros/generic_tests/not_accepted_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_not_accepted_values" }, "macro.dbt_utils.default__test_not_constant": { "arguments": [], - "created_at": 1696458269.874454, + "created_at": 1719485736.634388, "depends_on": { "macros": [] }, @@ -8794,14 +11107,12 @@ "patch_path": null, "path": "macros/generic_tests/not_constant.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_not_constant" }, "macro.dbt_utils.default__test_not_empty_string": { "arguments": [], - "created_at": 1696458269.8967302, + "created_at": 1719485736.655891, "depends_on": { "macros": [] }, @@ -8818,14 +11129,12 @@ "patch_path": null, "path": "macros/generic_tests/not_empty_string.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_not_empty_string" }, "macro.dbt_utils.default__test_not_null_proportion": { "arguments": [], - "created_at": 1696458269.8888562, + "created_at": 1719485736.6493912, "depends_on": { "macros": [] }, @@ -8842,14 +11151,12 @@ "patch_path": null, "path": "macros/generic_tests/not_null_proportion.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_not_null_proportion" }, "macro.dbt_utils.default__test_recency": { "arguments": [], - "created_at": 1696458269.8727272, + "created_at": 1719485736.633423, "depends_on": { "macros": [ "macro.dbt.dateadd", @@ -8870,14 +11177,12 @@ "patch_path": null, "path": "macros/generic_tests/recency.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_recency" }, "macro.dbt_utils.default__test_relationships_where": { "arguments": [], - "created_at": 1696458269.8695161, + "created_at": 1719485736.630768, "depends_on": { "macros": [] }, @@ -8894,14 +11199,12 @@ "patch_path": null, "path": "macros/generic_tests/relationships_where.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_relationships_where" }, "macro.dbt_utils.default__test_sequential_values": { "arguments": [], - "created_at": 1696458269.892125, + "created_at": 1719485736.652041, "depends_on": { "macros": [ "macro.dbt_utils.slugify", @@ -8922,14 +11225,12 @@ "patch_path": null, "path": "macros/generic_tests/sequential_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_sequential_values" }, "macro.dbt_utils.default__test_unique_combination_of_columns": { "arguments": [], - "created_at": 1696458269.883317, + "created_at": 1719485736.643641, "depends_on": { "macros": [] }, @@ -8946,14 +11247,12 @@ "patch_path": null, "path": "macros/generic_tests/unique_combination_of_columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns" }, "macro.dbt_utils.default__union_relations": { "arguments": [], - "created_at": 1696458269.953401, + "created_at": 1719485736.6993861, "depends_on": { "macros": [ "macro.dbt_utils._is_relation", @@ -8975,14 +11274,12 @@ "patch_path": null, "path": "macros/sql/union.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__union_relations" }, "macro.dbt_utils.default__unpivot": { "arguments": [], - "created_at": 1696458269.940675, + "created_at": 1719485736.689354, "depends_on": { "macros": [ "macro.dbt_utils._is_relation", @@ -9004,14 +11301,12 @@ "patch_path": null, "path": "macros/sql/unpivot.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__unpivot" }, "macro.dbt_utils.default__width_bucket": { "arguments": [], - "created_at": 1696458269.981664, + "created_at": 1719485736.7257888, "depends_on": { "macros": [ "macro.dbt.safe_cast", @@ -9031,14 +11326,12 @@ "patch_path": null, "path": "macros/sql/width_bucket.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.default__width_bucket" }, "macro.dbt_utils.degrees_to_radians": { "arguments": [], - "created_at": 1696458269.991828, + "created_at": 1719485736.735244, "depends_on": { "macros": [] }, @@ -9055,14 +11348,12 @@ "patch_path": null, "path": "macros/sql/haversine_distance.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.degrees_to_radians" }, "macro.dbt_utils.generate_series": { "arguments": [], - "created_at": 1696458269.924184, + "created_at": 1719485736.678059, "depends_on": { "macros": [ "macro.dbt_utils.default__generate_series" @@ -9081,14 +11372,12 @@ "patch_path": null, "path": "macros/sql/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.generate_series" }, "macro.dbt_utils.generate_surrogate_key": { "arguments": [], - "created_at": 1696458269.984725, + "created_at": 1719485736.7287118, "depends_on": { "macros": [ "macro.dbt_utils.default__generate_surrogate_key" @@ -9107,14 +11396,12 @@ "patch_path": null, "path": "macros/sql/generate_surrogate_key.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.generate_surrogate_key" }, "macro.dbt_utils.get_column_values": { "arguments": [], - "created_at": 1696458269.9700558, + "created_at": 1719485736.7158039, "depends_on": { "macros": [ "macro.dbt_utils.default__get_column_values" @@ -9133,14 +11420,12 @@ "patch_path": null, "path": "macros/sql/get_column_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_column_values" }, "macro.dbt_utils.get_filtered_columns_in_relation": { "arguments": [], - "created_at": 1696458269.977875, + "created_at": 1719485736.7211049, "depends_on": { "macros": [ "macro.dbt_utils.default__get_filtered_columns_in_relation" @@ -9159,14 +11444,12 @@ "patch_path": null, "path": "macros/sql/get_filtered_columns_in_relation.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation" }, "macro.dbt_utils.get_intervals_between": { "arguments": [], - "created_at": 1696458269.913064, + "created_at": 1719485736.668108, "depends_on": { "macros": [ "macro.dbt_utils.default__get_intervals_between" @@ -9185,14 +11468,12 @@ "patch_path": null, "path": "macros/sql/date_spine.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_intervals_between" }, "macro.dbt_utils.get_powers_of_two": { "arguments": [], - "created_at": 1696458269.923075, + "created_at": 1719485736.677409, "depends_on": { "macros": [ "macro.dbt_utils.default__get_powers_of_two" @@ -9211,14 +11492,12 @@ "patch_path": null, "path": "macros/sql/generate_series.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_powers_of_two" }, "macro.dbt_utils.get_query_results_as_dict": { "arguments": [], - "created_at": 1696458269.982841, + "created_at": 1719485736.726866, "depends_on": { "macros": [ "macro.dbt_utils.default__get_query_results_as_dict" @@ -9237,14 +11516,12 @@ "patch_path": null, "path": "macros/sql/get_query_results_as_dict.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_query_results_as_dict" }, "macro.dbt_utils.get_relations_by_pattern": { "arguments": [], - "created_at": 1696458269.9195552, + "created_at": 1719485736.6725519, "depends_on": { "macros": [ "macro.dbt_utils.default__get_relations_by_pattern" @@ -9263,14 +11540,12 @@ "patch_path": null, "path": "macros/sql/get_relations_by_pattern.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_relations_by_pattern" }, "macro.dbt_utils.get_relations_by_prefix": { "arguments": [], - "created_at": 1696458269.926965, + "created_at": 1719485736.67938, "depends_on": { "macros": [ "macro.dbt_utils.default__get_relations_by_prefix" @@ -9289,14 +11564,12 @@ "patch_path": null, "path": "macros/sql/get_relations_by_prefix.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_relations_by_prefix" }, "macro.dbt_utils.get_single_value": { "arguments": [], - "created_at": 1696458269.9885209, + "created_at": 1719485736.732079, "depends_on": { "macros": [ "macro.dbt_utils.default__get_single_value" @@ -9315,14 +11588,12 @@ "patch_path": null, "path": "macros/sql/get_single_value.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_single_value" }, "macro.dbt_utils.get_table_types_sql": { "arguments": [], - "created_at": 1696458269.986836, + "created_at": 1719485736.730877, "depends_on": { "macros": [ "macro.dbt_utils.postgres__get_table_types_sql" @@ -9341,14 +11612,12 @@ "patch_path": null, "path": "macros/sql/get_table_types_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_table_types_sql" }, "macro.dbt_utils.get_tables_by_pattern_sql": { "arguments": [], - "created_at": 1696458269.9652421, + "created_at": 1719485736.7118368, "depends_on": { "macros": [ "macro.dbt_utils.default__get_tables_by_pattern_sql" @@ -9367,14 +11636,12 @@ "patch_path": null, "path": "macros/sql/get_tables_by_pattern_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql" }, "macro.dbt_utils.get_tables_by_prefix_sql": { "arguments": [], - "created_at": 1696458269.929534, + "created_at": 1719485736.680733, "depends_on": { "macros": [ "macro.dbt_utils.default__get_tables_by_prefix_sql" @@ -9393,14 +11660,12 @@ "patch_path": null, "path": "macros/sql/get_tables_by_prefix_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql" }, "macro.dbt_utils.get_url_host": { "arguments": [], - "created_at": 1696458269.856265, + "created_at": 1719485736.6209002, "depends_on": { "macros": [ "macro.dbt_utils.default__get_url_host" @@ -9419,14 +11684,12 @@ "patch_path": null, "path": "macros/web/get_url_host.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_url_host" }, "macro.dbt_utils.get_url_parameter": { "arguments": [], - "created_at": 1696458269.860372, + "created_at": 1719485736.6233978, "depends_on": { "macros": [ "macro.dbt_utils.default__get_url_parameter" @@ -9445,14 +11708,12 @@ "patch_path": null, "path": "macros/web/get_url_parameter.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_url_parameter" }, "macro.dbt_utils.get_url_path": { "arguments": [], - "created_at": 1696458269.858241, + "created_at": 1719485736.62192, "depends_on": { "macros": [ "macro.dbt_utils.default__get_url_path" @@ -9471,14 +11732,12 @@ "patch_path": null, "path": "macros/web/get_url_path.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.get_url_path" }, "macro.dbt_utils.group_by": { "arguments": [], - "created_at": 1696458269.954188, + "created_at": 1719485736.700075, "depends_on": { "macros": [ "macro.dbt_utils.default__group_by" @@ -9497,14 +11756,12 @@ "patch_path": null, "path": "macros/sql/groupby.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.group_by" }, "macro.dbt_utils.haversine_distance": { "arguments": [], - "created_at": 1696458269.992314, + "created_at": 1719485736.7356942, "depends_on": { "macros": [ "macro.dbt_utils.default__haversine_distance" @@ -9523,14 +11780,12 @@ "patch_path": null, "path": "macros/sql/haversine_distance.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.haversine_distance" }, "macro.dbt_utils.log_info": { "arguments": [], - "created_at": 1696458269.90854, + "created_at": 1719485736.664978, "depends_on": { "macros": [ "macro.dbt_utils.default__log_info" @@ -9549,14 +11804,12 @@ "patch_path": null, "path": "macros/jinja_helpers/log_info.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.log_info" }, "macro.dbt_utils.nullcheck": { "arguments": [], - "created_at": 1696458269.961787, + "created_at": 1719485736.708089, "depends_on": { "macros": [ "macro.dbt_utils.default__nullcheck" @@ -9575,14 +11828,12 @@ "patch_path": null, "path": "macros/sql/nullcheck.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.nullcheck" }, "macro.dbt_utils.nullcheck_table": { "arguments": [], - "created_at": 1696458269.917547, + "created_at": 1719485736.671076, "depends_on": { "macros": [ "macro.dbt_utils.default__nullcheck_table" @@ -9601,14 +11852,12 @@ "patch_path": null, "path": "macros/sql/nullcheck_table.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.nullcheck_table" }, "macro.dbt_utils.pivot": { "arguments": [], - "created_at": 1696458269.975067, + "created_at": 1719485736.719448, "depends_on": { "macros": [ "macro.dbt_utils.default__pivot" @@ -9627,14 +11876,12 @@ "patch_path": null, "path": "macros/sql/pivot.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.pivot" }, "macro.dbt_utils.postgres__deduplicate": { "arguments": [], - "created_at": 1696458269.957185, + "created_at": 1719485736.703091, "depends_on": { "macros": [] }, @@ -9651,14 +11898,12 @@ "patch_path": null, "path": "macros/sql/deduplicate.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.postgres__deduplicate" }, "macro.dbt_utils.postgres__get_table_types_sql": { "arguments": [], - "created_at": 1696458269.9872892, + "created_at": 1719485736.731321, "depends_on": { "macros": [] }, @@ -9675,14 +11920,12 @@ "patch_path": null, "path": "macros/sql/get_table_types_sql.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.postgres__get_table_types_sql" }, "macro.dbt_utils.pretty_log_format": { "arguments": [], - "created_at": 1696458269.9058151, + "created_at": 1719485736.6625931, "depends_on": { "macros": [ "macro.dbt_utils.default__pretty_log_format" @@ -9701,14 +11944,12 @@ "patch_path": null, "path": "macros/jinja_helpers/pretty_log_format.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.pretty_log_format" }, "macro.dbt_utils.pretty_time": { "arguments": [], - "created_at": 1696458269.9076412, + "created_at": 1719485736.664063, "depends_on": { "macros": [ "macro.dbt_utils.default__pretty_time" @@ -9727,14 +11968,12 @@ "patch_path": null, "path": "macros/jinja_helpers/pretty_time.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.pretty_time" }, "macro.dbt_utils.redshift__deduplicate": { "arguments": [], - "created_at": 1696458269.9568481, + "created_at": 1719485736.7025979, "depends_on": { "macros": [ "macro.dbt_utils.default__deduplicate" @@ -9753,14 +11992,12 @@ "patch_path": null, "path": "macros/sql/deduplicate.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.redshift__deduplicate" }, "macro.dbt_utils.safe_add": { "arguments": [], - "created_at": 1696458269.95998, + "created_at": 1719485736.7061272, "depends_on": { "macros": [ "macro.dbt_utils.default__safe_add" @@ -9779,14 +12016,12 @@ "patch_path": null, "path": "macros/sql/safe_add.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.safe_add" }, "macro.dbt_utils.safe_divide": { "arguments": [], - "created_at": 1696458269.9414778, + "created_at": 1719485736.689705, "depends_on": { "macros": [ "macro.dbt_utils.default__safe_divide" @@ -9805,14 +12040,12 @@ "patch_path": null, "path": "macros/sql/safe_divide.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.safe_divide" }, "macro.dbt_utils.safe_subtract": { "arguments": [], - "created_at": 1696458269.915779, + "created_at": 1719485736.670065, "depends_on": { "macros": [ "macro.dbt_utils.default__safe_subtract" @@ -9831,14 +12064,12 @@ "patch_path": null, "path": "macros/sql/safe_subtract.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.safe_subtract" }, "macro.dbt_utils.slugify": { "arguments": [], - "created_at": 1696458269.9100301, + "created_at": 1719485736.6662788, "depends_on": { "macros": [] }, @@ -9855,14 +12086,12 @@ "patch_path": null, "path": "macros/jinja_helpers/slugify.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.slugify" }, "macro.dbt_utils.snowflake__deduplicate": { "arguments": [], - "created_at": 1696458269.95747, + "created_at": 1719485736.703385, "depends_on": { "macros": [] }, @@ -9879,14 +12108,12 @@ "patch_path": null, "path": "macros/sql/deduplicate.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.snowflake__deduplicate" }, "macro.dbt_utils.snowflake__width_bucket": { "arguments": [], - "created_at": 1696458269.9819782, + "created_at": 1719485736.72608, "depends_on": { "macros": [] }, @@ -9903,14 +12130,12 @@ "patch_path": null, "path": "macros/sql/width_bucket.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.snowflake__width_bucket" }, "macro.dbt_utils.star": { "arguments": [], - "created_at": 1696458269.9325912, + "created_at": 1719485736.6838112, "depends_on": { "macros": [ "macro.dbt_utils.default__star" @@ -9929,14 +12154,12 @@ "patch_path": null, "path": "macros/sql/star.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.star" }, "macro.dbt_utils.surrogate_key": { "arguments": [], - "created_at": 1696458269.9586718, + "created_at": 1719485736.704803, "depends_on": { "macros": [ "macro.dbt_utils.default__surrogate_key" @@ -9955,14 +12178,12 @@ "patch_path": null, "path": "macros/sql/surrogate_key.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.surrogate_key" }, "macro.dbt_utils.test_accepted_range": { "arguments": [], - "created_at": 1696458269.875644, + "created_at": 1719485736.6351202, "depends_on": { "macros": [ "macro.dbt_utils.default__test_accepted_range" @@ -9981,14 +12202,12 @@ "patch_path": null, "path": "macros/generic_tests/accepted_range.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_accepted_range" }, "macro.dbt_utils.test_at_least_one": { "arguments": [], - "created_at": 1696458269.8795462, + "created_at": 1719485736.637673, "depends_on": { "macros": [ "macro.dbt_utils.default__test_at_least_one" @@ -10007,14 +12226,12 @@ "patch_path": null, "path": "macros/generic_tests/at_least_one.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_at_least_one" }, "macro.dbt_utils.test_cardinality_equality": { "arguments": [], - "created_at": 1696458269.884375, + "created_at": 1719485736.64627, "depends_on": { "macros": [ "macro.dbt_utils.default__test_cardinality_equality" @@ -10033,14 +12250,12 @@ "patch_path": null, "path": "macros/generic_tests/cardinality_equality.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_cardinality_equality" }, "macro.dbt_utils.test_equal_rowcount": { "arguments": [], - "created_at": 1696458269.866045, + "created_at": 1719485736.6276648, "depends_on": { "macros": [ "macro.dbt_utils.default__test_equal_rowcount" @@ -10059,14 +12274,12 @@ "patch_path": null, "path": "macros/generic_tests/equal_rowcount.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_equal_rowcount" }, "macro.dbt_utils.test_equality": { "arguments": [], - "created_at": 1696458269.893547, + "created_at": 1719485736.6529899, "depends_on": { "macros": [ "macro.dbt_utils.default__test_equality" @@ -10085,14 +12298,12 @@ "patch_path": null, "path": "macros/generic_tests/equality.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_equality" }, "macro.dbt_utils.test_expression_is_true": { "arguments": [], - "created_at": 1696458269.885707, + "created_at": 1719485736.64721, "depends_on": { "macros": [ "macro.dbt_utils.default__test_expression_is_true" @@ -10111,14 +12322,12 @@ "patch_path": null, "path": "macros/generic_tests/expression_is_true.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_expression_is_true" }, "macro.dbt_utils.test_fewer_rows_than": { "arguments": [], - "created_at": 1696458269.862845, + "created_at": 1719485736.625401, "depends_on": { "macros": [ "macro.dbt_utils.default__test_fewer_rows_than" @@ -10137,14 +12346,12 @@ "patch_path": null, "path": "macros/generic_tests/fewer_rows_than.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_fewer_rows_than" }, "macro.dbt_utils.test_mutually_exclusive_ranges": { "arguments": [], - "created_at": 1696458269.902503, + "created_at": 1719485736.6603332, "depends_on": { "macros": [ "macro.dbt_utils.default__test_mutually_exclusive_ranges" @@ -10163,14 +12370,12 @@ "patch_path": null, "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges" }, "macro.dbt_utils.test_not_accepted_values": { "arguments": [], - "created_at": 1696458269.877504, + "created_at": 1719485736.6365619, "depends_on": { "macros": [ "macro.dbt_utils.default__test_not_accepted_values" @@ -10189,14 +12394,12 @@ "patch_path": null, "path": "macros/generic_tests/not_accepted_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_not_accepted_values" }, "macro.dbt_utils.test_not_constant": { "arguments": [], - "created_at": 1696458269.873664, + "created_at": 1719485736.6339169, "depends_on": { "macros": [ "macro.dbt_utils.default__test_not_constant" @@ -10215,14 +12418,12 @@ "patch_path": null, "path": "macros/generic_tests/not_constant.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_not_constant" }, "macro.dbt_utils.test_not_empty_string": { "arguments": [], - "created_at": 1696458269.896234, + "created_at": 1719485736.655252, "depends_on": { "macros": [ "macro.dbt_utils.default__test_not_empty_string" @@ -10241,14 +12442,12 @@ "patch_path": null, "path": "macros/generic_tests/not_empty_string.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_not_empty_string" }, "macro.dbt_utils.test_not_null_proportion": { "arguments": [], - "created_at": 1696458269.88746, + "created_at": 1719485736.64849, "depends_on": { "macros": [ "macro.dbt_utils.default__test_not_null_proportion" @@ -10267,14 +12466,12 @@ "patch_path": null, "path": "macros/generic_tests/not_null_proportion.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_not_null_proportion" }, "macro.dbt_utils.test_recency": { "arguments": [], - "created_at": 1696458269.8711538, + "created_at": 1719485736.632009, "depends_on": { "macros": [ "macro.dbt_utils.default__test_recency" @@ -10293,14 +12490,12 @@ "patch_path": null, "path": "macros/generic_tests/recency.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_recency" }, "macro.dbt_utils.test_relationships_where": { "arguments": [], - "created_at": 1696458269.868972, + "created_at": 1719485736.6303911, "depends_on": { "macros": [ "macro.dbt_utils.default__test_relationships_where" @@ -10319,14 +12514,12 @@ "patch_path": null, "path": "macros/generic_tests/relationships_where.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_relationships_where" }, "macro.dbt_utils.test_sequential_values": { "arguments": [], - "created_at": 1696458269.890569, + "created_at": 1719485736.650635, "depends_on": { "macros": [ "macro.dbt_utils.default__test_sequential_values" @@ -10345,14 +12538,12 @@ "patch_path": null, "path": "macros/generic_tests/sequential_values.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_sequential_values" }, "macro.dbt_utils.test_unique_combination_of_columns": { "arguments": [], - "created_at": 1696458269.882238, + "created_at": 1719485736.642268, "depends_on": { "macros": [ "macro.dbt_utils.default__test_unique_combination_of_columns" @@ -10371,14 +12562,12 @@ "patch_path": null, "path": "macros/generic_tests/unique_combination_of_columns.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.test_unique_combination_of_columns" }, "macro.dbt_utils.union_relations": { "arguments": [], - "created_at": 1696458269.9474702, + "created_at": 1719485736.6939468, "depends_on": { "macros": [ "macro.dbt_utils.default__union_relations" @@ -10397,14 +12586,12 @@ "patch_path": null, "path": "macros/sql/union.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.union_relations" }, "macro.dbt_utils.unpivot": { "arguments": [], - "created_at": 1696458269.937675, + "created_at": 1719485736.68751, "depends_on": { "macros": [ "macro.dbt_utils.default__unpivot" @@ -10423,14 +12610,12 @@ "patch_path": null, "path": "macros/sql/unpivot.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.unpivot" }, "macro.dbt_utils.width_bucket": { "arguments": [], - "created_at": 1696458269.980886, + "created_at": 1719485736.724451, "depends_on": { "macros": [ "macro.dbt_utils.default__width_bucket" @@ -10449,14 +12634,12 @@ "patch_path": null, "path": "macros/sql/width_bucket.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop/dbt_packages/dbt_utils", "supported_languages": null, - "tags": [], "unique_id": "macro.dbt_utils.width_bucket" }, - "macro.jaffle_shop.drop_table": { + "macro.jaffle_shop.drop_table_by_name": { "arguments": [], - "created_at": 1696458269.549238, + "created_at": 1719485736.288547, "depends_on": { "macros": [ "macro.dbt.run_query" @@ -10467,42 +12650,43 @@ "node_color": null, "show": true }, - "macro_sql": "{%- macro drop_table(table_name) -%}\n {%- set drop_query -%}\n DROP TABLE IF EXISTS {{ target.schema }}.{{ table_name }} CASCADE\n {%- endset -%}\n {% do run_query(drop_query) %}\n{%- endmacro -%}", + "macro_sql": "{%- macro drop_table_by_name(table_name) -%}\n {%- set drop_query -%}\n DROP TABLE IF EXISTS {{ target.schema }}.{{ table_name }} CASCADE\n {%- endset -%}\n {% do run_query(drop_query) %}\n{%- endmacro -%}", "meta": {}, - "name": "drop_table", + "name": "drop_table_by_name", "original_file_path": "macros/drop_table.sql", "package_name": "jaffle_shop", "patch_path": null, "path": "macros/drop_table.sql", "resource_type": "macro", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "supported_languages": null, - "tags": [], - "unique_id": "macro.jaffle_shop.drop_table" + "unique_id": "macro.jaffle_shop.drop_table_by_name" } }, "metadata": { "adapter_type": "postgres", - "dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", - "dbt_version": "1.3.1", + "dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", + "dbt_version": "1.8.0", "env": {}, - "generated_at": "2023-10-04T22:24:29.500301Z", - "invocation_id": "fc9520c6-dfc1-4650-9483-1fd3751dfe42", + "generated_at": "2024-06-27T10:55:36.063508Z", + "invocation_id": "31cdaee6-885b-4bdf-b794-4065f9530edb", "project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", + "project_name": "jaffle_shop", "send_anonymous_usage_stats": true, - "user_id": "43f90c72-db98-41b6-8fce-1337e4d59f98" + "user_id": "f5b1bc43-6cc6-4fd4-849c-18b31ffa1e2d" }, "metrics": {}, "nodes": { "model.jaffle_shop.customers": { + "access": "protected", "alias": "customers", "build_path": null, "checksum": { - "checksum": "455b90a31f418ae776213ad9932c7cb72d19a5269a8c722bd9f4e44957313ce8", + "checksum": "60bd72e33da43fff3a7e7609135c17cd4468bd22afec0735dd36018bfb5af30a", "name": "sha256" }, "columns": { "customer_id": { + "constraints": [], "data_type": null, "description": "This is a unique identifier for a customer", "meta": {}, @@ -10511,6 +12695,7 @@ "tags": [] }, "first_name": { + "constraints": [], "data_type": null, "description": "Customer's first name. PII.", "meta": {}, @@ -10519,6 +12704,7 @@ "tags": [] }, "first_order": { + "constraints": [], "data_type": null, "description": "Date (UTC) of a customer's first order", "meta": {}, @@ -10527,6 +12713,7 @@ "tags": [] }, "last_name": { + "constraints": [], "data_type": null, "description": "Customer's last name. PII.", "meta": {}, @@ -10535,6 +12722,7 @@ "tags": [] }, "most_recent_order": { + "constraints": [], "data_type": null, "description": "Date (UTC) of a customer's most recent order", "meta": {}, @@ -10543,6 +12731,7 @@ "tags": [] }, "number_of_orders": { + "constraints": [], "data_type": null, "description": "Count of the number of orders a customer has placed", "meta": {}, @@ -10551,6 +12740,7 @@ "tags": [] }, "total_order_amount": { + "constraints": [], "data_type": null, "description": "Total value (AUD) of a customer's orders", "meta": {}, @@ -10561,8 +12751,13 @@ }, "compiled_path": null, "config": { + "access": "protected", "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, "docs": { "node_color": null, @@ -10571,9 +12766,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "table", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -10584,9 +12781,14 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.331094, + "constraints": [], + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.5078778, "database": "postgres", - "deferred": false, "depends_on": { "macros": [], "nodes": [ @@ -10595,6 +12797,7 @@ "model.jaffle_shop.stg_payments" ] }, + "deprecation_date": null, "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "docs": { "node_color": null, @@ -10604,7 +12807,9 @@ "jaffle_shop", "customers" ], + "group": null, "language": "sql", + "latest_version": null, "meta": {}, "metrics": [], "name": "customers", @@ -10614,35 +12819,44 @@ "path": "customers.sql", "raw_code": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\ncustomer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order,\n max(order_date) as most_recent_order,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n),\n\ncustomer_payments as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders on\n payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order,\n customer_orders.most_recent_order,\n customer_orders.number_of_orders,\n customer_payments.total_amount as customer_lifetime_value\n\n from customers\n\n left join customer_orders\n on customers.customer_id = customer_orders.customer_id\n\n left join customer_payments\n on customers.customer_id = customer_payments.customer_id\n\n)\n\nselect * from final", "refs": [ - [ - "stg_customers" - ], - [ - "stg_orders" - ], - [ - "stg_payments" - ] + { + "name": "stg_customers", + "package": null, + "version": null + }, + { + "name": "stg_orders", + "package": null, + "version": null + }, + { + "name": "stg_payments", + "package": null, + "version": null + } ], + "relation_name": "\"postgres\".\"public\".\"customers\"", "resource_type": "model", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", "sources": [], "tags": [], "unique_id": "model.jaffle_shop.customers", "unrendered_config": { "materialized": "table" - } + }, + "version": null }, "model.jaffle_shop.orders": { + "access": "protected", "alias": "orders", "build_path": null, "checksum": { - "checksum": "53950235d8e29690d259e95ee49bda6a5b7911b44c739b738a646dc6014bcfcd", + "checksum": "27f8c79aad1cfd8411ab9c3d2ce8da1d787f7f05c58bbee1d247510dc426be0f", "name": "sha256" }, "columns": { "amount": { + "constraints": [], "data_type": null, "description": "Total amount (AUD) of the order", "meta": {}, @@ -10651,6 +12865,7 @@ "tags": [] }, "bank_transfer_amount": { + "constraints": [], "data_type": null, "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, @@ -10659,6 +12874,7 @@ "tags": [] }, "coupon_amount": { + "constraints": [], "data_type": null, "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, @@ -10667,6 +12883,7 @@ "tags": [] }, "credit_card_amount": { + "constraints": [], "data_type": null, "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, @@ -10675,6 +12892,7 @@ "tags": [] }, "customer_id": { + "constraints": [], "data_type": null, "description": "Foreign key to the customers table", "meta": {}, @@ -10683,6 +12901,7 @@ "tags": [] }, "gift_card_amount": { + "constraints": [], "data_type": null, "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, @@ -10691,6 +12910,7 @@ "tags": [] }, "order_date": { + "constraints": [], "data_type": null, "description": "Date (UTC) that the order was placed", "meta": {}, @@ -10699,6 +12919,7 @@ "tags": [] }, "order_id": { + "constraints": [], "data_type": null, "description": "This is a unique identifier for an order", "meta": {}, @@ -10707,6 +12928,7 @@ "tags": [] }, "status": { + "constraints": [], "data_type": null, "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, @@ -10717,8 +12939,13 @@ }, "compiled_path": null, "config": { + "access": "protected", "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, "docs": { "node_color": null, @@ -10727,9 +12954,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "table", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -10740,9 +12969,14 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.3345122, + "constraints": [], + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.511349, "database": "postgres", - "deferred": false, "depends_on": { "macros": [], "nodes": [ @@ -10750,6 +12984,7 @@ "model.jaffle_shop.stg_payments" ] }, + "deprecation_date": null, "description": "This table has basic information about orders, as well as some derived facts based on payments", "docs": { "node_color": null, @@ -10759,7 +12994,9 @@ "jaffle_shop", "orders" ], + "group": null, "language": "sql", + "latest_version": null, "meta": {}, "metrics": [], "name": "orders", @@ -10769,32 +13006,39 @@ "path": "orders.sql", "raw_code": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\npayments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(case when payment_method = '{{ payment_method }}' then amount else 0 end) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final", "refs": [ - [ - "stg_orders" - ], - [ - "stg_payments" - ] + { + "name": "stg_orders", + "package": null, + "version": null + }, + { + "name": "stg_payments", + "package": null, + "version": null + } ], + "relation_name": "\"postgres\".\"public\".\"orders\"", "resource_type": "model", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", "sources": [], "tags": [], "unique_id": "model.jaffle_shop.orders", "unrendered_config": { "materialized": "table" - } + }, + "version": null }, "model.jaffle_shop.stg_customers": { + "access": "protected", "alias": "stg_customers", "build_path": null, "checksum": { - "checksum": "6f18a29204dad1de6dbb0c288144c4990742e0a1e065c3b2a67b5f98334c22ba", + "checksum": "80e3223cd54387e11fa16cd0f4cbe15f8ff74dcd9900b93856b9e39416178c9d", "name": "sha256" }, "columns": { "customer_id": { + "constraints": [], "data_type": null, "description": "", "meta": {}, @@ -10805,8 +13049,13 @@ }, "compiled_path": null, "config": { + "access": "protected", "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, "docs": { "node_color": null, @@ -10815,9 +13064,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "view", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -10828,15 +13079,21 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.372876, + "constraints": [], + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.629529, "database": "postgres", - "deferred": false, "depends_on": { "macros": [], "nodes": [ "seed.jaffle_shop.raw_customers" ] }, + "deprecation_date": null, "description": "", "docs": { "node_color": null, @@ -10847,7 +13104,9 @@ "staging", "stg_customers" ], + "group": null, "language": "sql", + "latest_version": null, "meta": {}, "metrics": [], "name": "stg_customers", @@ -10857,29 +13116,34 @@ "path": "staging/stg_customers.sql", "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_customers') }}\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name\n\n from source\n\n)\n\nselect * from renamed", "refs": [ - [ - "raw_customers" - ] + { + "name": "raw_customers", + "package": null, + "version": null + } ], + "relation_name": "\"postgres\".\"public\".\"stg_customers\"", "resource_type": "model", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", "sources": [], "tags": [], "unique_id": "model.jaffle_shop.stg_customers", "unrendered_config": { "materialized": "view" - } + }, + "version": null }, "model.jaffle_shop.stg_orders": { + "access": "protected", "alias": "stg_orders", "build_path": null, "checksum": { - "checksum": "afffa9cbc57e5fd2cf5898ebf571d444a62c9d6d7929d8133d30567fb9a2ce97", + "checksum": "f4f881cb09d2c4162200fc331d7401df6d1abd4fed492554a7db70dede347108", "name": "sha256" }, "columns": { "order_id": { + "constraints": [], "data_type": null, "description": "", "meta": {}, @@ -10888,6 +13152,7 @@ "tags": [] }, "status": { + "constraints": [], "data_type": null, "description": "", "meta": {}, @@ -10898,8 +13163,13 @@ }, "compiled_path": null, "config": { + "access": "protected", "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, "docs": { "node_color": null, @@ -10908,9 +13178,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "view", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -10921,15 +13193,21 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.374181, + "constraints": [], + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.630356, "database": "postgres", - "deferred": false, "depends_on": { "macros": [], "nodes": [ "seed.jaffle_shop.raw_orders" ] }, + "deprecation_date": null, "description": "", "docs": { "node_color": null, @@ -10940,7 +13218,9 @@ "staging", "stg_orders" ], + "group": null, "language": "sql", + "latest_version": null, "meta": {}, "metrics": [], "name": "stg_orders", @@ -10950,29 +13230,34 @@ "path": "staging/stg_orders.sql", "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_orders') }}\n\n),\n\nrenamed as (\n\n select\n id as order_id,\n user_id as customer_id,\n order_date,\n status\n\n from source\n\n)\n\nselect * from renamed", "refs": [ - [ - "raw_orders" - ] + { + "name": "raw_orders", + "package": null, + "version": null + } ], + "relation_name": "\"postgres\".\"public\".\"stg_orders\"", "resource_type": "model", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", "sources": [], "tags": [], "unique_id": "model.jaffle_shop.stg_orders", "unrendered_config": { "materialized": "view" - } + }, + "version": null }, "model.jaffle_shop.stg_payments": { + "access": "protected", "alias": "stg_payments", "build_path": null, "checksum": { - "checksum": "a626f1ad5883c5391dc123be01f81491be5f496654d226d876651a0b8c036362", + "checksum": "30f346f66ef7bca4c8865a471086303720c3daab58870c805b6f45e92d19fd65", "name": "sha256" }, "columns": { "payment_id": { + "constraints": [], "data_type": null, "description": "", "meta": {}, @@ -10981,6 +13266,7 @@ "tags": [] }, "payment_method": { + "constraints": [], "data_type": null, "description": "", "meta": {}, @@ -10991,8 +13277,13 @@ }, "compiled_path": null, "config": { + "access": "protected", "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, "docs": { "node_color": null, @@ -11001,9 +13292,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "view", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -11014,15 +13307,21 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.375178, + "constraints": [], + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6316102, "database": "postgres", - "deferred": false, "depends_on": { "macros": [], "nodes": [ "seed.jaffle_shop.raw_payments" ] }, + "deprecation_date": null, "description": "", "docs": { "node_color": null, @@ -11033,7 +13332,9 @@ "staging", "stg_payments" ], + "group": null, "language": "sql", + "latest_version": null, "meta": {}, "metrics": [], "name": "stg_payments", @@ -11043,33 +13344,40 @@ "path": "staging/stg_payments.sql", "raw_code": "with source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref('raw_payments') }}\n\n),\n\nrenamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n amount / 100 as amount\n\n from source\n\n)\n\nselect * from renamed", "refs": [ - [ - "raw_payments" - ] + { + "name": "raw_payments", + "package": null, + "version": null + } ], + "relation_name": "\"postgres\".\"public\".\"stg_payments\"", "resource_type": "model", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", "sources": [], "tags": [], "unique_id": "model.jaffle_shop.stg_payments", "unrendered_config": { "materialized": "view" - } + }, + "version": null }, "seed.jaffle_shop.raw_customers": { "alias": "raw_customers", "build_path": null, "checksum": { - "checksum": "24579b4b26098d43265376f3c50be8b10faf8e8fd95f5508074f10f76a12671d", + "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63", "name": "sha256" }, "columns": {}, - "compiled_path": null, "config": { "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, + "delimiter": ",", "docs": { "node_color": null, "show": true @@ -11077,9 +13385,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "seed", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -11091,12 +13401,10 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.302308, + "created_at": 1719485737.409044, "database": "postgres", - "deferred": false, "depends_on": { - "macros": [], - "nodes": [] + "macros": [] }, "description": "", "docs": { @@ -11107,20 +13415,18 @@ "jaffle_shop", "raw_customers" ], - "language": "sql", + "group": null, "meta": {}, - "metrics": [], "name": "raw_customers", "original_file_path": "seeds/raw_customers.csv", "package_name": "jaffle_shop", "patch_path": null, "path": "raw_customers.csv", "raw_code": "", - "refs": [], + "relation_name": "\"postgres\".\"public\".\"raw_customers\"", "resource_type": "seed", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", + "root_path": "/Users/tati/Code/cosmos-clean/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", - "sources": [], "tags": [], "unique_id": "seed.jaffle_shop.raw_customers", "unrendered_config": {} @@ -11129,15 +13435,19 @@ "alias": "raw_orders", "build_path": null, "checksum": { - "checksum": "c5f309d84ba32f2a39235c59f2d4f6c855aedba7e215847c957f1a5f2fa80d3e", + "checksum": "6228dde8e17b9621f35c13e272ec67d3ff55b55499433f47d303adf2be72c17f", "name": "sha256" }, "columns": {}, - "compiled_path": null, "config": { "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, + "delimiter": ",", "docs": { "node_color": null, "show": true @@ -11145,9 +13455,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "seed", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -11159,12 +13471,10 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.3040352, + "created_at": 1719485737.411613, "database": "postgres", - "deferred": false, "depends_on": { - "macros": [], - "nodes": [] + "macros": [] }, "description": "", "docs": { @@ -11175,20 +13485,18 @@ "jaffle_shop", "raw_orders" ], - "language": "sql", + "group": null, "meta": {}, - "metrics": [], "name": "raw_orders", "original_file_path": "seeds/raw_orders.csv", "package_name": "jaffle_shop", "patch_path": null, "path": "raw_orders.csv", "raw_code": "", - "refs": [], + "relation_name": "\"postgres\".\"public\".\"raw_orders\"", "resource_type": "seed", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", + "root_path": "/Users/tati/Code/cosmos-clean/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", - "sources": [], "tags": [], "unique_id": "seed.jaffle_shop.raw_orders", "unrendered_config": {} @@ -11197,15 +13505,19 @@ "alias": "raw_payments", "build_path": null, "checksum": { - "checksum": "03fd407f3135f84456431a923f22fc185a2154079e210c20b690e3ab11687d11", + "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6", "name": "sha256" }, "columns": {}, - "compiled_path": null, "config": { "alias": null, "column_types": {}, + "contract": { + "alias_types": true, + "enforced": false + }, "database": null, + "delimiter": ",", "docs": { "node_color": null, "show": true @@ -11213,9 +13525,11 @@ "enabled": true, "full_refresh": null, "grants": {}, + "group": null, "incremental_strategy": null, "materialized": "seed", "meta": {}, + "on_configuration_change": "apply", "on_schema_change": "ignore", "packages": [], "persist_docs": {}, @@ -11227,12 +13541,10 @@ "tags": [], "unique_key": null }, - "created_at": 1696458270.30559, + "created_at": 1719485737.4141219, "database": "postgres", - "deferred": false, "depends_on": { - "macros": [], - "nodes": [] + "macros": [] }, "description": "", "docs": { @@ -11243,26 +13555,25 @@ "jaffle_shop", "raw_payments" ], - "language": "sql", + "group": null, "meta": {}, - "metrics": [], "name": "raw_payments", "original_file_path": "seeds/raw_payments.csv", "package_name": "jaffle_shop", "patch_path": null, "path": "raw_payments.csv", "raw_code": "", - "refs": [], + "relation_name": "\"postgres\".\"public\".\"raw_payments\"", "resource_type": "seed", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", + "root_path": "/Users/tati/Code/cosmos-clean/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public", - "sources": [], "tags": [], "unique_id": "seed.jaffle_shop.raw_payments", "unrendered_config": {} }, "test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": { "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -11277,19 +13588,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.35778, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.607407, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_accepted_values", @@ -11309,6 +13626,7 @@ "jaffle_shop", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11319,12 +13637,14 @@ "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11350,6 +13670,7 @@ }, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": { "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", + "attached_node": "model.jaffle_shop.stg_orders", "build_path": null, "checksum": { "checksum": "", @@ -11364,19 +13685,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.381258, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.637758, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_accepted_values", @@ -11397,6 +13724,7 @@ "staging", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11407,12 +13735,14 @@ "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "refs": [ - [ - "stg_orders" - ] + { + "name": "stg_orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11438,6 +13768,7 @@ }, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": { "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", + "attached_node": "model.jaffle_shop.stg_payments", "build_path": null, "checksum": { "checksum": "", @@ -11452,19 +13783,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.3883939, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6424909, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_accepted_values", @@ -11485,6 +13822,7 @@ "staging", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11495,12 +13833,14 @@ "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "refs": [ - [ - "stg_payments" - ] + { + "name": "stg_payments", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11525,6 +13865,7 @@ }, "test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d": { "alias": "not_null_customers_customer_id", + "attached_node": "model.jaffle_shop.customers", "build_path": null, "checksum": { "checksum": "", @@ -11539,19 +13880,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.342222, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.5844128, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -11570,6 +13917,7 @@ "jaffle_shop", "not_null_customers_customer_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11580,12 +13928,14 @@ "path": "not_null_customers_customer_id.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "customers" - ] + { + "name": "customers", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11602,6 +13952,7 @@ }, "test.jaffle_shop.not_null_orders_amount.106140f9fd": { "alias": "not_null_orders_amount", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -11616,19 +13967,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.365846, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6199622, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -11647,6 +14004,7 @@ "jaffle_shop", "not_null_orders_amount" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11657,12 +14015,14 @@ "path": "not_null_orders_amount.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11679,6 +14039,7 @@ }, "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49": { "alias": "not_null_orders_bank_transfer_amount", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -11693,19 +14054,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.369942, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6258051, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -11724,6 +14091,7 @@ "jaffle_shop", "not_null_orders_bank_transfer_amount" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11734,12 +14102,14 @@ "path": "not_null_orders_bank_transfer_amount.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11756,6 +14126,7 @@ }, "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625": { "alias": "not_null_orders_coupon_amount", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -11770,19 +14141,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.368623, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.624228, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -11801,6 +14178,7 @@ "jaffle_shop", "not_null_orders_coupon_amount" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11811,12 +14189,14 @@ "path": "not_null_orders_coupon_amount.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11833,6 +14213,7 @@ }, "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59": { "alias": "not_null_orders_credit_card_amount", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -11847,19 +14228,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.367114, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.622118, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -11878,6 +14265,7 @@ "jaffle_shop", "not_null_orders_credit_card_amount" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11888,12 +14276,14 @@ "path": "not_null_orders_credit_card_amount.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11910,6 +14300,7 @@ }, "test.jaffle_shop.not_null_orders_customer_id.c5f02694af": { "alias": "not_null_orders_customer_id", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -11924,19 +14315,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.345952, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.587272, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -11955,6 +14352,7 @@ "jaffle_shop", "not_null_orders_customer_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -11965,12 +14363,14 @@ "path": "not_null_orders_customer_id.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -11987,6 +14387,7 @@ }, "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a": { "alias": "not_null_orders_gift_card_amount", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -12001,19 +14402,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.371219, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6277661, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -12032,6 +14439,7 @@ "jaffle_shop", "not_null_orders_gift_card_amount" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12042,12 +14450,14 @@ "path": "not_null_orders_gift_card_amount.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12064,6 +14474,7 @@ }, "test.jaffle_shop.not_null_orders_order_id.cf6c17daed": { "alias": "not_null_orders_order_id", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -12078,19 +14489,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.344596, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.586345, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -12109,6 +14526,7 @@ "jaffle_shop", "not_null_orders_order_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12119,12 +14537,14 @@ "path": "not_null_orders_order_id.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12141,6 +14561,7 @@ }, "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": { "alias": "not_null_stg_customers_customer_id", + "attached_node": "model.jaffle_shop.stg_customers", "build_path": null, "checksum": { "checksum": "", @@ -12155,19 +14576,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.3773491, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.633585, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -12187,6 +14614,7 @@ "staging", "not_null_stg_customers_customer_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12197,12 +14625,14 @@ "path": "not_null_stg_customers_customer_id.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "stg_customers" - ] + { + "name": "stg_customers", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12219,6 +14649,7 @@ }, "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": { "alias": "not_null_stg_orders_order_id", + "attached_node": "model.jaffle_shop.stg_orders", "build_path": null, "checksum": { "checksum": "", @@ -12233,19 +14664,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.380042, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6366348, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -12265,6 +14702,7 @@ "staging", "not_null_stg_orders_order_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12275,12 +14713,14 @@ "path": "not_null_stg_orders_order_id.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "stg_orders" - ] + { + "name": "stg_orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12297,6 +14737,7 @@ }, "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": { "alias": "not_null_stg_payments_payment_id", + "attached_node": "model.jaffle_shop.stg_payments", "build_path": null, "checksum": { "checksum": "", @@ -12311,19 +14752,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.387188, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.641508, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_not_null" @@ -12343,6 +14790,7 @@ "staging", "not_null_stg_payments_payment_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12353,12 +14801,14 @@ "path": "not_null_stg_payments_payment_id.sql", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "stg_payments" - ] + { + "name": "stg_payments", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12375,6 +14825,7 @@ }, "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": { "alias": "relationships_orders_customer_id__customer_id__ref_customers_", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -12389,19 +14840,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.347137, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.590184, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_relationships", @@ -12422,6 +14879,7 @@ "jaffle_shop", "relationships_orders_customer_id__customer_id__ref_customers_" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12432,15 +14890,19 @@ "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "customers" - ], - [ - "orders" - ] + { + "name": "customers", + "package": null, + "version": null + }, + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12459,6 +14921,7 @@ }, "test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1": { "alias": "unique_customers_customer_id", + "attached_node": "model.jaffle_shop.customers", "build_path": null, "checksum": { "checksum": "", @@ -12473,19 +14936,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.340836, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.583136, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_unique" @@ -12504,6 +14973,7 @@ "jaffle_shop", "unique_customers_customer_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12514,12 +14984,14 @@ "path": "unique_customers_customer_id.sql", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "customers" - ] + { + "name": "customers", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12536,6 +15008,7 @@ }, "test.jaffle_shop.unique_orders_order_id.fed79b3a6e": { "alias": "unique_orders_order_id", + "attached_node": "model.jaffle_shop.orders", "build_path": null, "checksum": { "checksum": "", @@ -12550,19 +15023,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.343404, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.5853949, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_unique" @@ -12581,6 +15060,7 @@ "jaffle_shop", "unique_orders_order_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12591,12 +15071,14 @@ "path": "unique_orders_order_id.sql", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "orders" - ] + { + "name": "orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12613,6 +15095,7 @@ }, "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": { "alias": "unique_stg_customers_customer_id", + "attached_node": "model.jaffle_shop.stg_customers", "build_path": null, "checksum": { "checksum": "", @@ -12627,19 +15110,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.375885, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.6324039, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_unique" @@ -12659,6 +15148,7 @@ "staging", "unique_stg_customers_customer_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12669,12 +15159,14 @@ "path": "unique_stg_customers_customer_id.sql", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "stg_customers" - ] + { + "name": "stg_customers", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12691,6 +15183,7 @@ }, "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": { "alias": "unique_stg_orders_order_id", + "attached_node": "model.jaffle_shop.stg_orders", "build_path": null, "checksum": { "checksum": "", @@ -12705,19 +15198,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.3786829, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.635364, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_unique" @@ -12737,6 +15236,7 @@ "staging", "unique_stg_orders_order_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12747,12 +15247,14 @@ "path": "unique_stg_orders_order_id.sql", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "stg_orders" - ] + { + "name": "stg_orders", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12769,6 +15271,7 @@ }, "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": { "alias": "unique_stg_payments_payment_id", + "attached_node": "model.jaffle_shop.stg_payments", "build_path": null, "checksum": { "checksum": "", @@ -12783,19 +15286,25 @@ "enabled": true, "error_if": "!= 0", "fail_calc": "count(*)", + "group": null, "limit": null, "materialized": "test", "meta": {}, "schema": "dbt_test__audit", "severity": "ERROR", "store_failures": null, + "store_failures_as": null, "tags": [], "warn_if": "!= 0", "where": null }, - "created_at": 1696458270.385969, + "contract": { + "alias_types": true, + "checksum": null, + "enforced": false + }, + "created_at": 1719485737.640539, "database": "postgres", - "deferred": false, "depends_on": { "macros": [ "macro.dbt.test_unique" @@ -12815,6 +15324,7 @@ "staging", "unique_stg_payments_payment_id" ], + "group": null, "language": "sql", "meta": {}, "metrics": [], @@ -12825,12 +15335,14 @@ "path": "unique_stg_payments_payment_id.sql", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "refs": [ - [ - "stg_payments" - ] + { + "name": "stg_payments", + "package": null, + "version": null + } ], + "relation_name": null, "resource_type": "test", - "root_path": "/Users/julian/Astronomer/astronomer-cosmos/dev/dags/dbt/jaffle_shop", "schema": "public_dbt_test__audit", "sources": [], "tags": [], @@ -12930,6 +15442,9 @@ "model.jaffle_shop.stg_payments" ] }, + "saved_queries": {}, "selectors": {}, - "sources": {} + "semantic_models": {}, + "sources": {}, + "unit_tests": {} } diff --git a/tests/dbt/test_graph.py b/tests/dbt/test_graph.py index 064d34a13..639f5d698 100644 --- a/tests/dbt/test_graph.py +++ b/tests/dbt/test_graph.py @@ -1,4 +1,5 @@ import importlib +import logging import os import shutil import sys @@ -650,8 +651,6 @@ def test_load_via_dbt_ls_caching_partial_parsing( When using RenderConfig.enable_mock_profile=False and defining DbtGraph.cache_dir, Cosmos should leverage dbt partial parsing. """ - import logging - caplog.set_level(logging.DEBUG) is_profile_cache_enabled.return_value = enable_cache_profile @@ -681,6 +680,55 @@ def test_load_via_dbt_ls_caching_partial_parsing( assert not "Unable to do partial parsing" in caplog.text +@pytest.mark.integration +def test_load_via_dbt_ls_uses_partial_parse_when_cache_is_disabled( + tmp_dbt_project_dir, postgres_profile_config, caplog, tmp_path +): + """ + When using RenderConfig.enable_mock_profile=False and defining DbtGraph.cache_dir, + Cosmos should leverage dbt partial parsing. + """ + target_dir = tmp_dbt_project_dir / DBT_PROJECT_NAME / DBT_TARGET_DIR_NAME + target_dir.mkdir(parents=True, exist_ok=True) + + partial_parse_cache_dir = Path("/tmp/cosmos") + partial_parse_cache_dir.mkdir(parents=True, exist_ok=True) + + caplog.set_level(logging.DEBUG) + project_config = ProjectConfig(dbt_project_path=tmp_dbt_project_dir / DBT_PROJECT_NAME) + render_config = RenderConfig( + dbt_project_path=tmp_dbt_project_dir / DBT_PROJECT_NAME, dbt_deps=True, enable_mock_profile=False + ) + execution_config = ExecutionConfig(dbt_project_path=tmp_dbt_project_dir / DBT_PROJECT_NAME) + dbt_graph = DbtGraph( + project=project_config, + render_config=render_config, + execution_config=execution_config, + profile_config=postgres_profile_config, + cache_dir=partial_parse_cache_dir, + ) + # Creates partial parse file with the expected version + dbt_graph.load_via_dbt_ls_without_cache() # should not not raise exception + + caplog.clear() + + # We copy a valid partial parse to the project directory + shutil.copy(partial_parse_cache_dir / "target/partial_parse.msgpack", target_dir / "partial_parse.msgpack") + + # Run dbt ls without cache_dir, which disables cache: + dbt_graph = DbtGraph( + project=project_config, + render_config=render_config, + execution_config=execution_config, + profile_config=postgres_profile_config, + cache_dir="", # Cache is disabled + ) + # Should use the partial parse available in the original project folder + dbt_graph.load_via_dbt_ls_without_cache() # should not not raise exception + + assert not "Unable to do partial parsing" in caplog.text + + @pytest.mark.integration @patch("cosmos.dbt.graph.Popen") def test_load_via_dbt_ls_with_zero_returncode_and_non_empty_stderr( diff --git a/tests/test_cache.py b/tests/test_cache.py index 9edf10f90..738890bcb 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -106,7 +106,7 @@ def test_update_partial_parse_cache(mock_get_partial_parse_path, mock_copyfile): mock_get_partial_parse_path.side_effect = lambda cache_dir: cache_dir / "partial_parse.yml" latest_partial_parse_filepath = Path("/path/to/latest_partial_parse.yml") - cache_dir = Path("/path/to/cache_directory") + cache_dir = Path("/tmp/path/to/cache_directory") # Expected paths cache_path = cache_dir / "partial_parse.yml"