From 16125428592220d86a4ef12a8e6055b07011991a Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Tue, 1 Mar 2022 17:50:55 +0900 Subject: [PATCH] Implement v0.1.0-rc1 (#1) * `flit init` * Init * Update * Update * Update * Update * Update * Format --- .github/CODEOWNERS | 16 + .github/workflows/publish.yml | 41 + .github/workflows/test-publish.yml | 39 + .github/workflows/test.yml | 43 + .gitignore | 2 + .pypirc | 10 + .style.yapf | 2 + MANIFEST.in | 8 + Makefile | 45 + README.md | 155 +- dbt_artifacts_parser/__init__.py | 20 + dbt_artifacts_parser/parser.py | 222 + dbt_artifacts_parser/parsers/__init__.py | 16 + dbt_artifacts_parser/parsers/base.py | 26 + .../parsers/catalog/__init__.py | 16 + .../parsers/catalog/catalog_v1.py | 83 + .../parsers/manifest/__init__.py | 16 + .../parsers/manifest/manifest_v1.py | 1439 ++++ .../parsers/manifest/manifest_v2.py | 1441 ++++ .../parsers/manifest/manifest_v3.py | 1454 ++++ .../parsers/manifest/manifest_v4.py | 1636 +++++ .../parsers/run_results/__init__.py | 16 + .../parsers/run_results/run_results_v1.py | 80 + .../parsers/run_results/run_results_v2.py | 81 + .../parsers/run_results/run_results_v3.py | 158 + .../parsers/run_results/run_results_v4.py | 158 + .../parsers/sources/__init__.py | 16 + .../parsers/sources/sources_v1.py | 96 + .../parsers/sources/sources_v2.py | 109 + .../parsers/sources/sources_v3.py | 109 + dbt_artifacts_parser/parsers/utils.py | 67 + dbt_artifacts_parser/parsers/version_map.py | 75 + .../resources/catalog/catalog_v1.json | 249 + .../resources/manifest/manifest_v1.json | 5074 ++++++++++++++ .../resources/manifest/manifest_v2.json | 5128 ++++++++++++++ .../resources/manifest/manifest_v3.json | 5225 +++++++++++++++ .../resources/manifest/manifest_v4.json | 5939 +++++++++++++++++ .../resources/run-results/run-results_v1.json | 183 + .../resources/run-results/run-results_v2.json | 190 + .../resources/run-results/run-results_v3.json | 381 ++ .../resources/run-results/run-results_v4.json | 400 ++ .../resources/sources/sources_v1.json | 212 + .../resources/sources/sources_v2.json | 261 + .../resources/sources/sources_v3.json | 280 + dbt_artifacts_parser/utils.py | 27 + dev/clean.sh | 34 + dev/format_python.sh | 24 + dev/generate_parser_classes.sh | 93 + dev/lint_python.sh | 22 + dev/publish.sh | 38 + dev/setup.sh | 26 + dev/test_python.sh | 22 + pylintrc | 431 ++ pyproject.toml | 56 + setup.py | 17 + tests/__init__.py | 14 + tests/parsers/__init__.py | 16 + tests/parsers/test_utils.py | 115 + tests/resources/v1/jaffle_shop/catalog.json | 1 + tests/resources/v1/jaffle_shop/manifest.json | 1 + .../resources/v1/jaffle_shop/run_results.json | 1 + tests/resources/v2/jaffle_shop/manifest.json | 1 + .../resources/v2/jaffle_shop/run_results.json | 1 + tests/resources/v3/jaffle_shop/manifest.json | 1 + .../resources/v3/jaffle_shop/run_results.json | 1 + tests/resources/v4/jaffle_shop/manifest.json | 1 + .../resources/v4/jaffle_shop/run_results.json | 1 + tests/test_basic.py | 23 + tests/test_parser.py | 197 + tests/test_utils.py | 26 + 70 files changed, 32406 insertions(+), 1 deletion(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test-publish.yml create mode 100644 .github/workflows/test.yml create mode 100644 .pypirc create mode 100644 .style.yapf create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 dbt_artifacts_parser/__init__.py create mode 100644 dbt_artifacts_parser/parser.py create mode 100644 dbt_artifacts_parser/parsers/__init__.py create mode 100644 dbt_artifacts_parser/parsers/base.py create mode 100644 dbt_artifacts_parser/parsers/catalog/__init__.py create mode 100644 dbt_artifacts_parser/parsers/catalog/catalog_v1.py create mode 100644 dbt_artifacts_parser/parsers/manifest/__init__.py create mode 100644 dbt_artifacts_parser/parsers/manifest/manifest_v1.py create mode 100644 dbt_artifacts_parser/parsers/manifest/manifest_v2.py create mode 100644 dbt_artifacts_parser/parsers/manifest/manifest_v3.py create mode 100644 dbt_artifacts_parser/parsers/manifest/manifest_v4.py create mode 100644 dbt_artifacts_parser/parsers/run_results/__init__.py create mode 100644 dbt_artifacts_parser/parsers/run_results/run_results_v1.py create mode 100644 dbt_artifacts_parser/parsers/run_results/run_results_v2.py create mode 100644 dbt_artifacts_parser/parsers/run_results/run_results_v3.py create mode 100644 dbt_artifacts_parser/parsers/run_results/run_results_v4.py create mode 100644 dbt_artifacts_parser/parsers/sources/__init__.py create mode 100644 dbt_artifacts_parser/parsers/sources/sources_v1.py create mode 100644 dbt_artifacts_parser/parsers/sources/sources_v2.py create mode 100644 dbt_artifacts_parser/parsers/sources/sources_v3.py create mode 100644 dbt_artifacts_parser/parsers/utils.py create mode 100644 dbt_artifacts_parser/parsers/version_map.py create mode 100644 dbt_artifacts_parser/resources/catalog/catalog_v1.json create mode 100644 dbt_artifacts_parser/resources/manifest/manifest_v1.json create mode 100644 dbt_artifacts_parser/resources/manifest/manifest_v2.json create mode 100644 dbt_artifacts_parser/resources/manifest/manifest_v3.json create mode 100644 dbt_artifacts_parser/resources/manifest/manifest_v4.json create mode 100644 dbt_artifacts_parser/resources/run-results/run-results_v1.json create mode 100644 dbt_artifacts_parser/resources/run-results/run-results_v2.json create mode 100644 dbt_artifacts_parser/resources/run-results/run-results_v3.json create mode 100644 dbt_artifacts_parser/resources/run-results/run-results_v4.json create mode 100644 dbt_artifacts_parser/resources/sources/sources_v1.json create mode 100644 dbt_artifacts_parser/resources/sources/sources_v2.json create mode 100644 dbt_artifacts_parser/resources/sources/sources_v3.json create mode 100644 dbt_artifacts_parser/utils.py create mode 100755 dev/clean.sh create mode 100755 dev/format_python.sh create mode 100644 dev/generate_parser_classes.sh create mode 100644 dev/lint_python.sh create mode 100755 dev/publish.sh create mode 100755 dev/setup.sh create mode 100755 dev/test_python.sh create mode 100644 pylintrc create mode 100644 pyproject.toml create mode 100644 setup.py create mode 100644 tests/__init__.py create mode 100644 tests/parsers/__init__.py create mode 100644 tests/parsers/test_utils.py create mode 100644 tests/resources/v1/jaffle_shop/catalog.json create mode 100644 tests/resources/v1/jaffle_shop/manifest.json create mode 100644 tests/resources/v1/jaffle_shop/run_results.json create mode 100644 tests/resources/v2/jaffle_shop/manifest.json create mode 100644 tests/resources/v2/jaffle_shop/run_results.json create mode 100644 tests/resources/v3/jaffle_shop/manifest.json create mode 100644 tests/resources/v3/jaffle_shop/run_results.json create mode 100644 tests/resources/v4/jaffle_shop/manifest.json create mode 100644 tests/resources/v4/jaffle_shop/run_results.json create mode 100644 tests/test_basic.py create mode 100644 tests/test_parser.py create mode 100644 tests/test_utils.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..63ad756 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +* @yu-iskw diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..40dae3d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish (pypi) + +on: + release: + types: + - created + +jobs: + publish: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.9" + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish + - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' + run: bash dev/setup.sh + - name: Publish + env: + # SEE https://packaging.python.org/en/latest/specifications/pypirc/?highlight=token#using-a-pypi-token + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: bash dev/publish.sh "pypi" + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" diff --git a/.github/workflows/test-publish.yml b/.github/workflows/test-publish.yml new file mode 100644 index 0000000..14152e8 --- /dev/null +++ b/.github/workflows/test-publish.yml @@ -0,0 +1,39 @@ +name: Test publish (testpypi) + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.9" + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish + - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' + run: bash dev/setup.sh + - name: Test publish + env: + # SEE https://packaging.python.org/en/latest/specifications/pypirc/?highlight=token#using-a-pypi-token + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} + run: bash dev/publish.sh "testpypi" + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a3c6764 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Test python + +on: + pull_request: + paths: + - 'pyproject.toml' + - 'dbt_artifacts_parser/**/*.py' + - 'tests/**/*.py' + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + fail-fast: false + + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test + - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' + run: bash dev/setup.sh + - name: Lint + if: ${{ matrix.python-version != '3.6' }} + run: bash dev/lint_python.sh + - name: Test + run: bash dev/test_python.sh diff --git a/.gitignore b/.gitignore index b6e4761..07f6de3 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ MANIFEST # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec +!dbt_artifacts_parser/parsers/manifest +!dbt_artifacts_parser/resources/manifest # Installer logs pip-log.txt diff --git a/.pypirc b/.pypirc new file mode 100644 index 0000000..bbb1b31 --- /dev/null +++ b/.pypirc @@ -0,0 +1,10 @@ +[distutils] +index-servers = + pypi + testpypi + +[pypi] +repository=https://upload.pypi.org/legacy/ + +[testpypi] +repository=https://test.pypi.org/legacy/ diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 0000000..0e9640c --- /dev/null +++ b/.style.yapf @@ -0,0 +1,2 @@ +[style] +based_on_style = google diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6a5f534 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,8 @@ +exclude .git +exclude .gitignore +exclude tests +exclude .style.yapf +exclude Makefile +exclude pylintrc +exclude __pycache__ +exclude dbt_artifacts_parser/resources diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6566795 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +# Set up an environment +.PHONEY: setup +setup: + bash ./dev/setup.sh + +# Check all the coding style. +.PHONY: lint +lint: lint-shell lint-python + +# Check the coding style for the shell scripts. +.PHONY: lint-shell +lint-shell: + shellcheck ./dev/*.sh + +# Check the coding style for the python files. +.PHONY: lint-python +lint-python: + bash ./dev/lint_python.sh + +# Format source codes +format: format-python + +# Format python codes +format-python: + bash ./dev/format_python.sh + +# Run the unit tests. +.PHONEY: test +test: + bash ./dev/test_python.sh + +# Build the package +build: clean format test + flit build + +clean: + bash ./dev/clean.sh + +# Publish to pypi +publish: + bash ./dev/publish.sh "pypi" + +# Publish to testpypi +test-publish: + bash ./dev/publish.sh "testpypi" diff --git a/README.md b/README.md index 3c8fbfd..c4dc103 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,155 @@ +[![Test python](https://github.com/yu-iskw/dbt-artifacts-parser/actions/workflows/test.yml/badge.svg)](https://github.com/yu-iskw/dbt-artifacts-parser/actions/workflows/test.yml) + +Package version + + +Supported Python versions + + + # dbt-artifacts-parser -A dbt artifacts parser in python +This is a dbt artifacts parse in python. +It enables us to deal with `catalog.json`, `manifest.json`, `run-results.json` and `sources.json` as python objects. + +## Installation + +```bash +pip install -U dbt-artifacts-parser +``` + +## Example + +### Parse catalog.json +```python +import yaml + +# parse any version of catalog.json +from dbt_artifacts_parser.parser import parse_catalog + +with open("path/to/catalog.json", "r") as fp: + catalog_dict = yaml.safe_load(fp) + catalog_obj = parse_catalog(catalog=catalog_dict) + +# parse catalog.json v1 +from dbt_artifacts_parser.parser import parse_catalog_v1 + +with open("path/to/catalog.json", "r") as fp: + catalog_dict = yaml.safe_load(fp) + catalog_obj = parse_catalog_v1(catalog=catalog_dict) +``` + +### Parse manifest.json + +```python +import yaml + +# parse any version of manifest.json +from dbt_artifacts_parser.parser import parse_manifest + +with open("path/to/manifest.json", "r") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest(manifest=manifest_dict) + +# parse manifest.json v1 +from dbt_artifacts_parser.parser import parse_manifest_v1 + +with open("path/to/manifest.json", "r") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v1(manifest=manifest_dict) + +# parse manifest.json v2 +from dbt_artifacts_parser.parser import parse_manifest_v2 + +with open("path/to/manifest.json", "r") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v2(manifest=manifest_dict) + +# parse manifest.json v3 +from dbt_artifacts_parser.parser import parse_manifest_v3 + +with open("path/to/manifest.json", "r") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v3(manifest=manifest_dict) + +# parse manifest.json v4 +from dbt_artifacts_parser.parser import parse_manifest_v4 + +with open("path/to/manifest.json", "r") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v4(manifest=manifest_dict) +``` + +### Parse run-results.json + +```python +import yaml + +# parse any version of run-results.json +from dbt_artifacts_parser.parser import parse_run_results + +with open("path/to/run-resultsjson", "r") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results(run_results=run_results_dict) + +# parse run-results.json v1 +from dbt_artifacts_parser.parser import parse_run_results_v1 + +with open("path/to/run-results.json", "r") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v1(run_results=run_results_dict) + +# parse run-results.json v2 +from dbt_artifacts_parser.parser import parse_run_results_v2 + +with open("path/to/run-results.json", "r") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v2(run_results=run_results_dict) + +# parse run-results.json v3 +from dbt_artifacts_parser.parser import parse_run_results_v3 + +with open("path/to/run-results.json", "r") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v3(run_results=run_results_dict) + +# parse run-results.json v4 +from dbt_artifacts_parser.parser import parse_run_results_v4 + +with open("path/to/run-results.json", "r") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v4(run_results=run_results_dict) +``` + +### Parse sources.json + +```python +import yaml + +# parse any version of sources.json +from dbt_artifacts_parser.parser import parse_sources + +with open("path/to/sources.json", "r") as fp: + sources_dict = yaml.safe_load(fp) + sources_obj = parse_sources(sources=sources_dict) + +# parse sources.json v1 +from dbt_artifacts_parser.parser import parse_sources_v1 + +with open("path/to/sources.json", "r") as fp: + sources_dict = yaml.safe_load(fp) + sources_obj = parse_sources_v1(sources=sources_dict) + +# parse sources.json v2 +from dbt_artifacts_parser.parser import parse_sources_v2 + +with open("path/to/sources.json", "r") as fp: + sources_dict = yaml.safe_load(fp) + sources_obj = parse_sources_v2(sources=sources_dict) + +# parse sources.json v3 +from dbt_artifacts_parser.parser import parse_sources_v3 + +with open("path/to/sources.json", "r") as fp: + sources_dict = yaml.safe_load(fp) + sources_obj = parse_sources_v3(sources=sources_dict) +``` diff --git a/dbt_artifacts_parser/__init__.py b/dbt_artifacts_parser/__init__.py new file mode 100644 index 0000000..b559bca --- /dev/null +++ b/dbt_artifacts_parser/__init__.py @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +""" +A dbt artifacts parser in python +""" +__version__ = "0.1.0-rc1" diff --git a/dbt_artifacts_parser/parser.py b/dbt_artifacts_parser/parser.py new file mode 100644 index 0000000..d9f04ca --- /dev/null +++ b/dbt_artifacts_parser/parser.py @@ -0,0 +1,222 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from typing import Union + +from dbt_artifacts_parser.parsers.utils import get_dbt_schema_version + +from dbt_artifacts_parser.parsers.catalog.catalog_v1 import CatalogV1 +from dbt_artifacts_parser.parsers.manifest.manifest_v1 import ManifestV1 +from dbt_artifacts_parser.parsers.manifest.manifest_v2 import ManifestV2 +from dbt_artifacts_parser.parsers.manifest.manifest_v3 import ManifestV3 +from dbt_artifacts_parser.parsers.manifest.manifest_v4 import ManifestV4 +from dbt_artifacts_parser.parsers.run_results.run_results_v1 import RunResultsV1 +from dbt_artifacts_parser.parsers.run_results.run_results_v2 import RunResultsV2 +from dbt_artifacts_parser.parsers.run_results.run_results_v3 import RunResultsV3 +from dbt_artifacts_parser.parsers.run_results.run_results_v4 import RunResultsV4 +from dbt_artifacts_parser.parsers.sources.sources_v1 import SourcesV1 +from dbt_artifacts_parser.parsers.sources.sources_v2 import SourcesV2 +from dbt_artifacts_parser.parsers.sources.sources_v3 import SourcesV3 + +from dbt_artifacts_parser.parsers.version_map import ArtifactTypes + + +# +# catalog +# +def parse_catalog(catalog: dict) -> Union[CatalogV1]: + """Parse catalog.json + + Args: + catalog: dict of catalog.json + + Returns: + Union[CatalogV1] + """ + dbt_schema_version = get_dbt_schema_version(artifact_json=catalog) + if dbt_schema_version == ArtifactTypes.CATALOG_V1.value.dbt_schema_version: + return CatalogV1(**catalog) + raise ValueError("Not a soft of catalog.json") + + +def parse_catalog_v1(catalog: dict) -> CatalogV1: + """Parse catalog.json v1""" + dbt_schema_version = get_dbt_schema_version(artifact_json=catalog) + if dbt_schema_version == ArtifactTypes.CATALOG_V1.value.dbt_schema_version: + return CatalogV1(**catalog) + raise ValueError("Not a catalog.json v1") + + +# +# manifest +# +def parse_manifest( + manifest: dict +) -> Union[ManifestV1, ManifestV2, ManifestV3, ManifestV4]: + """Parse manifest.json + + Args: + manifest: A dict of manifest.json + + Returns: + Union[ManifestV1, ManifestV2, ManifestV3, ManifestV4] + """ + dbt_schema_version = get_dbt_schema_version(artifact_json=manifest) + if dbt_schema_version == ArtifactTypes.MANIFEST_V1.value.dbt_schema_version: + return ManifestV1(**manifest) + elif dbt_schema_version == ArtifactTypes.MANIFEST_V2.value.dbt_schema_version: + return ManifestV2(**manifest) + elif dbt_schema_version == ArtifactTypes.MANIFEST_V3.value.dbt_schema_version: + return ManifestV3(**manifest) + elif dbt_schema_version == ArtifactTypes.MANIFEST_V4.value.dbt_schema_version: + return ManifestV4(**manifest) + raise ValueError("Not a soft of manifest.json") + + +def parse_manifest_v1(manifest: dict) -> ManifestV1: + """Parse manifest.json ver.1""" + dbt_schema_version = get_dbt_schema_version(artifact_json=manifest) + if dbt_schema_version == ArtifactTypes.MANIFEST_V1.value.dbt_schema_version: + return ManifestV1(**manifest) + raise ValueError("Not a manifest.json v1") + + +def parse_manifest_v2(manifest: dict) -> ManifestV2: + """Parse manifest.json ver.2""" + dbt_schema_version = get_dbt_schema_version(artifact_json=manifest) + if dbt_schema_version == ArtifactTypes.MANIFEST_V2.value.dbt_schema_version: + return ManifestV2(**manifest) + raise ValueError("Not a manifest.json v2") + + +def parse_manifest_v3(manifest: dict) -> ManifestV3: + """Parse manifest.json ver.3""" + dbt_schema_version = get_dbt_schema_version(artifact_json=manifest) + if dbt_schema_version == ArtifactTypes.MANIFEST_V3.value.dbt_schema_version: + return ManifestV3(**manifest) + raise ValueError("Not a manifest.json v3") + + +def parse_manifest_v4(manifest: dict) -> ManifestV4: + """Parse manifest.json ver.4""" + dbt_schema_version = get_dbt_schema_version(artifact_json=manifest) + if dbt_schema_version == ArtifactTypes.MANIFEST_V4.value.dbt_schema_version: + return ManifestV4(**manifest) + raise ValueError("Not a manifest.json v4") + + +# +# run-results +# +def parse_run_results( + run_results: dict +) -> Union[RunResultsV1, RunResultsV2, RunResultsV3, RunResultsV4]: + """Parse run-results.json + + Args: + run_results: A dict of run-results.json + + Returns: + Union[RunResultsV1, RunResultsV2, RunResultsV3, RunResultsV4]: + """ + dbt_schema_version = get_dbt_schema_version(artifact_json=run_results) + if dbt_schema_version == ArtifactTypes.RUN_RESULTS_V1.value.dbt_schema_version: + return RunResultsV1(**run_results) + elif dbt_schema_version == ArtifactTypes.RUN_RESULTS_V2.value.dbt_schema_version: + return RunResultsV2(**run_results) + elif dbt_schema_version == ArtifactTypes.RUN_RESULTS_V3.value.dbt_schema_version: + return RunResultsV3(**run_results) + elif dbt_schema_version == ArtifactTypes.RUN_RESULTS_V4.value.dbt_schema_version: + return RunResultsV4(**run_results) + raise ValueError("Not a soft of manifest.json") + + +def parse_run_results_v1(run_results: dict) -> RunResultsV1: + """Parse run-results.json v1""" + dbt_schema_version = get_dbt_schema_version(artifact_json=run_results) + if dbt_schema_version == ArtifactTypes.RUN_RESULTS_V1.value.dbt_schema_version: + return RunResultsV1(**run_results) + raise ValueError("Not a run-results.json v1") + + +def parse_run_results_v2(run_results: dict) -> RunResultsV2: + """Parse run-results.json v2""" + dbt_schema_version = get_dbt_schema_version(artifact_json=run_results) + if dbt_schema_version == ArtifactTypes.RUN_RESULTS_V2.value.dbt_schema_version: + return RunResultsV2(**run_results) + raise ValueError("Not a run-results.json v2") + + +def parse_run_results_v3(run_results: dict) -> RunResultsV3: + """Parse run-results.json v3""" + dbt_schema_version = get_dbt_schema_version(artifact_json=run_results) + if dbt_schema_version == ArtifactTypes.RUN_RESULTS_V3.value.dbt_schema_version: + return RunResultsV3(**run_results) + raise ValueError("Not a run-results.json v3") + + +def parse_run_results_v4(run_results: dict) -> RunResultsV4: + """Parse run-results.json v4""" + dbt_schema_version = get_dbt_schema_version(artifact_json=run_results) + if dbt_schema_version == ArtifactTypes.RUN_RESULTS_V4.value.dbt_schema_version: + return RunResultsV4(**run_results) + raise ValueError("Not a run-results.json v4") + + +# +# sources +# +def parse_sources(sources: dict) -> Union[SourcesV1, SourcesV2, SourcesV3]: + """Parse sources.json + + Args: + sources: A dict of sources.json + + Returns: + Union[SourcesV1, SourcesV2, SourcesV3] + """ + dbt_schema_version = get_dbt_schema_version(artifact_json=sources) + if dbt_schema_version == ArtifactTypes.SOURCES_V1.value.dbt_schema_version: + return SourcesV1(**sources) + elif dbt_schema_version == ArtifactTypes.SOURCES_V2.value.dbt_schema_version: + return SourcesV2(**sources) + elif dbt_schema_version == ArtifactTypes.SOURCES_V3.value.dbt_schema_version: + return SourcesV3(**sources) + raise ValueError("Not a soft of manifest.json") + + +def parse_sources_v1(sources: dict) -> SourcesV1: + """Parse sources.json v1""" + dbt_schema_version = get_dbt_schema_version(artifact_json=sources) + if dbt_schema_version == ArtifactTypes.SOURCES_V1.value.dbt_schema_version: + return SourcesV1(**sources) + raise ValueError("Not a sources.json v1") + + +def parse_sources_v2(sources: dict) -> SourcesV2: + """Parse sources.json v2""" + dbt_schema_version = get_dbt_schema_version(artifact_json=sources) + if dbt_schema_version == ArtifactTypes.SOURCES_V2.value.dbt_schema_version: + return SourcesV2(**sources) + raise ValueError("Not a sources.json v2") + + +def parse_sources_v3(sources: dict) -> SourcesV3: + """Parse sources.json v3""" + dbt_schema_version = get_dbt_schema_version(artifact_json=sources) + if dbt_schema_version == ArtifactTypes.SOURCES_V3.value.dbt_schema_version: + return SourcesV3(**sources) + raise ValueError("Not a sources.json v3") diff --git a/dbt_artifacts_parser/parsers/__init__.py b/dbt_artifacts_parser/parsers/__init__.py new file mode 100644 index 0000000..3cfa191 --- /dev/null +++ b/dbt_artifacts_parser/parsers/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/dbt_artifacts_parser/parsers/base.py b/dbt_artifacts_parser/parsers/base.py new file mode 100644 index 0000000..faa85fd --- /dev/null +++ b/dbt_artifacts_parser/parsers/base.py @@ -0,0 +1,26 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# pylint: disable=no-name-in-module +# pylint: disable=no-self-argument +from pydantic import BaseModel + + +class BaseParserModel(BaseModel): + """ + The base parser class + """ diff --git a/dbt_artifacts_parser/parsers/catalog/__init__.py b/dbt_artifacts_parser/parsers/catalog/__init__.py new file mode 100644 index 0000000..3cfa191 --- /dev/null +++ b/dbt_artifacts_parser/parsers/catalog/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/dbt_artifacts_parser/parsers/catalog/catalog_v1.py b/dbt_artifacts_parser/parsers/catalog/catalog_v1.py new file mode 100644 index 0000000..81d16e9 --- /dev/null +++ b/dbt_artifacts_parser/parsers/catalog/catalog_v1.py @@ -0,0 +1,83 @@ +# generated by datamodel-codegen: +# filename: catalog_v1.json +# timestamp: 2022-03-01T06:21:30+00:00 + +from __future__ import annotations + +from datetime import datetime +from typing import Dict, List, Optional, Union + +from pydantic import Extra, Field + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class CatalogMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/catalog/v1.json' + dbt_version: Optional[str] = '0.19.0' + generated_at: Optional[datetime] = '2021-02-10T04:42:33.680487Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class TableMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + type: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + name: str + comment: Optional[Optional[str]] = None + owner: Optional[Optional[str]] = None + + +class ColumnMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + type: str + comment: Optional[Optional[str]] = None + index: int + name: str + + +class StatsItem(BaseParserModel): + + class Config: + extra = Extra.forbid + + id: str + label: str + value: Optional[Optional[Union[bool, str, float]]] = None + description: Optional[Optional[str]] = None + include: bool + + +class CatalogTable(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: TableMetadata + columns: Dict[str, ColumnMetadata] + stats: Dict[str, StatsItem] + unique_id: Optional[Optional[str]] = None + + +class CatalogV1(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: CatalogMetadata + nodes: Dict[str, CatalogTable] + sources: Dict[str, CatalogTable] + errors: Optional[Optional[List[str]]] = None diff --git a/dbt_artifacts_parser/parsers/manifest/__init__.py b/dbt_artifacts_parser/parsers/manifest/__init__.py new file mode 100644 index 0000000..3cfa191 --- /dev/null +++ b/dbt_artifacts_parser/parsers/manifest/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/dbt_artifacts_parser/parsers/manifest/manifest_v1.py b/dbt_artifacts_parser/parsers/manifest/manifest_v1.py new file mode 100644 index 0000000..da943ab --- /dev/null +++ b/dbt_artifacts_parser/parsers/manifest/manifest_v1.py @@ -0,0 +1,1439 @@ +# generated by datamodel-codegen: +# filename: manifest_v1.json +# timestamp: 2022-03-01T06:21:31+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +# pylint: disable=no-name-in-module +from pydantic import Extra, Field, constr + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class ManifestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/manifest/v1.json' + dbt_version: Optional[str] = '0.19.0' + generated_at: Optional[datetime] = '2021-02-10T04:42:33.683996Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + project_id: Optional[Optional[str]] = Field( + None, description='A unique identifier for the project') + user_id: Optional[Optional[constr( + regex=r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' + )]] = Field(None, description='A unique identifier for the user') + send_anonymous_usage_stats: Optional[Optional[bool]] = Field( + None, + description= + 'Whether dbt is configured to send anonymous usage statistics') + adapter_type: Optional[Optional[str]] = Field( + None, description='The type name of the adapter') + + +class ResourceType(Enum): + analysis = 'analysis' + + +class FileHash(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + checksum: str + + +class Hook(BaseParserModel): + + class Config: + extra = Extra.forbid + + sql: str + transaction: Optional[bool] = True + index: Optional[Optional[int]] = None + + +class DependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + nodes: Optional[List[str]] = [] + + +class ColumnInfo(BaseParserModel): + + class Config: + extra = Extra.allow + + name: str + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + data_type: Optional[Optional[str]] = None + quote: Optional[Optional[bool]] = None + tags: Optional[List[str]] = [] + + +class Docs(BaseParserModel): + + class Config: + extra = Extra.forbid + + show: Optional[bool] = True + + +class InjectedCTE(BaseParserModel): + + class Config: + extra = Extra.forbid + + id: str + sql: str + + +class ResourceType1(Enum): + test = 'test' + + +class TestConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'test' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + severity: Optional[constr( + regex=r'^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$')] = 'ERROR' + + +class ResourceType2(Enum): + model = 'model' + + +class ResourceType3(Enum): + operation = 'operation' + + +class ResourceType4(Enum): + rpc = 'rpc' + + +class ResourceType5(Enum): + test = 'test' + + +class TestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + namespace: Optional[Optional[str]] = None + name: str + kwargs: Dict[str, Any] + + +class ResourceType6(Enum): + seed = 'seed' + + +class SeedConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'seed' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + quote_columns: Optional[Optional[bool]] = None + + +class ResourceType7(Enum): + snapshot = 'snapshot' + + +class ResourceType8(Enum): + analysis = 'analysis' + + +class ResourceType9(Enum): + test = 'test' + + +class ParsedDataTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType9 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + + +class ResourceType10(Enum): + operation = 'operation' + + +class ResourceType11(Enum): + model = 'model' + + +class ResourceType12(Enum): + rpc = 'rpc' + + +class ResourceType13(Enum): + test = 'test' + + +class ParsedSchemaTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType13 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + column_name: Optional[Optional[str]] = None + + +class ResourceType14(Enum): + seed = 'seed' + + +class ParsedSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType14 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'materialized': 'seed', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'quote_columns': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + + +class ResourceType15(Enum): + snapshot = 'snapshot' + + +class Strategy(Enum): + timestamp = 'timestamp' + + +class TimestampSnapshotConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'snapshot' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + unique_key: str + target_schema: str + target_database: Optional[Optional[str]] = None + strategy: Strategy + updated_at: str + + +class Strategy1(Enum): + check = 'check' + + +class CheckCol(Enum): + all = 'all' + + +class CheckSnapshotConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'snapshot' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + unique_key: str + target_schema: str + target_database: Optional[Optional[str]] = None + strategy: Strategy1 + check_cols: Union[CheckCol, List[str]] + + +class Strategy2(BaseParserModel): + pass + + +class GenericSnapshotConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'snapshot' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + unique_key: str + target_schema: str + target_database: Optional[Optional[str]] = None + strategy: Strategy2 + + +class ResourceType16(Enum): + source = 'source' + + +class Quoting(BaseParserModel): + + class Config: + extra = Extra.forbid + + database: Optional[Optional[bool]] = None + schema_: Optional[Optional[bool]] = Field(None, alias='schema') + identifier: Optional[Optional[bool]] = None + column: Optional[Optional[bool]] = None + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v1.json' + dbt_version: Optional[str] = '0.19.0' + generated_at: Optional[datetime] = '2021-02-10T04:42:33.675309Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class Period(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: int + period: Period + + +class ExternalPartition(BaseParserModel): + + class Config: + extra = Extra.allow + + name: Optional[str] = '' + description: Optional[str] = '' + data_type: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + + +class SourceConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + + +class ResourceType17(Enum): + macro = 'macro' + + +class MacroDependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + + +class MacroArgument(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + type: Optional[Optional[str]] = None + description: Optional[str] = '' + + +class ParsedDocumentation(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + block_contents: str + + +class Type(Enum): + dashboard = 'dashboard' + notebook = 'notebook' + analysis = 'analysis' + ml = 'ml' + application = 'application' + + +class ResourceType18(Enum): + model = 'model' + analysis = 'analysis' + test = 'test' + snapshot = 'snapshot' + operation = 'operation' + seed = 'seed' + rpc = 'rpc' + docs = 'docs' + source = 'source' + macro = 'macro' + exposure = 'exposure' + + +class MaturityEnum(Enum): + low = 'low' + medium = 'medium' + high = 'high' + + +class ExposureOwner(BaseParserModel): + + class Config: + extra = Extra.forbid + + email: str + name: Optional[Optional[str]] = None + + +class NodeConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'view' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + + +class CompiledDataTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType1 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType2 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType3 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + index: Optional[Optional[int]] = None + + +class CompiledRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType4 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSchemaTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType5 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + column_name: Optional[Optional[str]] = None + + +class CompiledSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType6 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'materialized': 'seed', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'quote_columns': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType7 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType8 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + + +class ParsedHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType10 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + index: Optional[Optional[int]] = None + + +class ParsedModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType11 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + + +class ParsedRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType12 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + + +class ParsedSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType15 + alias: str + checksum: FileHash + config: Union[TimestampSnapshotConfig, CheckSnapshotConfig, + GenericSnapshotConfig] + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = None + error_after: Optional[Optional[Time]] = None + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + + +class ExternalTable(BaseParserModel): + + class Config: + extra = Extra.allow + + location: Optional[Optional[str]] = None + file_format: Optional[Optional[str]] = None + row_format: Optional[Optional[str]] = None + tbl_properties: Optional[Optional[str]] = None + partitions: Optional[Optional[List[ExternalPartition]]] = None + + +class ParsedMacro(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + macro_sql: str + resource_type: ResourceType17 + tags: Optional[List[str]] = [] + depends_on: Optional[MacroDependsOn] = {'macros': []} + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + arguments: Optional[List[MacroArgument]] = [] + + +class ParsedExposure(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + type: Type + owner: ExposureOwner + resource_type: Optional[ResourceType18] = 'exposure' + description: Optional[str] = '' + maturity: Optional[Optional[MaturityEnum]] = None + url: Optional[Optional[str]] = None + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + + +class CompiledAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'post-hook': [], + 'pre-hook': [], + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedSourceDefinition(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + source_name: str + source_description: str + loader: str + identifier: str + resource_type: ResourceType16 + quoting: Optional[Quoting] = { + 'database': None, + 'schema': None, + 'identifier': None, + 'column': None, + } + loaded_at_field: Optional[Optional[str]] = None + freshness: Optional[Optional[FreshnessThreshold]] = None + external: Optional[Optional[ExternalTable]] = None + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + source_meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + config: Optional[SourceConfig] = {'enabled': True} + patch_path: Optional[Optional[str]] = None + unrendered_config: Optional[Dict[str, Any]] = {} + relation_name: Optional[Optional[str]] = None + + +class ManifestV1(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: ManifestMetadata = Field( + ..., description='Metadata about the manifest') + nodes: Dict[ + str, Union[CompiledAnalysisNode, CompiledDataTestNode, + CompiledModelNode, CompiledHookNode, CompiledRPCNode, + CompiledSchemaTestNode, CompiledSeedNode, + CompiledSnapshotNode, ParsedAnalysisNode, ParsedDataTestNode, + ParsedHookNode, ParsedModelNode, ParsedRPCNode, + ParsedSchemaTestNode, ParsedSeedNode, ParsedSnapshotNode,], + ] = Field( + ..., + description='The nodes defined in the dbt project and its dependencies') + sources: Dict[str, ParsedSourceDefinition] = Field( + ..., + description='The sources defined in the dbt project and its dependencies' + ) + macros: Dict[str, ParsedMacro] = Field( + ..., + description='The macros defined in the dbt project and its dependencies' + ) + docs: Dict[str, ParsedDocumentation] = Field( + ..., + description='The docs defined in the dbt project and its dependencies') + exposures: Dict[str, ParsedExposure] = Field( + ..., + description= + 'The exposures defined in the dbt project and its dependencies') + selectors: Dict[str, Any] = Field( + ..., description='The selectors defined in selectors.yml') + disabled: Optional[Optional[List[ + Union[CompiledAnalysisNode, CompiledDataTestNode, CompiledModelNode, + CompiledHookNode, CompiledRPCNode, CompiledSchemaTestNode, + CompiledSeedNode, CompiledSnapshotNode, ParsedAnalysisNode, + ParsedDataTestNode, ParsedHookNode, ParsedModelNode, + ParsedRPCNode, ParsedSchemaTestNode, ParsedSeedNode, + ParsedSnapshotNode, ParsedSourceDefinition,]]]] = Field( + None, + description='A list of the disabled nodes in the target') + parent_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from\xa0child nodes to their dependencies') + child_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from parent nodes to their dependents') diff --git a/dbt_artifacts_parser/parsers/manifest/manifest_v2.py b/dbt_artifacts_parser/parsers/manifest/manifest_v2.py new file mode 100644 index 0000000..9cf0331 --- /dev/null +++ b/dbt_artifacts_parser/parsers/manifest/manifest_v2.py @@ -0,0 +1,1441 @@ +# generated by datamodel-codegen: +# filename: manifest_v2.json +# timestamp: 2022-03-01T06:21:33+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +# pylint: disable=no-name-in-module +from pydantic import Extra, Field, constr + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class ManifestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/manifest/v2.json' + dbt_version: Optional[str] = '0.20.0rc1' + generated_at: Optional[datetime] = '2021-06-07T14:49:01.099700Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + project_id: Optional[Optional[str]] = Field( + None, description='A unique identifier for the project') + user_id: Optional[Optional[constr( + regex=r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' + )]] = Field(None, description='A unique identifier for the user') + send_anonymous_usage_stats: Optional[Optional[bool]] = Field( + None, + description= + 'Whether dbt is configured to send anonymous usage statistics') + adapter_type: Optional[Optional[str]] = Field( + None, description='The type name of the adapter') + + +class ResourceType(Enum): + analysis = 'analysis' + + +class FileHash(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + checksum: str + + +class Hook(BaseParserModel): + + class Config: + extra = Extra.forbid + + sql: str + transaction: Optional[bool] = True + index: Optional[Optional[int]] = None + + +class DependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + nodes: Optional[List[str]] = [] + + +class ColumnInfo(BaseParserModel): + + class Config: + extra = Extra.allow + + name: str + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + data_type: Optional[Optional[str]] = None + quote: Optional[Optional[bool]] = None + tags: Optional[List[str]] = [] + + +class Docs(BaseParserModel): + + class Config: + extra = Extra.forbid + + show: Optional[bool] = True + + +class InjectedCTE(BaseParserModel): + + class Config: + extra = Extra.forbid + + id: str + sql: str + + +class ResourceType1(Enum): + test = 'test' + + +class TestConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'test' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field('dbt_test__audit', alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + severity: Optional[constr( + regex=r'^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$')] = 'ERROR' + store_failures: Optional[Optional[bool]] = None + where: Optional[Optional[str]] = None + limit: Optional[Optional[int]] = None + fail_calc: Optional[str] = 'count(*)' + warn_if: Optional[str] = '!= 0' + error_if: Optional[str] = '!= 0' + + +class ResourceType2(Enum): + model = 'model' + + +class ResourceType3(Enum): + operation = 'operation' + + +class ResourceType4(Enum): + rpc = 'rpc' + + +class ResourceType5(Enum): + test = 'test' + + +class TestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + kwargs: Optional[Dict[str, Any]] = {} + namespace: Optional[Optional[str]] = None + + +class ResourceType6(Enum): + seed = 'seed' + + +class SeedConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'seed' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + quote_columns: Optional[Optional[bool]] = None + + +class ResourceType7(Enum): + snapshot = 'snapshot' + + +class ResourceType8(Enum): + analysis = 'analysis' + + +class ResourceType9(Enum): + test = 'test' + + +class ParsedDataTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType9 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + + +class ResourceType10(Enum): + operation = 'operation' + + +class ResourceType11(Enum): + model = 'model' + + +class ResourceType12(Enum): + rpc = 'rpc' + + +class ResourceType13(Enum): + test = 'test' + + +class ParsedSchemaTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType13 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + column_name: Optional[Optional[str]] = None + + +class ResourceType14(Enum): + seed = 'seed' + + +class ParsedSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType14 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'materialized': 'seed', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'quote_columns': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + + +class ResourceType15(Enum): + snapshot = 'snapshot' + + +class SnapshotConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'snapshot' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + strategy: Optional[Optional[str]] = None + unique_key: Optional[Optional[str]] = None + target_schema: Optional[Optional[str]] = None + target_database: Optional[Optional[str]] = None + updated_at: Optional[Optional[str]] = None + check_cols: Optional[Optional[Union[str, List[str]]]] = None + + +class ResourceType16(Enum): + source = 'source' + + +class Quoting(BaseParserModel): + + class Config: + extra = Extra.forbid + + database: Optional[Optional[bool]] = None + schema_: Optional[Optional[bool]] = Field(None, alias='schema') + identifier: Optional[Optional[bool]] = None + column: Optional[Optional[bool]] = None + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v1.json' + dbt_version: Optional[str] = '0.20.0rc1' + generated_at: Optional[datetime] = '2021-06-07T14:49:01.095724Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class Period(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: int + period: Period + + +class ExternalPartition(BaseParserModel): + + class Config: + extra = Extra.allow + + name: Optional[str] = '' + description: Optional[str] = '' + data_type: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + + +class SourceConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + + +class ResourceType17(Enum): + macro = 'macro' + + +class MacroDependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + + +class MacroArgument(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + type: Optional[Optional[str]] = None + description: Optional[str] = '' + + +class ParsedDocumentation(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + block_contents: str + + +class Type(Enum): + dashboard = 'dashboard' + notebook = 'notebook' + analysis = 'analysis' + ml = 'ml' + application = 'application' + + +class ResourceType18(Enum): + model = 'model' + analysis = 'analysis' + test = 'test' + snapshot = 'snapshot' + operation = 'operation' + seed = 'seed' + rpc = 'rpc' + docs = 'docs' + source = 'source' + macro = 'macro' + exposure = 'exposure' + + +class MaturityEnum(Enum): + low = 'low' + medium = 'medium' + high = 'high' + + +class ExposureOwner(BaseParserModel): + + class Config: + extra = Extra.forbid + + email: str + name: Optional[Optional[str]] = None + + +class NodeConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + materialized: Optional[str] = 'view' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + vars: Optional[Dict[str, Any]] = {} + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + full_refresh: Optional[Optional[bool]] = None + + +class CompiledDataTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType1 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType2 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType3 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + index: Optional[Optional[int]] = None + + +class CompiledRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType4 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSchemaTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType5 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'materialized': 'test', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'full_refresh': None, + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + column_name: Optional[Optional[str]] = None + + +class CompiledSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType6 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'materialized': 'seed', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'quote_columns': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType7 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType8 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + + +class ParsedHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType10 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + index: Optional[Optional[int]] = None + + +class ParsedModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType11 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + + +class ParsedRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType12 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + + +class ParsedSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType15 + alias: str + checksum: FileHash + config: SnapshotConfig + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = None + error_after: Optional[Optional[Time]] = None + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + + +class ExternalTable(BaseParserModel): + + class Config: + extra = Extra.allow + + location: Optional[Optional[str]] = None + file_format: Optional[Optional[str]] = None + row_format: Optional[Optional[str]] = None + tbl_properties: Optional[Optional[str]] = None + partitions: Optional[Optional[List[ExternalPartition]]] = None + + +class ParsedMacro(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + macro_sql: str + resource_type: ResourceType17 + tags: Optional[List[str]] = [] + depends_on: Optional[MacroDependsOn] = {'macros': []} + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + arguments: Optional[List[MacroArgument]] = [] + created_at: Optional[int] = 1623077341 + + +class ParsedExposure(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + type: Type + owner: ExposureOwner + resource_type: Optional[ResourceType18] = 'exposure' + description: Optional[str] = '' + maturity: Optional[Optional[MaturityEnum]] = None + meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + url: Optional[Optional[str]] = None + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + created_at: Optional[int] = 1623077341 + + +class CompiledAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'materialized': 'view', + 'persist_docs': {}, + 'vars': {}, + 'quoting': {}, + 'column_types': {}, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'full_refresh': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1623077341 + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedSourceDefinition(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + source_name: str + source_description: str + loader: str + identifier: str + resource_type: ResourceType16 + quoting: Optional[Quoting] = { + 'database': None, + 'schema': None, + 'identifier': None, + 'column': None, + } + loaded_at_field: Optional[Optional[str]] = None + freshness: Optional[Optional[FreshnessThreshold]] = None + external: Optional[Optional[ExternalTable]] = None + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + source_meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + config: Optional[SourceConfig] = {'enabled': True} + patch_path: Optional[Optional[str]] = None + unrendered_config: Optional[Dict[str, Any]] = {} + relation_name: Optional[Optional[str]] = None + created_at: Optional[int] = 1623077341 + + +class ManifestV2(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: ManifestMetadata = Field( + ..., description='Metadata about the manifest') + nodes: Dict[ + str, Union[CompiledAnalysisNode, CompiledDataTestNode, + CompiledModelNode, CompiledHookNode, CompiledRPCNode, + CompiledSchemaTestNode, CompiledSeedNode, + CompiledSnapshotNode, ParsedAnalysisNode, ParsedDataTestNode, + ParsedHookNode, ParsedModelNode, ParsedRPCNode, + ParsedSchemaTestNode, ParsedSeedNode, ParsedSnapshotNode,], + ] = Field( + ..., + description='The nodes defined in the dbt project and its dependencies') + sources: Dict[str, ParsedSourceDefinition] = Field( + ..., + description='The sources defined in the dbt project and its dependencies' + ) + macros: Dict[str, ParsedMacro] = Field( + ..., + description='The macros defined in the dbt project and its dependencies' + ) + docs: Dict[str, ParsedDocumentation] = Field( + ..., + description='The docs defined in the dbt project and its dependencies') + exposures: Dict[str, ParsedExposure] = Field( + ..., + description= + 'The exposures defined in the dbt project and its dependencies') + selectors: Dict[str, Any] = Field( + ..., description='The selectors defined in selectors.yml') + disabled: Optional[Optional[List[ + Union[CompiledAnalysisNode, CompiledDataTestNode, CompiledModelNode, + CompiledHookNode, CompiledRPCNode, CompiledSchemaTestNode, + CompiledSeedNode, CompiledSnapshotNode, ParsedAnalysisNode, + ParsedDataTestNode, ParsedHookNode, ParsedModelNode, + ParsedRPCNode, ParsedSchemaTestNode, ParsedSeedNode, + ParsedSnapshotNode, ParsedSourceDefinition,]]]] = Field( + None, + description='A list of the disabled nodes in the target') + parent_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from\xa0child nodes to their dependencies') + child_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from parent nodes to their dependents') diff --git a/dbt_artifacts_parser/parsers/manifest/manifest_v3.py b/dbt_artifacts_parser/parsers/manifest/manifest_v3.py new file mode 100644 index 0000000..faa2a24 --- /dev/null +++ b/dbt_artifacts_parser/parsers/manifest/manifest_v3.py @@ -0,0 +1,1454 @@ +# generated by datamodel-codegen: +# filename: manifest_v3.json +# timestamp: 2022-03-01T06:21:34+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +# pylint: disable=no-name-in-module +from pydantic import Extra, Field, constr + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class ManifestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/manifest/v3.json' + dbt_version: Optional[str] = '0.21.0rc1' + generated_at: Optional[datetime] = '2021-09-24T13:29:14.317700Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + project_id: Optional[Optional[str]] = Field( + None, description='A unique identifier for the project') + user_id: Optional[Optional[constr( + regex=r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' + )]] = Field(None, description='A unique identifier for the user') + send_anonymous_usage_stats: Optional[Optional[bool]] = Field( + None, + description= + 'Whether dbt is configured to send anonymous usage statistics') + adapter_type: Optional[Optional[str]] = Field( + None, description='The type name of the adapter') + + +class ResourceType(Enum): + analysis = 'analysis' + + +class FileHash(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + checksum: str + + +class Hook(BaseParserModel): + + class Config: + extra = Extra.forbid + + sql: str + transaction: Optional[bool] = True + index: Optional[Optional[int]] = None + + +class DependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + nodes: Optional[List[str]] = [] + + +class ColumnInfo(BaseParserModel): + + class Config: + extra = Extra.allow + + name: str + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + data_type: Optional[Optional[str]] = None + quote: Optional[Optional[bool]] = None + tags: Optional[List[str]] = [] + + +class Docs(BaseParserModel): + + class Config: + extra = Extra.forbid + + show: Optional[bool] = True + + +class InjectedCTE(BaseParserModel): + + class Config: + extra = Extra.forbid + + id: str + sql: str + + +class ResourceType1(Enum): + test = 'test' + + +class TestConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field('dbt_test__audit', alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'test' + severity: Optional[constr( + regex=r'^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$')] = 'ERROR' + store_failures: Optional[Optional[bool]] = None + where: Optional[Optional[str]] = None + limit: Optional[Optional[int]] = None + fail_calc: Optional[str] = 'count(*)' + warn_if: Optional[str] = '!= 0' + error_if: Optional[str] = '!= 0' + + +class ResourceType2(Enum): + model = 'model' + + +class ResourceType3(Enum): + operation = 'operation' + + +class ResourceType4(Enum): + rpc = 'rpc' + + +class ResourceType5(Enum): + test = 'test' + + +class TestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + kwargs: Optional[Dict[str, Any]] = {} + namespace: Optional[Optional[str]] = None + + +class ResourceType6(Enum): + seed = 'seed' + + +class SeedConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'seed' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + full_refresh: Optional[Optional[bool]] = None + on_schema_change: Optional[Optional[str]] = 'ignore' + quote_columns: Optional[Optional[bool]] = None + + +class ResourceType7(Enum): + snapshot = 'snapshot' + + +class ResourceType8(Enum): + analysis = 'analysis' + + +class ResourceType9(Enum): + test = 'test' + + +class ParsedDataTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType9 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ResourceType10(Enum): + operation = 'operation' + + +class ResourceType11(Enum): + model = 'model' + + +class ResourceType12(Enum): + rpc = 'rpc' + + +class ResourceType13(Enum): + test = 'test' + + +class ParsedSchemaTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType13 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + column_name: Optional[Optional[str]] = None + + +class ResourceType14(Enum): + seed = 'seed' + + +class ParsedSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType14 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'seed', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'quote_columns': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ResourceType15(Enum): + snapshot = 'snapshot' + + +class SnapshotConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'snapshot' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + full_refresh: Optional[Optional[bool]] = None + on_schema_change: Optional[Optional[str]] = 'ignore' + strategy: Optional[Optional[str]] = None + unique_key: Optional[Optional[str]] = None + target_schema: Optional[Optional[str]] = None + target_database: Optional[Optional[str]] = None + updated_at: Optional[Optional[str]] = None + check_cols: Optional[Optional[Union[str, List[str]]]] = None + + +class ResourceType16(Enum): + source = 'source' + + +class Quoting(BaseParserModel): + + class Config: + extra = Extra.forbid + + database: Optional[Optional[bool]] = None + schema_: Optional[Optional[bool]] = Field(None, alias='schema') + identifier: Optional[Optional[bool]] = None + column: Optional[Optional[bool]] = None + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v2.json' + dbt_version: Optional[str] = '0.21.0rc1' + generated_at: Optional[datetime] = '2021-09-24T13:29:14.312598Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class Period(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: int + period: Period + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class ExternalPartition(BaseParserModel): + + class Config: + extra = Extra.allow + + name: Optional[str] = '' + description: Optional[str] = '' + data_type: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + + +class SourceConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + + +class ResourceType17(Enum): + macro = 'macro' + + +class MacroDependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + + +class MacroArgument(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + type: Optional[Optional[str]] = None + description: Optional[str] = '' + + +class ParsedDocumentation(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + block_contents: str + + +class Type(Enum): + dashboard = 'dashboard' + notebook = 'notebook' + analysis = 'analysis' + ml = 'ml' + application = 'application' + + +class ResourceType18(Enum): + model = 'model' + analysis = 'analysis' + test = 'test' + snapshot = 'snapshot' + operation = 'operation' + seed = 'seed' + rpc = 'rpc' + docs = 'docs' + source = 'source' + macro = 'macro' + exposure = 'exposure' + + +class MaturityEnum(Enum): + low = 'low' + medium = 'medium' + high = 'high' + + +class ExposureOwner(BaseParserModel): + + class Config: + extra = Extra.forbid + + email: str + name: Optional[Optional[str]] = None + + +class NodeConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'view' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + full_refresh: Optional[Optional[bool]] = None + on_schema_change: Optional[Optional[str]] = 'ignore' + + +class CompiledDataTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType1 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType2 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType3 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + index: Optional[Optional[int]] = None + + +class CompiledRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType4 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSchemaTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType5 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + column_name: Optional[Optional[str]] = None + + +class CompiledSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType6 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'seed', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'quote_columns': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType7 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType8 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType10 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + index: Optional[Optional[int]] = None + + +class ParsedModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType11 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType12 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType15 + alias: str + checksum: FileHash + config: SnapshotConfig + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = None + error_after: Optional[Optional[Time]] = None + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + timing: List[TimingInfo] + thread_id: str + execution_time: float + + +class ExternalTable(BaseParserModel): + + class Config: + extra = Extra.allow + + location: Optional[Optional[str]] = None + file_format: Optional[Optional[str]] = None + row_format: Optional[Optional[str]] = None + tbl_properties: Optional[Optional[str]] = None + partitions: Optional[Optional[List[ExternalPartition]]] = None + + +class ParsedMacro(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + macro_sql: str + resource_type: ResourceType17 + tags: Optional[List[str]] = [] + depends_on: Optional[MacroDependsOn] = {'macros': []} + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + arguments: Optional[List[MacroArgument]] = [] + created_at: Optional[int] = 1632490154 + + +class ParsedExposure(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + type: Type + owner: ExposureOwner + resource_type: Optional[ResourceType18] = 'exposure' + description: Optional[str] = '' + maturity: Optional[Optional[MaturityEnum]] = None + meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + url: Optional[Optional[str]] = None + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + created_at: Optional[int] = 1632490154 + + +class CompiledAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[int] = 1632490154 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedSourceDefinition(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + source_name: str + source_description: str + loader: str + identifier: str + resource_type: ResourceType16 + quoting: Optional[Quoting] = { + 'database': None, + 'schema': None, + 'identifier': None, + 'column': None, + } + loaded_at_field: Optional[Optional[str]] = None + freshness: Optional[Optional[FreshnessThreshold]] = None + external: Optional[Optional[ExternalTable]] = None + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + source_meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + config: Optional[SourceConfig] = {'enabled': True} + patch_path: Optional[Optional[str]] = None + unrendered_config: Optional[Dict[str, Any]] = {} + relation_name: Optional[Optional[str]] = None + created_at: Optional[int] = 1632490154 + + +class ManifestV3(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: ManifestMetadata = Field( + ..., description='Metadata about the manifest') + nodes: Dict[ + str, Union[CompiledAnalysisNode, CompiledDataTestNode, + CompiledModelNode, CompiledHookNode, CompiledRPCNode, + CompiledSchemaTestNode, CompiledSeedNode, + CompiledSnapshotNode, ParsedAnalysisNode, ParsedDataTestNode, + ParsedHookNode, ParsedModelNode, ParsedRPCNode, + ParsedSchemaTestNode, ParsedSeedNode, ParsedSnapshotNode,], + ] = Field( + ..., + description='The nodes defined in the dbt project and its dependencies') + sources: Dict[str, ParsedSourceDefinition] = Field( + ..., + description='The sources defined in the dbt project and its dependencies' + ) + macros: Dict[str, ParsedMacro] = Field( + ..., + description='The macros defined in the dbt project and its dependencies' + ) + docs: Dict[str, ParsedDocumentation] = Field( + ..., + description='The docs defined in the dbt project and its dependencies') + exposures: Dict[str, ParsedExposure] = Field( + ..., + description= + 'The exposures defined in the dbt project and its dependencies') + selectors: Dict[str, Any] = Field( + ..., description='The selectors defined in selectors.yml') + disabled: Optional[Optional[List[ + Union[CompiledAnalysisNode, CompiledDataTestNode, CompiledModelNode, + CompiledHookNode, CompiledRPCNode, CompiledSchemaTestNode, + CompiledSeedNode, CompiledSnapshotNode, ParsedAnalysisNode, + ParsedDataTestNode, ParsedHookNode, ParsedModelNode, + ParsedRPCNode, ParsedSchemaTestNode, ParsedSeedNode, + ParsedSnapshotNode, ParsedSourceDefinition,]]]] = Field( + None, + description='A list of the disabled nodes in the target') + parent_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from\xa0child nodes to their dependencies') + child_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from parent nodes to their dependents') diff --git a/dbt_artifacts_parser/parsers/manifest/manifest_v4.py b/dbt_artifacts_parser/parsers/manifest/manifest_v4.py new file mode 100644 index 0000000..21f079f --- /dev/null +++ b/dbt_artifacts_parser/parsers/manifest/manifest_v4.py @@ -0,0 +1,1636 @@ +# generated by datamodel-codegen: +# filename: manifest_v4.json +# timestamp: 2022-03-01T06:21:35+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +# pylint: disable=no-name-in-module +from pydantic import Extra, Field, constr + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class ManifestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/manifest/v4.json' + dbt_version: Optional[str] = '1.0.0rc2' + generated_at: Optional[datetime] = '2021-11-30T01:35:47.307789Z' + invocation_id: Optional[ + Optional[str]] = '66dd78f0-c79a-4b06-81b1-99794345df16' + env: Optional[Dict[str, str]] = {} + project_id: Optional[Optional[str]] = Field( + None, description='A unique identifier for the project') + user_id: Optional[Optional[constr( + regex=r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' + )]] = Field(None, description='A unique identifier for the user') + send_anonymous_usage_stats: Optional[Optional[bool]] = Field( + None, + description= + 'Whether dbt is configured to send anonymous usage statistics') + adapter_type: Optional[Optional[str]] = Field( + None, description='The type name of the adapter') + + +class ResourceType(Enum): + analysis = 'analysis' + + +class FileHash(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + checksum: str + + +class Hook(BaseParserModel): + + class Config: + extra = Extra.forbid + + sql: str + transaction: Optional[bool] = True + index: Optional[Optional[int]] = None + + +class DependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + nodes: Optional[List[str]] = [] + + +class ColumnInfo(BaseParserModel): + + class Config: + extra = Extra.allow + + name: str + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + data_type: Optional[Optional[str]] = None + quote: Optional[Optional[bool]] = None + tags: Optional[List[str]] = [] + + +class Docs(BaseParserModel): + + class Config: + extra = Extra.forbid + + show: Optional[bool] = True + + +class InjectedCTE(BaseParserModel): + + class Config: + extra = Extra.forbid + + id: str + sql: str + + +class ResourceType1(Enum): + test = 'test' + + +class TestConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field('dbt_test__audit', alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'test' + severity: Optional[constr( + regex=r'^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$')] = 'ERROR' + store_failures: Optional[Optional[bool]] = None + where: Optional[Optional[str]] = None + limit: Optional[Optional[int]] = None + fail_calc: Optional[str] = 'count(*)' + warn_if: Optional[str] = '!= 0' + error_if: Optional[str] = '!= 0' + + +class ResourceType2(Enum): + model = 'model' + + +class ResourceType3(Enum): + operation = 'operation' + + +class ResourceType4(Enum): + rpc = 'rpc' + + +class ResourceType5(Enum): + sql = 'sql' + + +class ResourceType6(Enum): + test = 'test' + + +class TestMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + kwargs: Optional[Dict[str, Any]] = {} + namespace: Optional[Optional[str]] = None + + +class ResourceType7(Enum): + seed = 'seed' + + +class SeedConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'seed' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + full_refresh: Optional[Optional[bool]] = None + on_schema_change: Optional[Optional[str]] = 'ignore' + quote_columns: Optional[Optional[bool]] = None + + +class ResourceType8(Enum): + snapshot = 'snapshot' + + +class ResourceType9(Enum): + analysis = 'analysis' + + +class ResourceType10(Enum): + test = 'test' + + +class ParsedSingularTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType10 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.3306549 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ResourceType11(Enum): + operation = 'operation' + + +class ResourceType12(Enum): + model = 'model' + + +class ResourceType13(Enum): + rpc = 'rpc' + + +class ResourceType14(Enum): + sql = 'sql' + + +class ResourceType15(Enum): + test = 'test' + + +class ParsedGenericTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType15 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.3383949 + config_call_dict: Optional[Dict[str, Any]] = {} + column_name: Optional[Optional[str]] = None + file_key_name: Optional[Optional[str]] = None + + +class ResourceType16(Enum): + seed = 'seed' + + +class ParsedSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType16 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'seed', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'quote_columns': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.339838 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ResourceType17(Enum): + snapshot = 'snapshot' + + +class SnapshotConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'snapshot' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + full_refresh: Optional[Optional[bool]] = None + on_schema_change: Optional[Optional[str]] = 'ignore' + strategy: Optional[Optional[str]] = None + unique_key: Optional[Optional[str]] = None + target_schema: Optional[Optional[str]] = None + target_database: Optional[Optional[str]] = None + updated_at: Optional[Optional[str]] = None + check_cols: Optional[Optional[Union[str, List[str]]]] = None + + +class ResourceType18(Enum): + source = 'source' + + +class Quoting(BaseParserModel): + + class Config: + extra = Extra.forbid + + database: Optional[Optional[bool]] = None + schema_: Optional[Optional[bool]] = Field(None, alias='schema') + identifier: Optional[Optional[bool]] = None + column: Optional[Optional[bool]] = None + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v3.json' + dbt_version: Optional[str] = '1.0.0rc2' + generated_at: Optional[datetime] = '2021-11-30T01:35:47.301745Z' + invocation_id: Optional[ + Optional[str]] = '66dd78f0-c79a-4b06-81b1-99794345df16' + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class PeriodEnum(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: Optional[Optional[int]] = None + period: Optional[Optional[PeriodEnum]] = None + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class ExternalPartition(BaseParserModel): + + class Config: + extra = Extra.allow + + name: Optional[str] = '' + description: Optional[str] = '' + data_type: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + + +class SourceConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + + +class ResourceType19(Enum): + macro = 'macro' + + +class MacroDependsOn(BaseParserModel): + + class Config: + extra = Extra.forbid + + macros: Optional[List[str]] = [] + + +class MacroArgument(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + type: Optional[Optional[str]] = None + description: Optional[str] = '' + + +class ParsedDocumentation(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + block_contents: str + + +class Type(Enum): + dashboard = 'dashboard' + notebook = 'notebook' + analysis = 'analysis' + ml = 'ml' + application = 'application' + + +class ResourceType20(Enum): + model = 'model' + analysis = 'analysis' + test = 'test' + snapshot = 'snapshot' + operation = 'operation' + seed = 'seed' + rpc = 'rpc' + sql = 'sql' + docs = 'docs' + source = 'source' + macro = 'macro' + exposure = 'exposure' + metric = 'metric' + + +class MaturityEnum(Enum): + low = 'low' + medium = 'medium' + high = 'high' + + +class ExposureOwner(BaseParserModel): + + class Config: + extra = Extra.forbid + + email: str + name: Optional[Optional[str]] = None + + +class ResourceType21(Enum): + model = 'model' + analysis = 'analysis' + test = 'test' + snapshot = 'snapshot' + operation = 'operation' + seed = 'seed' + rpc = 'rpc' + sql = 'sql' + docs = 'docs' + source = 'source' + macro = 'macro' + exposure = 'exposure' + metric = 'metric' + + +class MetricFilter(BaseParserModel): + + class Config: + extra = Extra.forbid + + field: str + operator: str + value: str + + +class NodeConfig(BaseParserModel): + + class Config: + extra = Extra.allow + + enabled: Optional[bool] = True + alias: Optional[Optional[str]] = None + schema_: Optional[Optional[str]] = Field(None, alias='schema') + database: Optional[Optional[str]] = None + tags: Optional[Union[List[str], str]] = [] + meta: Optional[Dict[str, Any]] = {} + materialized: Optional[str] = 'view' + persist_docs: Optional[Dict[str, Any]] = {} + post_hook: Optional[List[Hook]] = Field([], alias='post-hook') + pre_hook: Optional[List[Hook]] = Field([], alias='pre-hook') + quoting: Optional[Dict[str, Any]] = {} + column_types: Optional[Dict[str, Any]] = {} + full_refresh: Optional[Optional[bool]] = None + on_schema_change: Optional[Optional[str]] = 'ignore' + + +class CompiledSingularTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType1 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.314477 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType2 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.315979 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType3 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.317642 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + index: Optional[Optional[int]] = None + + +class CompiledRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType4 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.319278 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSqlNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType5 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.321433 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledGenericTestNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + test_metadata: TestMetadata + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType6 + alias: str + checksum: FileHash + config: Optional[TestConfig] = { + 'enabled': True, + 'alias': None, + 'schema': 'dbt_test__audit', + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'test', + 'severity': 'ERROR', + 'store_failures': None, + 'where': None, + 'limit': None, + 'fail_calc': 'count(*)', + 'warn_if': '!= 0', + 'error_if': '!= 0', + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.323731 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + column_name: Optional[Optional[str]] = None + file_key_name: Optional[Optional[str]] = None + + +class CompiledSeedNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType7 + alias: str + checksum: FileHash + config: Optional[SeedConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'seed', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'quote_columns': None, + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.326388 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class CompiledSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType8 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.328031 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType9 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.329485 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedHookNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType11 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.332001 + config_call_dict: Optional[Dict[str, Any]] = {} + index: Optional[Optional[int]] = None + + +class ParsedModelNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType12 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.333348 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedRPCNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType13 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.335125 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedSqlNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType14 + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.336567 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class ParsedSnapshotNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType17 + alias: str + checksum: FileHash + config: SnapshotConfig + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.3425322 + config_call_dict: Optional[Dict[str, Any]] = {} + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = {'count': None, 'period': None} + error_after: Optional[Optional[Time]] = {'count': None, 'period': None} + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + timing: List[TimingInfo] + thread_id: str + execution_time: float + + +class ExternalTable(BaseParserModel): + + class Config: + extra = Extra.allow + + location: Optional[Optional[str]] = None + file_format: Optional[Optional[str]] = None + row_format: Optional[Optional[str]] = None + tbl_properties: Optional[Optional[str]] = None + partitions: Optional[Optional[List[ExternalPartition]]] = None + + +class ParsedMacro(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + macro_sql: str + resource_type: ResourceType19 + tags: Optional[List[str]] = [] + depends_on: Optional[MacroDependsOn] = {'macros': []} + description: Optional[str] = '' + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + arguments: Optional[List[MacroArgument]] = [] + created_at: Optional[float] = 1638236147.345993 + + +class ParsedExposure(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + type: Type + owner: ExposureOwner + resource_type: Optional[ResourceType20] = 'exposure' + description: Optional[str] = '' + maturity: Optional[Optional[MaturityEnum]] = None + meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + url: Optional[Optional[str]] = None + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + created_at: Optional[float] = 1638236147.347234 + + +class ParsedMetric(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + model: str + name: str + description: str + label: str + type: str + sql: Optional[Optional[str]] = None + timestamp: Optional[Optional[str]] = None + filters: List[MetricFilter] + time_grains: List[str] + dimensions: List[str] + resource_type: Optional[ResourceType21] = 'metric' + meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + refs: Optional[List[List[str]]] = [] + created_at: Optional[float] = 1638236147.348404 + + +class CompiledAnalysisNode(BaseParserModel): + + class Config: + extra = Extra.forbid + + raw_sql: str + compiled: bool + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + fqn: List[str] + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + resource_type: ResourceType + alias: str + checksum: FileHash + config: Optional[NodeConfig] = { + 'enabled': True, + 'alias': None, + 'schema': None, + 'database': None, + 'tags': [], + 'meta': {}, + 'materialized': 'view', + 'persist_docs': {}, + 'quoting': {}, + 'column_types': {}, + 'full_refresh': None, + 'on_schema_change': 'ignore', + 'post-hook': [], + 'pre-hook': [], + } + tags: Optional[List[str]] = [] + refs: Optional[List[List[str]]] = [] + sources: Optional[List[List[str]]] = [] + depends_on: Optional[DependsOn] = {'macros': [], 'nodes': []} + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + docs: Optional[Docs] = {'show': True} + patch_path: Optional[Optional[str]] = None + compiled_path: Optional[Optional[str]] = None + build_path: Optional[Optional[str]] = None + deferred: Optional[bool] = False + unrendered_config: Optional[Dict[str, Any]] = {} + created_at: Optional[float] = 1638236147.3118432 + config_call_dict: Optional[Dict[str, Any]] = {} + compiled_sql: Optional[Optional[str]] = None + extra_ctes_injected: Optional[bool] = False + extra_ctes: Optional[List[InjectedCTE]] = [] + relation_name: Optional[Optional[str]] = None + + +class ParsedSourceDefinition(BaseParserModel): + + class Config: + extra = Extra.forbid + + fqn: List[str] + database: Optional[Optional[str]] = None + schema_: str = Field(..., alias='schema') + unique_id: str + package_name: str + root_path: str + path: str + original_file_path: str + name: str + source_name: str + source_description: str + loader: str + identifier: str + resource_type: ResourceType18 + quoting: Optional[Quoting] = { + 'database': None, + 'schema': None, + 'identifier': None, + 'column': None, + } + loaded_at_field: Optional[Optional[str]] = None + freshness: Optional[Optional[FreshnessThreshold]] = None + external: Optional[Optional[ExternalTable]] = None + description: Optional[str] = '' + columns: Optional[Dict[str, ColumnInfo]] = {} + meta: Optional[Dict[str, Any]] = {} + source_meta: Optional[Dict[str, Any]] = {} + tags: Optional[List[str]] = [] + config: Optional[SourceConfig] = {'enabled': True} + patch_path: Optional[Optional[str]] = None + unrendered_config: Optional[Dict[str, Any]] = {} + relation_name: Optional[Optional[str]] = None + created_at: Optional[float] = 1638236147.345053 + + +class ManifestV4(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: ManifestMetadata = Field( + ..., description='Metadata about the manifest') + nodes: Dict[ + str, + Union[CompiledAnalysisNode, CompiledSingularTestNode, CompiledModelNode, + CompiledHookNode, CompiledRPCNode, CompiledSqlNode, + CompiledGenericTestNode, CompiledSeedNode, CompiledSnapshotNode, + ParsedAnalysisNode, ParsedSingularTestNode, ParsedHookNode, + ParsedModelNode, ParsedRPCNode, ParsedSqlNode, + ParsedGenericTestNode, ParsedSeedNode, ParsedSnapshotNode,], + ] = Field( + ..., + description='The nodes defined in the dbt project and its dependencies') + sources: Dict[str, ParsedSourceDefinition] = Field( + ..., + description='The sources defined in the dbt project and its dependencies' + ) + macros: Dict[str, ParsedMacro] = Field( + ..., + description='The macros defined in the dbt project and its dependencies' + ) + docs: Dict[str, ParsedDocumentation] = Field( + ..., + description='The docs defined in the dbt project and its dependencies') + exposures: Dict[str, ParsedExposure] = Field( + ..., + description= + 'The exposures defined in the dbt project and its dependencies') + metrics: Dict[str, ParsedMetric] = Field( + ..., + description='The metrics defined in the dbt project and its dependencies' + ) + selectors: Dict[str, Any] = Field( + ..., description='The selectors defined in selectors.yml') + disabled: Optional[Optional[Dict[str, List[Union[ + CompiledAnalysisNode, CompiledSingularTestNode, CompiledModelNode, + CompiledHookNode, CompiledRPCNode, CompiledSqlNode, + CompiledGenericTestNode, CompiledSeedNode, CompiledSnapshotNode, + ParsedAnalysisNode, ParsedSingularTestNode, ParsedHookNode, + ParsedModelNode, ParsedRPCNode, ParsedSqlNode, ParsedGenericTestNode, + ParsedSeedNode, ParsedSnapshotNode, + ParsedSourceDefinition,]],]]] = Field( + None, description='A mapping of the disabled nodes in the target') + parent_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from\xa0child nodes to their dependencies') + child_map: Optional[Optional[Dict[str, List[str]]]] = Field( + None, description='A mapping from parent nodes to their dependents') diff --git a/dbt_artifacts_parser/parsers/run_results/__init__.py b/dbt_artifacts_parser/parsers/run_results/__init__.py new file mode 100644 index 0000000..3cfa191 --- /dev/null +++ b/dbt_artifacts_parser/parsers/run_results/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/dbt_artifacts_parser/parsers/run_results/run_results_v1.py b/dbt_artifacts_parser/parsers/run_results/run_results_v1.py new file mode 100644 index 0000000..c4ca563 --- /dev/null +++ b/dbt_artifacts_parser/parsers/run_results/run_results_v1.py @@ -0,0 +1,80 @@ +# generated by datamodel-codegen: +# filename: run-results_v1.json +# timestamp: 2022-03-01T06:21:36+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class BaseArtifactMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: str + dbt_version: Optional[str] = '0.19.0' + generated_at: Optional[datetime] = '2021-02-10T04:42:33.678063Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + success = 'success' + error = 'error' + skipped = 'skipped' + + +class Status1(Enum): + pass_ = 'pass' + error = 'error' + fail = 'fail' + warn = 'warn' + + +class Status2(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class RunResultOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + status: Union[Status, Status1, Status2] + timing: List[TimingInfo] + thread_id: str + execution_time: float + message: Optional[Optional[Union[str, int]]] = None + adapter_response: Dict[str, Any] + unique_id: str + + +class RunResultsV1(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: BaseArtifactMetadata + results: List[RunResultOutput] + elapsed_time: float + args: Optional[Dict[str, Any]] = {} diff --git a/dbt_artifacts_parser/parsers/run_results/run_results_v2.py b/dbt_artifacts_parser/parsers/run_results/run_results_v2.py new file mode 100644 index 0000000..b471062 --- /dev/null +++ b/dbt_artifacts_parser/parsers/run_results/run_results_v2.py @@ -0,0 +1,81 @@ +# generated by datamodel-codegen: +# filename: run-results_v2.json +# timestamp: 2022-03-01T06:21:36+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class BaseArtifactMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: str + dbt_version: Optional[str] = '0.20.0rc1' + generated_at: Optional[datetime] = '2021-06-07T14:49:01.097134Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + success = 'success' + error = 'error' + skipped = 'skipped' + + +class Status1(Enum): + pass_ = 'pass' + error = 'error' + fail = 'fail' + warn = 'warn' + + +class Status2(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class RunResultOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + status: Union[Status, Status1, Status2] + timing: List[TimingInfo] + thread_id: str + execution_time: float + adapter_response: Dict[str, Any] + message: Optional[Optional[str]] = None + failures: Optional[Optional[int]] = None + unique_id: str + + +class RunResultsV2(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: BaseArtifactMetadata + results: List[RunResultOutput] + elapsed_time: float + args: Optional[Dict[str, Any]] = {} diff --git a/dbt_artifacts_parser/parsers/run_results/run_results_v3.py b/dbt_artifacts_parser/parsers/run_results/run_results_v3.py new file mode 100644 index 0000000..65088bd --- /dev/null +++ b/dbt_artifacts_parser/parsers/run_results/run_results_v3.py @@ -0,0 +1,158 @@ +# generated by datamodel-codegen: +# filename: run-results_v3.json +# timestamp: 2022-03-01T06:21:37+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class BaseArtifactMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: str + dbt_version: Optional[str] = '0.21.0rc1' + generated_at: Optional[datetime] = '2021-09-24T13:29:14.315088Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + success = 'success' + error = 'error' + skipped = 'skipped' + + +class Status1(Enum): + pass_ = 'pass' + error = 'error' + fail = 'fail' + warn = 'warn' + skipped = 'skipped' + + +class Status2(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v2.json' + dbt_version: Optional[str] = '0.21.0rc1' + generated_at: Optional[datetime] = '2021-09-24T13:29:14.312598Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status3(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status3 + + +class Status4(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class Period(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: int + period: Period + + +class RunResultOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + status: Union[Status, Status1, Status2] + timing: List[TimingInfo] + thread_id: str + execution_time: float + adapter_response: Dict[str, Any] + message: Optional[Optional[str]] = None + failures: Optional[Optional[int]] = None + unique_id: str + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = None + error_after: Optional[Optional[Time]] = None + filter: Optional[Optional[str]] = None + + +class RunResultsV3(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: BaseArtifactMetadata + results: List[RunResultOutput] + elapsed_time: float + args: Optional[Dict[str, Any]] = {} + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status4 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + timing: List[TimingInfo] + thread_id: str + execution_time: float diff --git a/dbt_artifacts_parser/parsers/run_results/run_results_v4.py b/dbt_artifacts_parser/parsers/run_results/run_results_v4.py new file mode 100644 index 0000000..9e8453b --- /dev/null +++ b/dbt_artifacts_parser/parsers/run_results/run_results_v4.py @@ -0,0 +1,158 @@ +# generated by datamodel-codegen: +# filename: run-results_v4.json +# timestamp: 2022-03-01T06:21:37+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class BaseArtifactMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: str + dbt_version: Optional[str] = '1.0.0b2' + generated_at: Optional[datetime] = '2021-11-02T20:18:06.799863Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + success = 'success' + error = 'error' + skipped = 'skipped' + + +class Status1(Enum): + pass_ = 'pass' + error = 'error' + fail = 'fail' + warn = 'warn' + skipped = 'skipped' + + +class Status2(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v3.json' + dbt_version: Optional[str] = '1.0.0b2' + generated_at: Optional[datetime] = '2021-11-02T20:18:06.796684Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status3(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status3 + + +class Status4(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class PeriodEnum(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: Optional[Optional[int]] = None + period: Optional[Optional[PeriodEnum]] = None + + +class RunResultOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + status: Union[Status, Status1, Status2] + timing: List[TimingInfo] + thread_id: str + execution_time: float + adapter_response: Dict[str, Any] + message: Optional[Optional[str]] = None + failures: Optional[Optional[int]] = None + unique_id: str + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = {'count': None, 'period': None} + error_after: Optional[Optional[Time]] = {'count': None, 'period': None} + filter: Optional[Optional[str]] = None + + +class RunResultsV4(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: BaseArtifactMetadata + results: List[RunResultOutput] + elapsed_time: float + args: Optional[Dict[str, Any]] = {} + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status4 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + timing: List[TimingInfo] + thread_id: str + execution_time: float diff --git a/dbt_artifacts_parser/parsers/sources/__init__.py b/dbt_artifacts_parser/parsers/sources/__init__.py new file mode 100644 index 0000000..3cfa191 --- /dev/null +++ b/dbt_artifacts_parser/parsers/sources/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/dbt_artifacts_parser/parsers/sources/sources_v1.py b/dbt_artifacts_parser/parsers/sources/sources_v1.py new file mode 100644 index 0000000..ad98c10 --- /dev/null +++ b/dbt_artifacts_parser/parsers/sources/sources_v1.py @@ -0,0 +1,96 @@ +# generated by datamodel-codegen: +# filename: sources_v1.json +# timestamp: 2022-03-01T06:21:38+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v1.json' + dbt_version: Optional[str] = '0.19.0' + generated_at: Optional[datetime] = '2021-02-10T04:42:33.675309Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class Period(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: int + period: Period + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = None + error_after: Optional[Optional[Time]] = None + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + + +class SourcesV1(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: FreshnessMetadata + results: List[Union[SourceFreshnessRuntimeError, SourceFreshnessOutput]] + elapsed_time: float diff --git a/dbt_artifacts_parser/parsers/sources/sources_v2.py b/dbt_artifacts_parser/parsers/sources/sources_v2.py new file mode 100644 index 0000000..ef97931 --- /dev/null +++ b/dbt_artifacts_parser/parsers/sources/sources_v2.py @@ -0,0 +1,109 @@ +# generated by datamodel-codegen: +# filename: sources_v2.json +# timestamp: 2022-03-01T06:21:38+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v2.json' + dbt_version: Optional[str] = '0.21.0rc1' + generated_at: Optional[datetime] = '2021-09-24T13:29:14.312598Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class Period(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: int + period: Period + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = None + error_after: Optional[Optional[Time]] = None + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + timing: List[TimingInfo] + thread_id: str + execution_time: float + + +class SourcesV2(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: FreshnessMetadata + results: List[Union[SourceFreshnessRuntimeError, SourceFreshnessOutput]] + elapsed_time: float diff --git a/dbt_artifacts_parser/parsers/sources/sources_v3.py b/dbt_artifacts_parser/parsers/sources/sources_v3.py new file mode 100644 index 0000000..3c5a144 --- /dev/null +++ b/dbt_artifacts_parser/parsers/sources/sources_v3.py @@ -0,0 +1,109 @@ +# generated by datamodel-codegen: +# filename: sources_v3.json +# timestamp: 2022-03-01T06:21:38+00:00 + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import Extra + +from dbt_artifacts_parser.parsers.base import BaseParserModel + + +class FreshnessMetadata(BaseParserModel): + + class Config: + extra = Extra.forbid + + dbt_schema_version: Optional[ + str] = 'https://schemas.getdbt.com/dbt/sources/v3.json' + dbt_version: Optional[str] = '1.0.0b2' + generated_at: Optional[datetime] = '2021-11-02T20:18:06.796684Z' + invocation_id: Optional[Optional[str]] = None + env: Optional[Dict[str, str]] = {} + + +class Status(Enum): + runtime_error = 'runtime error' + + +class SourceFreshnessRuntimeError(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + error: Optional[Optional[Union[str, int]]] = None + status: Status + + +class Status1(Enum): + pass_ = 'pass' + warn = 'warn' + error = 'error' + runtime_error = 'runtime error' + + +class PeriodEnum(Enum): + minute = 'minute' + hour = 'hour' + day = 'day' + + +class Time(BaseParserModel): + + class Config: + extra = Extra.forbid + + count: Optional[Optional[int]] = None + period: Optional[Optional[PeriodEnum]] = None + + +class TimingInfo(BaseParserModel): + + class Config: + extra = Extra.forbid + + name: str + started_at: Optional[Optional[datetime]] = None + completed_at: Optional[Optional[datetime]] = None + + +class FreshnessThreshold(BaseParserModel): + + class Config: + extra = Extra.forbid + + warn_after: Optional[Optional[Time]] = {'count': None, 'period': None} + error_after: Optional[Optional[Time]] = {'count': None, 'period': None} + filter: Optional[Optional[str]] = None + + +class SourceFreshnessOutput(BaseParserModel): + + class Config: + extra = Extra.forbid + + unique_id: str + max_loaded_at: datetime + snapshotted_at: datetime + max_loaded_at_time_ago_in_s: float + status: Status1 + criteria: FreshnessThreshold + adapter_response: Dict[str, Any] + timing: List[TimingInfo] + thread_id: str + execution_time: float + + +class SourcesV3(BaseParserModel): + + class Config: + extra = Extra.forbid + + metadata: FreshnessMetadata + results: List[Union[SourceFreshnessRuntimeError, SourceFreshnessOutput]] + elapsed_time: float diff --git a/dbt_artifacts_parser/parsers/utils.py b/dbt_artifacts_parser/parsers/utils.py new file mode 100644 index 0000000..a5eed15 --- /dev/null +++ b/dbt_artifacts_parser/parsers/utils.py @@ -0,0 +1,67 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from typing import Type + +from dbt_artifacts_parser.parsers.base import BaseParserModel +from dbt_artifacts_parser.parsers.version_map import ArtifactTypes + + +def get_dbt_schema_version(artifact_json: dict) -> str: + """Get the dbt schema version from the dbt artifact JSON + + Args: + artifact_json (dict): dbt artifacts JSON + + Returns: + (str): dbt schema version from 'metadata.dbt_schema_version' + """ + if "metadata" not in artifact_json: + raise ValueError("'metadata' doesn't exist.") + if "dbt_schema_version" not in artifact_json["metadata"]: + raise ValueError("'metadata.dbt_schema_version' doesnt' exist.") + return artifact_json["metadata"]["dbt_schema_version"] + + +def get_artifact_type_by_id(schema_version: str) -> ArtifactTypes: + """Get artifact information by schema version + + Args: + schema_version: dbt schema version + + Returns: + ArtifactsTypes + """ + for artifact_type in ArtifactTypes: + if schema_version == artifact_type.value.dbt_schema_version: + return artifact_type + raise ValueError(f"no such schema version: {schema_version}") + + +def get_model_class(artifact_type: ArtifactTypes) -> Type[BaseParserModel]: + """Get the model class + + Args: + artifact_type (ArtifactTypes): artifact type + + Returns: + the model class + """ + for artifact_type_ in ArtifactTypes: + if artifact_type == artifact_type_: + return artifact_type_.value.model_class + raise ValueError(f"No such an artifact {artifact_type}") diff --git a/dbt_artifacts_parser/parsers/version_map.py b/dbt_artifacts_parser/parsers/version_map.py new file mode 100644 index 0000000..7c355c0 --- /dev/null +++ b/dbt_artifacts_parser/parsers/version_map.py @@ -0,0 +1,75 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from typing import Type +from enum import Enum +from dataclasses import dataclass + +from dbt_artifacts_parser.parsers.base import BaseParserModel + +from dbt_artifacts_parser.parsers.catalog.catalog_v1 import CatalogV1 + +from dbt_artifacts_parser.parsers.manifest.manifest_v1 import ManifestV1 +from dbt_artifacts_parser.parsers.manifest.manifest_v2 import ManifestV2 +from dbt_artifacts_parser.parsers.manifest.manifest_v3 import ManifestV3 +from dbt_artifacts_parser.parsers.manifest.manifest_v4 import ManifestV4 + +from dbt_artifacts_parser.parsers.run_results.run_results_v1 import RunResultsV1 +from dbt_artifacts_parser.parsers.run_results.run_results_v2 import RunResultsV2 +from dbt_artifacts_parser.parsers.run_results.run_results_v3 import RunResultsV3 +from dbt_artifacts_parser.parsers.run_results.run_results_v4 import RunResultsV4 + +from dbt_artifacts_parser.parsers.sources.sources_v1 import SourcesV1 +from dbt_artifacts_parser.parsers.sources.sources_v2 import SourcesV2 +from dbt_artifacts_parser.parsers.sources.sources_v3 import SourcesV3 + + +@dataclass +class ArtifactType: + dbt_schema_version: str + model_class: Type[BaseParserModel] + + +class ArtifactTypes(Enum): + """Dbt artifacts types""" + # Catalog + CATALOG_V1 = ArtifactType("https://schemas.getdbt.com/dbt/catalog/v1.json", + CatalogV1) + # Manifest + MANIFEST_V1 = ArtifactType( + "https://schemas.getdbt.com/dbt/manifest/v1.json", ManifestV1) + MANIFEST_V2 = ArtifactType( + "https://schemas.getdbt.com/dbt/manifest/v2.json", ManifestV2) + MANIFEST_V3 = ArtifactType( + "https://schemas.getdbt.com/dbt/manifest/v3.json", ManifestV3) + MANIFEST_V4 = ArtifactType( + "https://schemas.getdbt.com/dbt/manifest/v4.json", ManifestV4) + # RunResults + RUN_RESULTS_V1 = ArtifactType( + "https://schemas.getdbt.com/dbt/run-results/v1.json", RunResultsV1) + RUN_RESULTS_V2 = ArtifactType( + "https://schemas.getdbt.com/dbt/run-results/v2.json", RunResultsV2) + RUN_RESULTS_V3 = ArtifactType( + "https://schemas.getdbt.com/dbt/run-results/v3.json", RunResultsV3) + RUN_RESULTS_V4 = ArtifactType( + "https://schemas.getdbt.com/dbt/run-results/v4.json", RunResultsV4) + # Sources + SOURCES_V1 = ArtifactType("https://schemas.getdbt.com/dbt/sources/v1.json", + SourcesV1) + SOURCES_V2 = ArtifactType("https://schemas.getdbt.com/dbt/sources/v2.json", + SourcesV2) + SOURCES_V3 = ArtifactType("https://schemas.getdbt.com/dbt/sources/v3.json", + SourcesV3) diff --git a/dbt_artifacts_parser/resources/catalog/catalog_v1.json b/dbt_artifacts_parser/resources/catalog/catalog_v1.json new file mode 100644 index 0000000..d2e52f0 --- /dev/null +++ b/dbt_artifacts_parser/resources/catalog/catalog_v1.json @@ -0,0 +1,249 @@ +{ + "title": "Catalog", + "type": "object", + "required": [ + "metadata", + "nodes", + "sources" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/CatalogMetadata" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CatalogTable" + } + }, + "sources": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CatalogTable" + } + }, + "errors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CatalogArtifact(metadata: dbt.contracts.results.CatalogMetadata, nodes: Dict[str, dbt.contracts.results.CatalogTable], sources: Dict[str, dbt.contracts.results.CatalogTable], errors: Union[List[str], NoneType], _compile_results: Union[Any, NoneType] = None)", + "definitions": { + "CatalogMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/catalog/v1.json" + }, + "dbt_version": { + "type": "string", + "default": "0.19.0" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-02-10T04:42:33.680487Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "CatalogMetadata(dbt_schema_version: str = , dbt_version: str = '0.19.0', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "CatalogTable": { + "type": "object", + "required": [ + "metadata", + "columns", + "stats" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/TableMetadata" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnMetadata" + } + }, + "stats": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/StatsItem" + } + }, + "unique_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CatalogTable(metadata: dbt.contracts.results.TableMetadata, columns: Dict[str, dbt.contracts.results.ColumnMetadata], stats: Dict[str, dbt.contracts.results.StatsItem], unique_id: Union[str, NoneType] = None)" + }, + "TableMetadata": { + "type": "object", + "required": [ + "type", + "schema", + "name" + ], + "properties": { + "type": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "name": { + "type": "string" + }, + "comment": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "owner": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TableMetadata(type: str, database: Union[str, NoneType], schema: str, name: str, comment: Union[str, NoneType], owner: Union[str, NoneType])" + }, + "ColumnMetadata": { + "type": "object", + "required": [ + "type", + "index", + "name" + ], + "properties": { + "type": { + "type": "string" + }, + "comment": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "ColumnMetadata(type: str, comment: Union[str, NoneType], index: int, name: str)" + }, + "StatsItem": { + "type": "object", + "required": [ + "id", + "label", + "include" + ], + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "value": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "description": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "include": { + "type": "boolean" + } + }, + "additionalProperties": false, + "description": "StatsItem(id: str, label: str, value: Union[bool, str, float, NoneType], description: Union[str, NoneType], include: bool)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/catalog/v1.json" +} diff --git a/dbt_artifacts_parser/resources/manifest/manifest_v1.json b/dbt_artifacts_parser/resources/manifest/manifest_v1.json new file mode 100644 index 0000000..69eef10 --- /dev/null +++ b/dbt_artifacts_parser/resources/manifest/manifest_v1.json @@ -0,0 +1,5074 @@ +{ + "title": "Manifest", + "type": "object", + "required": [ + "metadata", + "nodes", + "sources", + "macros", + "docs", + "exposures", + "selectors" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/ManifestMetadata", + "description": "Metadata about the manifest" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledDataTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSchemaTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedDataTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSchemaTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + } + ] + }, + "description": "The nodes defined in the dbt project and its dependencies" + }, + "sources": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedSourceDefinition" + }, + "description": "The sources defined in the dbt project and its dependencies" + }, + "macros": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedMacro" + }, + "description": "The macros defined in the dbt project and its dependencies" + }, + "docs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedDocumentation" + }, + "description": "The docs defined in the dbt project and its dependencies" + }, + "exposures": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedExposure" + }, + "description": "The exposures defined in the dbt project and its dependencies" + }, + "selectors": { + "type": "object", + "description": "The selectors defined in selectors.yml" + }, + "disabled": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledDataTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSchemaTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedDataTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSchemaTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedSourceDefinition" + } + ] + } + }, + { + "type": "null" + } + ], + "description": "A list of the disabled nodes in the target" + }, + "parent_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from\u00a0child nodes to their dependencies" + }, + "child_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from parent nodes to their dependents" + } + }, + "additionalProperties": false, + "description": "WritableManifest(metadata: dbt.contracts.graph.manifest.ManifestMetadata, nodes: Mapping[str, Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledDataTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSchemaTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedDataTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSchemaTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode]], sources: Mapping[str, dbt.contracts.graph.parsed.ParsedSourceDefinition], macros: Mapping[str, dbt.contracts.graph.parsed.ParsedMacro], docs: Mapping[str, dbt.contracts.graph.parsed.ParsedDocumentation], exposures: Mapping[str, dbt.contracts.graph.parsed.ParsedExposure], selectors: Mapping[str, Any], disabled: Union[List[Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledDataTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSchemaTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedDataTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSchemaTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode, dbt.contracts.graph.parsed.ParsedSourceDefinition]], NoneType], parent_map: Union[Dict[str, List[str]], NoneType], child_map: Union[Dict[str, List[str]], NoneType])", + "definitions": { + "ManifestMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/manifest/v1.json" + }, + "dbt_version": { + "type": "string", + "default": "0.19.0" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-02-10T04:42:33.683996Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "project_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the project" + }, + "user_id": { + "oneOf": [ + { + "type": "string", + "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the user" + }, + "send_anonymous_usage_stats": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether dbt is configured to send anonymous usage statistics" + }, + "adapter_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The type name of the adapter" + } + }, + "additionalProperties": false, + "description": "Metadata for the manifest." + }, + "CompiledAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledAnalysisNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None)" + }, + "FileHash": { + "type": "object", + "required": [ + "name", + "checksum" + ], + "properties": { + "name": { + "type": "string" + }, + "checksum": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "FileHash(name: str, checksum: str)" + }, + "NodeConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "view" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "NodeConfig(*args, **kwds)" + }, + "Hook": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Hook(sql: str, transaction: bool = True, index: Union[int, NoneType] = None)" + }, + "DependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "DependsOn(macros: List[str] = , nodes: List[str] = )" + }, + "ColumnInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "data_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "quote": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": true, + "description": "ColumnInfo(name: str, description: str = '', meta: Dict[str, Any] = , data_type: Union[str, NoneType] = None, quote: Union[bool, NoneType] = None, tags: List[str] = , _extra: Dict[str, Any] = )" + }, + "Docs": { + "type": "object", + "required": [], + "properties": { + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "description": "Docs(show: bool = True)" + }, + "InjectedCTE": { + "type": "object", + "required": [ + "id", + "sql" + ], + "properties": { + "id": { + "type": "string" + }, + "sql": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "InjectedCTE(id: str, sql: str)" + }, + "CompiledDataTestNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledDataTestNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None)" + }, + "TestConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "test" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "severity": { + "type": "string", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$", + "default": "ERROR" + } + }, + "additionalProperties": true, + "description": "TestConfig(*args, **kwds)" + }, + "CompiledModelNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledModelNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None)" + }, + "CompiledHookNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledHookNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, index: Union[int, NoneType] = None)" + }, + "CompiledRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledRPCNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None)" + }, + "CompiledSchemaTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSchemaTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, column_name: Union[str, NoneType] = None)" + }, + "TestMetadata": { + "type": "object", + "required": [ + "name", + "kwargs" + ], + "properties": { + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "kwargs": { + "type": "object" + } + }, + "additionalProperties": false, + "description": "TestMetadata(namespace: Union[str, NoneType], name: str, kwargs: Dict[str, Any])" + }, + "CompiledSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "materialized": "seed", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "quote_columns": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSeedNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None)" + }, + "SeedConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "seed" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "quote_columns": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SeedConfig(*args, **kwds)" + }, + "CompiledSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSnapshotNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None)" + }, + "ParsedAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedAnalysisNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = )" + }, + "ParsedDataTestNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedDataTestNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = )" + }, + "ParsedHookNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedHookNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , index: Union[int, NoneType] = None)" + }, + "ParsedModelNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedModelNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = )" + }, + "ParsedRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedRPCNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = )" + }, + "ParsedSchemaTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedSchemaTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , column_name: Union[str, NoneType] = None)" + }, + "ParsedSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "materialized": "seed", + "persist_docs": {}, + "post-hook": [], + "pre-hook": [], + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "quote_columns": null + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSeedNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = )" + }, + "ParsedSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum", + "config" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "oneOf": [ + { + "$ref": "#/definitions/TimestampSnapshotConfig" + }, + { + "$ref": "#/definitions/CheckSnapshotConfig" + }, + { + "$ref": "#/definitions/GenericSnapshotConfig" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSnapshotNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: Union[ForwardRef('TimestampSnapshotConfig'), ForwardRef('CheckSnapshotConfig'), ForwardRef('GenericSnapshotConfig')], tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = )" + }, + "TimestampSnapshotConfig": { + "type": "object", + "required": [ + "unique_key", + "target_schema", + "strategy", + "updated_at" + ], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "snapshot" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "unique_key": { + "type": "string" + }, + "target_schema": { + "type": "string" + }, + "target_database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "strategy": { + "type": "string", + "enum": [ + "timestamp" + ] + }, + "updated_at": { + "type": "string" + } + }, + "additionalProperties": true, + "description": "TimestampSnapshotConfig(*args, **kwds)" + }, + "CheckSnapshotConfig": { + "type": "object", + "required": [ + "unique_key", + "target_schema", + "strategy", + "check_cols" + ], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "snapshot" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "unique_key": { + "type": "string" + }, + "target_schema": { + "type": "string" + }, + "target_database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "strategy": { + "type": "string", + "enum": [ + "check" + ] + }, + "check_cols": { + "oneOf": [ + { + "type": "string", + "enum": [ + "all" + ] + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "additionalProperties": true, + "description": "CheckSnapshotConfig(*args, **kwds)" + }, + "GenericSnapshotConfig": { + "type": "object", + "required": [ + "unique_key", + "target_schema", + "strategy" + ], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "snapshot" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "unique_key": { + "type": "string" + }, + "target_schema": { + "type": "string" + }, + "target_database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "strategy": { + "allOf": [ + { + "type": "string" + }, + { + "not": { + "type": "string", + "enum": [ + "timestamp" + ] + } + }, + { + "not": { + "type": "string", + "enum": [ + "check" + ] + } + } + ] + } + }, + "additionalProperties": true, + "description": "GenericSnapshotConfig(*args, **kwds)" + }, + "ParsedSourceDefinition": { + "type": "object", + "required": [ + "fqn", + "schema", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "source_name", + "source_description", + "loader", + "identifier", + "resource_type" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source_name": { + "type": "string" + }, + "source_description": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "source" + ] + }, + "quoting": { + "$ref": "#/definitions/Quoting", + "default": { + "database": null, + "schema": null, + "identifier": null, + "column": null + } + }, + "loaded_at_field": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "freshness": { + "oneOf": [ + { + "$ref": "#/definitions/FreshnessThreshold" + }, + { + "type": "null" + } + ] + }, + "external": { + "oneOf": [ + { + "$ref": "#/definitions/ExternalTable" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "source_meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "config": { + "$ref": "#/definitions/SourceConfig", + "default": { + "enabled": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedSourceDefinition(fqn: List[str], database: Union[str, NoneType], schema: str, unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, source_name: str, source_description: str, loader: str, identifier: str, resource_type: dbt.node_types.NodeType, quoting: dbt.contracts.graph.unparsed.Quoting = , loaded_at_field: Union[str, NoneType] = None, freshness: Union[dbt.contracts.graph.unparsed.FreshnessThreshold, NoneType] = None, external: Union[dbt.contracts.graph.unparsed.ExternalTable, NoneType] = None, description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , source_meta: Dict[str, Any] = , tags: List[str] = , config: dbt.contracts.graph.model_config.SourceConfig = , patch_path: Union[pathlib.Path, NoneType] = None, unrendered_config: Dict[str, Any] = , relation_name: Union[str, NoneType] = None)" + }, + "Quoting": { + "type": "object", + "required": [], + "properties": { + "database": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "identifier": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "column": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Quoting(database: Union[bool, NoneType] = None, schema: Union[bool, NoneType] = None, identifier: Union[bool, NoneType] = None, column: Union[bool, NoneType] = None)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, filter: Union[str, NoneType] = None)" + }, + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v1.json" + }, + "dbt_version": { + "type": "string", + "default": "0.19.0" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-02-10T04:42:33.675309Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '0.19.0', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any])" + }, + "Time": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false, + "description": "Time(count: int, period: dbt.contracts.graph.unparsed.TimePeriod)" + }, + "ExternalTable": { + "type": "object", + "required": [], + "properties": { + "location": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "file_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "row_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tbl_properties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "partitions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalPartition" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "ExternalTable(_extra: Dict[str, Any] = , location: Union[str, NoneType] = None, file_format: Union[str, NoneType] = None, row_format: Union[str, NoneType] = None, tbl_properties: Union[str, NoneType] = None, partitions: Union[List[dbt.contracts.graph.unparsed.ExternalPartition], NoneType] = None)" + }, + "ExternalPartition": { + "type": "object", + "required": [], + "properties": { + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "data_type": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + } + }, + "additionalProperties": true, + "description": "ExternalPartition(_extra: Dict[str, Any] = , name: str = '', description: str = '', data_type: str = '', meta: Dict[str, Any] = )" + }, + "SourceConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": true, + "description": "SourceConfig(*args, **kwds)" + }, + "ParsedMacro": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "macro_sql", + "resource_type" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "macro_sql": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "macro" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/MacroDependsOn", + "default": { + "macros": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/definitions/MacroArgument" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "ParsedMacro(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, macro_sql: str, resource_type: dbt.node_types.NodeType, tags: List[str] = , depends_on: dbt.contracts.graph.parsed.MacroDependsOn = , description: str = '', meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, arguments: List[dbt.contracts.graph.unparsed.MacroArgument] = )" + }, + "MacroDependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "MacroDependsOn(macros: List[str] = )" + }, + "MacroArgument": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + } + }, + "additionalProperties": false, + "description": "MacroArgument(name: str, type: Union[str, NoneType] = None, description: str = '')" + }, + "ParsedDocumentation": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "block_contents" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "block_contents": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "ParsedDocumentation(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, block_contents: str)" + }, + "ParsedExposure": { + "type": "object", + "required": [ + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "type", + "owner" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "owner": { + "$ref": "#/definitions/ExposureOwner" + }, + "resource_type": { + "type": "string", + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "docs", + "source", + "macro", + "exposure" + ], + "default": "exposure" + }, + "description": { + "type": "string", + "default": "" + }, + "maturity": { + "oneOf": [ + { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + { + "type": "null" + } + ] + }, + "url": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "ParsedExposure(fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, type: dbt.contracts.graph.unparsed.ExposureType, owner: dbt.contracts.graph.unparsed.ExposureOwner, resource_type: dbt.node_types.NodeType = , description: str = '', maturity: Union[dbt.contracts.graph.unparsed.MaturityType, NoneType] = None, url: Union[str, NoneType] = None, depends_on: dbt.contracts.graph.parsed.DependsOn = , refs: List[List[str]] = , sources: List[List[str]] = )" + }, + "ExposureOwner": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ExposureOwner(email: str, name: Union[str, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/manifest/v1.json" +} diff --git a/dbt_artifacts_parser/resources/manifest/manifest_v2.json b/dbt_artifacts_parser/resources/manifest/manifest_v2.json new file mode 100644 index 0000000..75a51af --- /dev/null +++ b/dbt_artifacts_parser/resources/manifest/manifest_v2.json @@ -0,0 +1,5128 @@ +{ + "title": "Manifest", + "type": "object", + "required": [ + "metadata", + "nodes", + "sources", + "macros", + "docs", + "exposures", + "selectors" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/ManifestMetadata", + "description": "Metadata about the manifest" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledDataTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSchemaTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedDataTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSchemaTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + } + ] + }, + "description": "The nodes defined in the dbt project and its dependencies" + }, + "sources": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedSourceDefinition" + }, + "description": "The sources defined in the dbt project and its dependencies" + }, + "macros": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedMacro" + }, + "description": "The macros defined in the dbt project and its dependencies" + }, + "docs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedDocumentation" + }, + "description": "The docs defined in the dbt project and its dependencies" + }, + "exposures": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedExposure" + }, + "description": "The exposures defined in the dbt project and its dependencies" + }, + "selectors": { + "type": "object", + "description": "The selectors defined in selectors.yml" + }, + "disabled": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledDataTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSchemaTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedDataTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSchemaTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedSourceDefinition" + } + ] + } + }, + { + "type": "null" + } + ], + "description": "A list of the disabled nodes in the target" + }, + "parent_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from\u00a0child nodes to their dependencies" + }, + "child_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from parent nodes to their dependents" + } + }, + "additionalProperties": false, + "description": "WritableManifest(metadata: dbt.contracts.graph.manifest.ManifestMetadata, nodes: Mapping[str, Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledDataTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSchemaTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedDataTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSchemaTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode]], sources: Mapping[str, dbt.contracts.graph.parsed.ParsedSourceDefinition], macros: Mapping[str, dbt.contracts.graph.parsed.ParsedMacro], docs: Mapping[str, dbt.contracts.graph.parsed.ParsedDocumentation], exposures: Mapping[str, dbt.contracts.graph.parsed.ParsedExposure], selectors: Mapping[str, Any], disabled: Union[List[Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledDataTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSchemaTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedDataTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSchemaTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode, dbt.contracts.graph.parsed.ParsedSourceDefinition]], NoneType], parent_map: Union[Dict[str, List[str]], NoneType], child_map: Union[Dict[str, List[str]], NoneType])", + "definitions": { + "ManifestMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/manifest/v2.json" + }, + "dbt_version": { + "type": "string", + "default": "0.20.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-06-07T14:49:01.099700Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "project_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the project" + }, + "user_id": { + "oneOf": [ + { + "type": "string", + "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the user" + }, + "send_anonymous_usage_stats": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether dbt is configured to send anonymous usage statistics" + }, + "adapter_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The type name of the adapter" + } + }, + "additionalProperties": false, + "description": "Metadata for the manifest." + }, + "CompiledAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledAnalysisNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "FileHash": { + "type": "object", + "required": [ + "name", + "checksum" + ], + "properties": { + "name": { + "type": "string" + }, + "checksum": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "FileHash(name: str, checksum: str)" + }, + "NodeConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "view" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "NodeConfig(_extra: Dict[str, Any] = , enabled: bool = True, materialized: str = 'view', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , vars: Dict[str, Any] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , full_refresh: Union[bool, NoneType] = None)" + }, + "Hook": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Hook(sql: str, transaction: bool = True, index: Union[int, NoneType] = None)" + }, + "DependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "DependsOn(macros: List[str] = , nodes: List[str] = )" + }, + "ColumnInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "data_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "quote": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": true, + "description": "ColumnInfo(name: str, description: str = '', meta: Dict[str, Any] = , data_type: Union[str, NoneType] = None, quote: Union[bool, NoneType] = None, tags: List[str] = , _extra: Dict[str, Any] = )" + }, + "Docs": { + "type": "object", + "required": [], + "properties": { + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "description": "Docs(show: bool = True)" + }, + "InjectedCTE": { + "type": "object", + "required": [ + "id", + "sql" + ], + "properties": { + "id": { + "type": "string" + }, + "sql": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "InjectedCTE(id: str, sql: str)" + }, + "CompiledDataTestNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledDataTestNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "TestConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "test" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "dbt_test__audit" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "severity": { + "type": "string", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$", + "default": "ERROR" + }, + "store_failures": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "where": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "limit": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "fail_calc": { + "type": "string", + "default": "count(*)" + }, + "warn_if": { + "type": "string", + "default": "!= 0" + }, + "error_if": { + "type": "string", + "default": "!= 0" + } + }, + "additionalProperties": true, + "description": "TestConfig(_extra: Dict[str, Any] = , enabled: bool = True, materialized: str = 'test', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , vars: Dict[str, Any] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = 'dbt_test__audit', database: Union[str, NoneType] = None, tags: Union[List[str], str] = , full_refresh: Union[bool, NoneType] = None, severity: dbt.contracts.graph.model_config.Severity = 'ERROR', store_failures: Union[bool, NoneType] = None, where: Union[str, NoneType] = None, limit: Union[int, NoneType] = None, fail_calc: str = 'count(*)', warn_if: str = '!= 0', error_if: str = '!= 0')" + }, + "CompiledModelNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledModelNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledHookNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledHookNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None, index: Union[int, NoneType] = None)" + }, + "CompiledRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledRPCNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledSchemaTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSchemaTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None, column_name: Union[str, NoneType] = None)" + }, + "TestMetadata": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "kwargs": { + "type": "object", + "default": {} + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TestMetadata(name: str, kwargs: Dict[str, Any] = , namespace: Union[str, NoneType] = None)" + }, + "CompiledSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "materialized": "seed", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "quote_columns": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSeedNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "SeedConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "seed" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "quote_columns": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SeedConfig(_extra: Dict[str, Any] = , enabled: bool = True, materialized: str = 'seed', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , vars: Dict[str, Any] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , full_refresh: Union[bool, NoneType] = None, quote_columns: Union[bool, NoneType] = None)" + }, + "CompiledSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSnapshotNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "ParsedAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedAnalysisNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = )" + }, + "ParsedDataTestNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedDataTestNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = )" + }, + "ParsedHookNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedHookNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , index: Union[int, NoneType] = None)" + }, + "ParsedModelNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedModelNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = )" + }, + "ParsedRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "materialized": "view", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedRPCNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = )" + }, + "ParsedSchemaTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "materialized": "test", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "full_refresh": null, + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedSchemaTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , column_name: Union[str, NoneType] = None)" + }, + "ParsedSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "materialized": "seed", + "persist_docs": {}, + "vars": {}, + "quoting": {}, + "column_types": {}, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "full_refresh": null, + "quote_columns": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedSeedNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = )" + }, + "ParsedSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum", + "config" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SnapshotConfig" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedSnapshotNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SnapshotConfig, tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = )" + }, + "SnapshotConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "materialized": { + "type": "string", + "default": "snapshot" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "vars": { + "type": "object", + "default": {} + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "strategy": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unique_key": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "target_schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "target_database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "updated_at": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "check_cols": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SnapshotConfig(_extra: Dict[str, Any] = , enabled: bool = True, materialized: str = 'snapshot', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , vars: Dict[str, Any] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , full_refresh: Union[bool, NoneType] = None, strategy: Union[str, NoneType] = None, unique_key: Union[str, NoneType] = None, target_schema: Union[str, NoneType] = None, target_database: Union[str, NoneType] = None, updated_at: Union[str, NoneType] = None, check_cols: Union[str, List[str], NoneType] = None)" + }, + "ParsedSourceDefinition": { + "type": "object", + "required": [ + "fqn", + "schema", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "source_name", + "source_description", + "loader", + "identifier", + "resource_type" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source_name": { + "type": "string" + }, + "source_description": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "source" + ] + }, + "quoting": { + "$ref": "#/definitions/Quoting", + "default": { + "database": null, + "schema": null, + "identifier": null, + "column": null + } + }, + "loaded_at_field": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "freshness": { + "oneOf": [ + { + "$ref": "#/definitions/FreshnessThreshold" + }, + { + "type": "null" + } + ] + }, + "external": { + "oneOf": [ + { + "$ref": "#/definitions/ExternalTable" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "source_meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "config": { + "$ref": "#/definitions/SourceConfig", + "default": { + "enabled": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedSourceDefinition(fqn: List[str], database: Union[str, NoneType], schema: str, unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, source_name: str, source_description: str, loader: str, identifier: str, resource_type: dbt.node_types.NodeType, quoting: dbt.contracts.graph.unparsed.Quoting = , loaded_at_field: Union[str, NoneType] = None, freshness: Union[dbt.contracts.graph.unparsed.FreshnessThreshold, NoneType] = None, external: Union[dbt.contracts.graph.unparsed.ExternalTable, NoneType] = None, description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , source_meta: Dict[str, Any] = , tags: List[str] = , config: dbt.contracts.graph.model_config.SourceConfig = , patch_path: Union[pathlib.Path, NoneType] = None, unrendered_config: Dict[str, Any] = , relation_name: Union[str, NoneType] = None, created_at: int = )" + }, + "Quoting": { + "type": "object", + "required": [], + "properties": { + "database": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "identifier": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "column": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Quoting(database: Union[bool, NoneType] = None, schema: Union[bool, NoneType] = None, identifier: Union[bool, NoneType] = None, column: Union[bool, NoneType] = None)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, filter: Union[str, NoneType] = None)" + }, + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v1.json" + }, + "dbt_version": { + "type": "string", + "default": "0.20.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-06-07T14:49:01.095724Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '0.20.0rc1', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any])" + }, + "Time": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false, + "description": "Time(count: int, period: dbt.contracts.graph.unparsed.TimePeriod)" + }, + "ExternalTable": { + "type": "object", + "required": [], + "properties": { + "location": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "file_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "row_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tbl_properties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "partitions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalPartition" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "ExternalTable(_extra: Dict[str, Any] = , location: Union[str, NoneType] = None, file_format: Union[str, NoneType] = None, row_format: Union[str, NoneType] = None, tbl_properties: Union[str, NoneType] = None, partitions: Union[List[dbt.contracts.graph.unparsed.ExternalPartition], NoneType] = None)" + }, + "ExternalPartition": { + "type": "object", + "required": [], + "properties": { + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "data_type": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + } + }, + "additionalProperties": true, + "description": "ExternalPartition(_extra: Dict[str, Any] = , name: str = '', description: str = '', data_type: str = '', meta: Dict[str, Any] = )" + }, + "SourceConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": true, + "description": "SourceConfig(_extra: Dict[str, Any] = , enabled: bool = True)" + }, + "ParsedMacro": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "macro_sql", + "resource_type" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "macro_sql": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "macro" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/MacroDependsOn", + "default": { + "macros": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/definitions/MacroArgument" + }, + "default": [] + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedMacro(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, macro_sql: str, resource_type: dbt.node_types.NodeType, tags: List[str] = , depends_on: dbt.contracts.graph.parsed.MacroDependsOn = , description: str = '', meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, arguments: List[dbt.contracts.graph.unparsed.MacroArgument] = , created_at: int = )" + }, + "MacroDependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "MacroDependsOn(macros: List[str] = )" + }, + "MacroArgument": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + } + }, + "additionalProperties": false, + "description": "MacroArgument(name: str, type: Union[str, NoneType] = None, description: str = '')" + }, + "ParsedDocumentation": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "block_contents" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "block_contents": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "ParsedDocumentation(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, block_contents: str)" + }, + "ParsedExposure": { + "type": "object", + "required": [ + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "type", + "owner" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "owner": { + "$ref": "#/definitions/ExposureOwner" + }, + "resource_type": { + "type": "string", + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "docs", + "source", + "macro", + "exposure" + ], + "default": "exposure" + }, + "description": { + "type": "string", + "default": "" + }, + "maturity": { + "oneOf": [ + { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + { + "type": "null" + } + ] + }, + "meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "url": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "created_at": { + "type": "integer", + "default": 1623077341 + } + }, + "additionalProperties": false, + "description": "ParsedExposure(fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, type: dbt.contracts.graph.unparsed.ExposureType, owner: dbt.contracts.graph.unparsed.ExposureOwner, resource_type: dbt.node_types.NodeType = , description: str = '', maturity: Union[dbt.contracts.graph.unparsed.MaturityType, NoneType] = None, meta: Dict[str, Any] = , tags: List[str] = , url: Union[str, NoneType] = None, depends_on: dbt.contracts.graph.parsed.DependsOn = , refs: List[List[str]] = , sources: List[List[str]] = , created_at: int = )" + }, + "ExposureOwner": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ExposureOwner(email: str, name: Union[str, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/manifest/v2.json" +} diff --git a/dbt_artifacts_parser/resources/manifest/manifest_v3.json b/dbt_artifacts_parser/resources/manifest/manifest_v3.json new file mode 100644 index 0000000..d94b504 --- /dev/null +++ b/dbt_artifacts_parser/resources/manifest/manifest_v3.json @@ -0,0 +1,5225 @@ +{ + "type": "object", + "required": [ + "metadata", + "nodes", + "sources", + "macros", + "docs", + "exposures", + "selectors" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/ManifestMetadata", + "description": "Metadata about the manifest" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledDataTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSchemaTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedDataTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSchemaTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + } + ] + }, + "description": "The nodes defined in the dbt project and its dependencies" + }, + "sources": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedSourceDefinition" + }, + "description": "The sources defined in the dbt project and its dependencies" + }, + "macros": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedMacro" + }, + "description": "The macros defined in the dbt project and its dependencies" + }, + "docs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedDocumentation" + }, + "description": "The docs defined in the dbt project and its dependencies" + }, + "exposures": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedExposure" + }, + "description": "The exposures defined in the dbt project and its dependencies" + }, + "selectors": { + "type": "object", + "description": "The selectors defined in selectors.yml" + }, + "disabled": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledDataTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSchemaTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedDataTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSchemaTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedSourceDefinition" + } + ] + } + }, + { + "type": "null" + } + ], + "description": "A list of the disabled nodes in the target" + }, + "parent_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from\u00a0child nodes to their dependencies" + }, + "child_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from parent nodes to their dependents" + } + }, + "additionalProperties": false, + "description": "WritableManifest(metadata: dbt.contracts.graph.manifest.ManifestMetadata, nodes: Mapping[str, Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledDataTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSchemaTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedDataTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSchemaTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode]], sources: Mapping[str, dbt.contracts.graph.parsed.ParsedSourceDefinition], macros: Mapping[str, dbt.contracts.graph.parsed.ParsedMacro], docs: Mapping[str, dbt.contracts.graph.parsed.ParsedDocumentation], exposures: Mapping[str, dbt.contracts.graph.parsed.ParsedExposure], selectors: Mapping[str, Any], disabled: Union[List[Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledDataTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSchemaTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedDataTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSchemaTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode, dbt.contracts.graph.parsed.ParsedSourceDefinition]], NoneType], parent_map: Union[Dict[str, List[str]], NoneType], child_map: Union[Dict[str, List[str]], NoneType])", + "definitions": { + "ManifestMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/manifest/v3.json" + }, + "dbt_version": { + "type": "string", + "default": "0.21.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-09-24T13:29:14.317700Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "project_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the project" + }, + "user_id": { + "oneOf": [ + { + "type": "string", + "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the user" + }, + "send_anonymous_usage_stats": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether dbt is configured to send anonymous usage statistics" + }, + "adapter_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The type name of the adapter" + } + }, + "additionalProperties": false, + "description": "Metadata for the manifest." + }, + "CompiledAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledAnalysisNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "FileHash": { + "type": "object", + "required": [ + "name", + "checksum" + ], + "properties": { + "name": { + "type": "string" + }, + "checksum": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "FileHash(name: str, checksum: str)" + }, + "NodeConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "view" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "on_schema_change": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + } + }, + "additionalProperties": true, + "description": "NodeConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'view', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , full_refresh: Union[bool, NoneType] = None, on_schema_change: Union[str, NoneType] = 'ignore')" + }, + "Hook": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Hook(sql: str, transaction: bool = True, index: Union[int, NoneType] = None)" + }, + "DependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "DependsOn(macros: List[str] = , nodes: List[str] = )" + }, + "ColumnInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "data_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "quote": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": true, + "description": "ColumnInfo(name: str, description: str = '', meta: Dict[str, Any] = , data_type: Union[str, NoneType] = None, quote: Union[bool, NoneType] = None, tags: List[str] = , _extra: Dict[str, Any] = )" + }, + "Docs": { + "type": "object", + "required": [], + "properties": { + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "description": "Docs(show: bool = True)" + }, + "InjectedCTE": { + "type": "object", + "required": [ + "id", + "sql" + ], + "properties": { + "id": { + "type": "string" + }, + "sql": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "InjectedCTE(id: str, sql: str)" + }, + "CompiledDataTestNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledDataTestNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "TestConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "dbt_test__audit" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "test" + }, + "severity": { + "type": "string", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$", + "default": "ERROR" + }, + "store_failures": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "where": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "limit": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "fail_calc": { + "type": "string", + "default": "count(*)" + }, + "warn_if": { + "type": "string", + "default": "!= 0" + }, + "error_if": { + "type": "string", + "default": "!= 0" + } + }, + "additionalProperties": true, + "description": "TestConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = 'dbt_test__audit', database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'test', severity: dbt.contracts.graph.model_config.Severity = 'ERROR', store_failures: Union[bool, NoneType] = None, where: Union[str, NoneType] = None, limit: Union[int, NoneType] = None, fail_calc: str = 'count(*)', warn_if: str = '!= 0', error_if: str = '!= 0')" + }, + "CompiledModelNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledModelNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledHookNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledHookNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None, index: Union[int, NoneType] = None)" + }, + "CompiledRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledRPCNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledSchemaTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSchemaTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None, column_name: Union[str, NoneType] = None)" + }, + "TestMetadata": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "kwargs": { + "type": "object", + "default": {} + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TestMetadata(name: str, kwargs: Dict[str, Any] = , namespace: Union[str, NoneType] = None)" + }, + "CompiledSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "seed", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "quote_columns": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSeedNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "SeedConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "seed" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "on_schema_change": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "quote_columns": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SeedConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'seed', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , full_refresh: Union[bool, NoneType] = None, on_schema_change: Union[str, NoneType] = 'ignore', quote_columns: Union[bool, NoneType] = None)" + }, + "CompiledSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSnapshotNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "ParsedAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedAnalysisNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedDataTestNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedDataTestNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedHookNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedHookNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , index: Union[int, NoneType] = None)" + }, + "ParsedModelNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedModelNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedRPCNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedSchemaTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedSchemaTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = , column_name: Union[str, NoneType] = None)" + }, + "ParsedSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "seed", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "quote_columns": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSeedNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum", + "config" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SnapshotConfig" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "integer", + "default": 1632490154 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSnapshotNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SnapshotConfig, tags: List[str] = , refs: List[List[str]] = , sources: List[List[Any]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: int = , config_call_dict: Dict[str, Any] = )" + }, + "SnapshotConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "snapshot" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "on_schema_change": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "strategy": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unique_key": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "target_schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "target_database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "updated_at": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "check_cols": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SnapshotConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'snapshot', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , full_refresh: Union[bool, NoneType] = None, on_schema_change: Union[str, NoneType] = 'ignore', strategy: Union[str, NoneType] = None, unique_key: Union[str, NoneType] = None, target_schema: Union[str, NoneType] = None, target_database: Union[str, NoneType] = None, updated_at: Union[str, NoneType] = None, check_cols: Union[str, List[str], NoneType] = None)" + }, + "ParsedSourceDefinition": { + "type": "object", + "required": [ + "fqn", + "schema", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "source_name", + "source_description", + "loader", + "identifier", + "resource_type" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source_name": { + "type": "string" + }, + "source_description": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "source" + ] + }, + "quoting": { + "$ref": "#/definitions/Quoting", + "default": { + "database": null, + "schema": null, + "identifier": null, + "column": null + } + }, + "loaded_at_field": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "freshness": { + "oneOf": [ + { + "$ref": "#/definitions/FreshnessThreshold" + }, + { + "type": "null" + } + ] + }, + "external": { + "oneOf": [ + { + "$ref": "#/definitions/ExternalTable" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "source_meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "config": { + "$ref": "#/definitions/SourceConfig", + "default": { + "enabled": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "integer", + "default": 1632490154 + } + }, + "additionalProperties": false, + "description": "ParsedSourceDefinition(fqn: List[str], database: Union[str, NoneType], schema: str, unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, source_name: str, source_description: str, loader: str, identifier: str, resource_type: dbt.node_types.NodeType, quoting: dbt.contracts.graph.unparsed.Quoting = , loaded_at_field: Union[str, NoneType] = None, freshness: Union[dbt.contracts.graph.unparsed.FreshnessThreshold, NoneType] = None, external: Union[dbt.contracts.graph.unparsed.ExternalTable, NoneType] = None, description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , source_meta: Dict[str, Any] = , tags: List[str] = , config: dbt.contracts.graph.model_config.SourceConfig = , patch_path: Union[pathlib.Path, NoneType] = None, unrendered_config: Dict[str, Any] = , relation_name: Union[str, NoneType] = None, created_at: int = )" + }, + "Quoting": { + "type": "object", + "required": [], + "properties": { + "database": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "identifier": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "column": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Quoting(database: Union[bool, NoneType] = None, schema: Union[bool, NoneType] = None, identifier: Union[bool, NoneType] = None, column: Union[bool, NoneType] = None)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, filter: Union[str, NoneType] = None)" + }, + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v2.json" + }, + "dbt_version": { + "type": "string", + "default": "0.21.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-09-24T13:29:14.312598Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '0.21.0rc1', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response", + "timing", + "thread_id", + "execution_time" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float)" + }, + "Time": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false, + "description": "Time(count: int, period: dbt.contracts.graph.unparsed.TimePeriod)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + }, + "ExternalTable": { + "type": "object", + "required": [], + "properties": { + "location": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "file_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "row_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tbl_properties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "partitions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalPartition" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "ExternalTable(_extra: Dict[str, Any] = , location: Union[str, NoneType] = None, file_format: Union[str, NoneType] = None, row_format: Union[str, NoneType] = None, tbl_properties: Union[str, NoneType] = None, partitions: Union[List[dbt.contracts.graph.unparsed.ExternalPartition], NoneType] = None)" + }, + "ExternalPartition": { + "type": "object", + "required": [], + "properties": { + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "data_type": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + } + }, + "additionalProperties": true, + "description": "ExternalPartition(_extra: Dict[str, Any] = , name: str = '', description: str = '', data_type: str = '', meta: Dict[str, Any] = )" + }, + "SourceConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": true, + "description": "SourceConfig(_extra: Dict[str, Any] = , enabled: bool = True)" + }, + "ParsedMacro": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "macro_sql", + "resource_type" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "macro_sql": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "macro" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/MacroDependsOn", + "default": { + "macros": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/definitions/MacroArgument" + }, + "default": [] + }, + "created_at": { + "type": "integer", + "default": 1632490154 + } + }, + "additionalProperties": false, + "description": "ParsedMacro(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, macro_sql: str, resource_type: dbt.node_types.NodeType, tags: List[str] = , depends_on: dbt.contracts.graph.parsed.MacroDependsOn = , description: str = '', meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, arguments: List[dbt.contracts.graph.unparsed.MacroArgument] = , created_at: int = )" + }, + "MacroDependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "MacroDependsOn(macros: List[str] = )" + }, + "MacroArgument": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + } + }, + "additionalProperties": false, + "description": "MacroArgument(name: str, type: Union[str, NoneType] = None, description: str = '')" + }, + "ParsedDocumentation": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "block_contents" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "block_contents": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "ParsedDocumentation(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, block_contents: str)" + }, + "ParsedExposure": { + "type": "object", + "required": [ + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "type", + "owner" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "owner": { + "$ref": "#/definitions/ExposureOwner" + }, + "resource_type": { + "type": "string", + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "docs", + "source", + "macro", + "exposure" + ], + "default": "exposure" + }, + "description": { + "type": "string", + "default": "" + }, + "maturity": { + "oneOf": [ + { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + { + "type": "null" + } + ] + }, + "meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "url": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "created_at": { + "type": "integer", + "default": 1632490154 + } + }, + "additionalProperties": false, + "description": "ParsedExposure(fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, type: dbt.contracts.graph.unparsed.ExposureType, owner: dbt.contracts.graph.unparsed.ExposureOwner, resource_type: dbt.node_types.NodeType = , description: str = '', maturity: Union[dbt.contracts.graph.unparsed.MaturityType, NoneType] = None, meta: Dict[str, Any] = , tags: List[str] = , url: Union[str, NoneType] = None, depends_on: dbt.contracts.graph.parsed.DependsOn = , refs: List[List[str]] = , sources: List[List[str]] = , created_at: int = )" + }, + "ExposureOwner": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ExposureOwner(email: str, name: Union[str, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/manifest/v3.json" +} \ No newline at end of file diff --git a/dbt_artifacts_parser/resources/manifest/manifest_v4.json b/dbt_artifacts_parser/resources/manifest/manifest_v4.json new file mode 100644 index 0000000..6db292f --- /dev/null +++ b/dbt_artifacts_parser/resources/manifest/manifest_v4.json @@ -0,0 +1,5939 @@ +{ + "type": "object", + "required": [ + "metadata", + "nodes", + "sources", + "macros", + "docs", + "exposures", + "metrics", + "selectors" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/ManifestMetadata", + "description": "Metadata about the manifest" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledSingularTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSqlNode" + }, + { + "$ref": "#/definitions/CompiledGenericTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedSingularTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSqlNode" + }, + { + "$ref": "#/definitions/ParsedGenericTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + } + ] + }, + "description": "The nodes defined in the dbt project and its dependencies" + }, + "sources": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedSourceDefinition" + }, + "description": "The sources defined in the dbt project and its dependencies" + }, + "macros": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedMacro" + }, + "description": "The macros defined in the dbt project and its dependencies" + }, + "docs": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedDocumentation" + }, + "description": "The docs defined in the dbt project and its dependencies" + }, + "exposures": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedExposure" + }, + "description": "The exposures defined in the dbt project and its dependencies" + }, + "metrics": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ParsedMetric" + }, + "description": "The metrics defined in the dbt project and its dependencies" + }, + "selectors": { + "type": "object", + "description": "The selectors defined in selectors.yml" + }, + "disabled": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/CompiledAnalysisNode" + }, + { + "$ref": "#/definitions/CompiledSingularTestNode" + }, + { + "$ref": "#/definitions/CompiledModelNode" + }, + { + "$ref": "#/definitions/CompiledHookNode" + }, + { + "$ref": "#/definitions/CompiledRPCNode" + }, + { + "$ref": "#/definitions/CompiledSqlNode" + }, + { + "$ref": "#/definitions/CompiledGenericTestNode" + }, + { + "$ref": "#/definitions/CompiledSeedNode" + }, + { + "$ref": "#/definitions/CompiledSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedAnalysisNode" + }, + { + "$ref": "#/definitions/ParsedSingularTestNode" + }, + { + "$ref": "#/definitions/ParsedHookNode" + }, + { + "$ref": "#/definitions/ParsedModelNode" + }, + { + "$ref": "#/definitions/ParsedRPCNode" + }, + { + "$ref": "#/definitions/ParsedSqlNode" + }, + { + "$ref": "#/definitions/ParsedGenericTestNode" + }, + { + "$ref": "#/definitions/ParsedSeedNode" + }, + { + "$ref": "#/definitions/ParsedSnapshotNode" + }, + { + "$ref": "#/definitions/ParsedSourceDefinition" + } + ] + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping of the disabled nodes in the target" + }, + "parent_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from\u00a0child nodes to their dependencies" + }, + "child_map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "description": "A mapping from parent nodes to their dependents" + } + }, + "additionalProperties": false, + "description": "WritableManifest(metadata: dbt.contracts.graph.manifest.ManifestMetadata, nodes: Mapping[str, Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledSingularTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSqlNode, dbt.contracts.graph.compiled.CompiledGenericTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedSingularTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSqlNode, dbt.contracts.graph.parsed.ParsedGenericTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode]], sources: Mapping[str, dbt.contracts.graph.parsed.ParsedSourceDefinition], macros: Mapping[str, dbt.contracts.graph.parsed.ParsedMacro], docs: Mapping[str, dbt.contracts.graph.parsed.ParsedDocumentation], exposures: Mapping[str, dbt.contracts.graph.parsed.ParsedExposure], metrics: Mapping[str, dbt.contracts.graph.parsed.ParsedMetric], selectors: Mapping[str, Any], disabled: Union[Mapping[str, List[Union[dbt.contracts.graph.compiled.CompiledAnalysisNode, dbt.contracts.graph.compiled.CompiledSingularTestNode, dbt.contracts.graph.compiled.CompiledModelNode, dbt.contracts.graph.compiled.CompiledHookNode, dbt.contracts.graph.compiled.CompiledRPCNode, dbt.contracts.graph.compiled.CompiledSqlNode, dbt.contracts.graph.compiled.CompiledGenericTestNode, dbt.contracts.graph.compiled.CompiledSeedNode, dbt.contracts.graph.compiled.CompiledSnapshotNode, dbt.contracts.graph.parsed.ParsedAnalysisNode, dbt.contracts.graph.parsed.ParsedSingularTestNode, dbt.contracts.graph.parsed.ParsedHookNode, dbt.contracts.graph.parsed.ParsedModelNode, dbt.contracts.graph.parsed.ParsedRPCNode, dbt.contracts.graph.parsed.ParsedSqlNode, dbt.contracts.graph.parsed.ParsedGenericTestNode, dbt.contracts.graph.parsed.ParsedSeedNode, dbt.contracts.graph.parsed.ParsedSnapshotNode, dbt.contracts.graph.parsed.ParsedSourceDefinition]]], NoneType], parent_map: Union[Dict[str, List[str]], NoneType], child_map: Union[Dict[str, List[str]], NoneType])", + "definitions": { + "ManifestMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/manifest/v4.json" + }, + "dbt_version": { + "type": "string", + "default": "1.0.0rc2" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-11-30T01:35:47.307789Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "66dd78f0-c79a-4b06-81b1-99794345df16" + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "project_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the project" + }, + "user_id": { + "oneOf": [ + { + "type": "string", + "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + }, + { + "type": "null" + } + ], + "description": "A unique identifier for the user" + }, + "send_anonymous_usage_stats": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether dbt is configured to send anonymous usage statistics" + }, + "adapter_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The type name of the adapter" + } + }, + "additionalProperties": false, + "description": "Metadata for the manifest." + }, + "CompiledAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.3118432 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledAnalysisNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "FileHash": { + "type": "object", + "required": [ + "name", + "checksum" + ], + "properties": { + "name": { + "type": "string" + }, + "checksum": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "FileHash(name: str, checksum: str)" + }, + "NodeConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "view" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "on_schema_change": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + } + }, + "additionalProperties": true, + "description": "NodeConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'view', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , full_refresh: Union[bool, NoneType] = None, on_schema_change: Union[str, NoneType] = 'ignore')" + }, + "Hook": { + "type": "object", + "required": [ + "sql" + ], + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Hook(sql: str, transaction: bool = True, index: Union[int, NoneType] = None)" + }, + "DependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "DependsOn(macros: List[str] = , nodes: List[str] = )" + }, + "ColumnInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "data_type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "quote": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": true, + "description": "ColumnInfo(name: str, description: str = '', meta: Dict[str, Any] = , data_type: Union[str, NoneType] = None, quote: Union[bool, NoneType] = None, tags: List[str] = , _extra: Dict[str, Any] = )" + }, + "Docs": { + "type": "object", + "required": [], + "properties": { + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "description": "Docs(show: bool = True)" + }, + "InjectedCTE": { + "type": "object", + "required": [ + "id", + "sql" + ], + "properties": { + "id": { + "type": "string" + }, + "sql": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "InjectedCTE(id: str, sql: str)" + }, + "CompiledSingularTestNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.314477 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSingularTestNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "TestConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "dbt_test__audit" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "test" + }, + "severity": { + "type": "string", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$", + "default": "ERROR" + }, + "store_failures": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "where": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "limit": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "fail_calc": { + "type": "string", + "default": "count(*)" + }, + "warn_if": { + "type": "string", + "default": "!= 0" + }, + "error_if": { + "type": "string", + "default": "!= 0" + } + }, + "additionalProperties": true, + "description": "TestConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = 'dbt_test__audit', database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'test', severity: dbt.contracts.graph.model_config.Severity = 'ERROR', store_failures: Union[bool, NoneType] = None, where: Union[str, NoneType] = None, limit: Union[int, NoneType] = None, fail_calc: str = 'count(*)', warn_if: str = '!= 0', error_if: str = '!= 0')" + }, + "CompiledModelNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.315979 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledModelNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledHookNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.317642 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledHookNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None, index: Union[int, NoneType] = None)" + }, + "CompiledRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.319278 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledRPCNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledSqlNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "sql" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.321433 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSqlNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "CompiledGenericTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.323731 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "file_key_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledGenericTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None, column_name: Union[str, NoneType] = None, file_key_name: Union[str, NoneType] = None)" + }, + "TestMetadata": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "kwargs": { + "type": "object", + "default": {} + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TestMetadata(name: str, kwargs: Dict[str, Any] = , namespace: Union[str, NoneType] = None)" + }, + "CompiledSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "seed", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "quote_columns": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.326388 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSeedNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "SeedConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "seed" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "on_schema_change": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "quote_columns": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SeedConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'seed', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , full_refresh: Union[bool, NoneType] = None, on_schema_change: Union[str, NoneType] = 'ignore', quote_columns: Union[bool, NoneType] = None)" + }, + "CompiledSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "compiled", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "compiled": { + "type": "boolean" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.328031 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "compiled_sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "$ref": "#/definitions/InjectedCTE" + }, + "default": [] + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "CompiledSnapshotNode(raw_sql: str, compiled: bool, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , compiled_sql: Union[str, NoneType] = None, extra_ctes_injected: bool = False, extra_ctes: List[dbt.contracts.graph.compiled.InjectedCTE] = , relation_name: Union[str, NoneType] = None, _pre_injected_sql: Union[str, NoneType] = None)" + }, + "ParsedAnalysisNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "analysis" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.329485 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedAnalysisNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedSingularTestNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.3306549 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSingularTestNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedHookNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "operation" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.332001 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "index": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedHookNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , index: Union[int, NoneType] = None)" + }, + "ParsedModelNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "model" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.333348 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedModelNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedRPCNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "rpc" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.335125 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedRPCNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedSqlNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "sql" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/NodeConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.336567 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSqlNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.NodeConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedGenericTestNode": { + "type": "object", + "required": [ + "raw_sql", + "test_metadata", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "test_metadata": { + "$ref": "#/definitions/TestMetadata" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "test" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/TestConfig", + "default": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.3383949 + }, + "config_call_dict": { + "type": "object", + "default": {} + }, + "column_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "file_key_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ParsedGenericTestNode(raw_sql: str, test_metadata: dbt.contracts.graph.parsed.TestMetadata, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.TestConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = , column_name: Union[str, NoneType] = None, file_key_name: Union[str, NoneType] = None)" + }, + "ParsedSeedNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "seed" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SeedConfig", + "default": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "seed", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "on_schema_change": "ignore", + "quote_columns": null, + "post-hook": [], + "pre-hook": [] + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.339838 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSeedNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SeedConfig = , tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "ParsedSnapshotNode": { + "type": "object", + "required": [ + "raw_sql", + "schema", + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "resource_type", + "alias", + "checksum", + "config" + ], + "properties": { + "raw_sql": { + "type": "string" + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "snapshot" + ] + }, + "alias": { + "type": "string" + }, + "checksum": { + "$ref": "#/definitions/FileHash" + }, + "config": { + "$ref": "#/definitions/SnapshotConfig" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "compiled_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "build_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deferred": { + "type": "boolean", + "default": false + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "created_at": { + "type": "number", + "default": 1638236147.3425322 + }, + "config_call_dict": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "ParsedSnapshotNode(raw_sql: str, database: Union[str, NoneType], schema: str, fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, resource_type: dbt.node_types.NodeType, alias: str, checksum: dbt.contracts.files.FileHash, config: dbt.contracts.graph.model_config.SnapshotConfig, tags: List[str] = , refs: List[List[str]] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, compiled_path: Union[str, NoneType] = None, build_path: Union[str, NoneType] = None, deferred: bool = False, unrendered_config: Dict[str, Any] = , created_at: float = , config_call_dict: Dict[str, Any] = )" + }, + "SnapshotConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ], + "default": [] + }, + "meta": { + "type": "object", + "default": {} + }, + "materialized": { + "type": "string", + "default": "snapshot" + }, + "persist_docs": { + "type": "object", + "default": {} + }, + "post-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "pre-hook": { + "type": "array", + "items": { + "$ref": "#/definitions/Hook" + }, + "default": [] + }, + "quoting": { + "type": "object", + "default": {} + }, + "column_types": { + "type": "object", + "default": {} + }, + "full_refresh": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "on_schema_change": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "strategy": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unique_key": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "target_schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "target_database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "updated_at": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "check_cols": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "SnapshotConfig(_extra: Dict[str, Any] = , enabled: bool = True, alias: Union[str, NoneType] = None, schema: Union[str, NoneType] = None, database: Union[str, NoneType] = None, tags: Union[List[str], str] = , meta: Dict[str, Any] = , materialized: str = 'snapshot', persist_docs: Dict[str, Any] = , post_hook: List[dbt.contracts.graph.model_config.Hook] = , pre_hook: List[dbt.contracts.graph.model_config.Hook] = , quoting: Dict[str, Any] = , column_types: Dict[str, Any] = , full_refresh: Union[bool, NoneType] = None, on_schema_change: Union[str, NoneType] = 'ignore', strategy: Union[str, NoneType] = None, unique_key: Union[str, NoneType] = None, target_schema: Union[str, NoneType] = None, target_database: Union[str, NoneType] = None, updated_at: Union[str, NoneType] = None, check_cols: Union[str, List[str], NoneType] = None)" + }, + "ParsedSourceDefinition": { + "type": "object", + "required": [ + "fqn", + "schema", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "source_name", + "source_description", + "loader", + "identifier", + "resource_type" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "database": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "source_name": { + "type": "string" + }, + "source_description": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "source" + ] + }, + "quoting": { + "$ref": "#/definitions/Quoting", + "default": { + "database": null, + "schema": null, + "identifier": null, + "column": null + } + }, + "loaded_at_field": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "freshness": { + "oneOf": [ + { + "$ref": "#/definitions/FreshnessThreshold" + }, + { + "type": "null" + } + ] + }, + "external": { + "oneOf": [ + { + "$ref": "#/definitions/ExternalTable" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + }, + "default": {} + }, + "meta": { + "type": "object", + "default": {} + }, + "source_meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "config": { + "$ref": "#/definitions/SourceConfig", + "default": { + "enabled": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "unrendered_config": { + "type": "object", + "default": {} + }, + "relation_name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_at": { + "type": "number", + "default": 1638236147.345053 + } + }, + "additionalProperties": false, + "description": "ParsedSourceDefinition(fqn: List[str], database: Union[str, NoneType], schema: str, unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, source_name: str, source_description: str, loader: str, identifier: str, resource_type: dbt.node_types.NodeType, quoting: dbt.contracts.graph.unparsed.Quoting = , loaded_at_field: Union[str, NoneType] = None, freshness: Union[dbt.contracts.graph.unparsed.FreshnessThreshold, NoneType] = None, external: Union[dbt.contracts.graph.unparsed.ExternalTable, NoneType] = None, description: str = '', columns: Dict[str, dbt.contracts.graph.parsed.ColumnInfo] = , meta: Dict[str, Any] = , source_meta: Dict[str, Any] = , tags: List[str] = , config: dbt.contracts.graph.model_config.SourceConfig = , patch_path: Union[pathlib.Path, NoneType] = None, unrendered_config: Dict[str, Any] = , relation_name: Union[str, NoneType] = None, created_at: float = )" + }, + "Quoting": { + "type": "object", + "required": [], + "properties": { + "database": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "schema": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "identifier": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "column": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Quoting(database: Union[bool, NoneType] = None, schema: Union[bool, NoneType] = None, identifier: Union[bool, NoneType] = None, column: Union[bool, NoneType] = None)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ], + "default": { + "count": null, + "period": null + } + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ], + "default": { + "count": null, + "period": null + } + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = , error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = , filter: Union[str, NoneType] = None)" + }, + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v3.json" + }, + "dbt_version": { + "type": "string", + "default": "1.0.0rc2" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-11-30T01:35:47.301745Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "66dd78f0-c79a-4b06-81b1-99794345df16" + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '1.0.0rc2', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response", + "timing", + "thread_id", + "execution_time" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float)" + }, + "Time": { + "type": "object", + "required": [], + "properties": { + "count": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "period": { + "oneOf": [ + { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Time(count: Union[int, NoneType] = None, period: Union[dbt.contracts.graph.unparsed.TimePeriod, NoneType] = None)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + }, + "ExternalTable": { + "type": "object", + "required": [], + "properties": { + "location": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "file_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "row_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tbl_properties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "partitions": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalPartition" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true, + "description": "ExternalTable(_extra: Dict[str, Any] = , location: Union[str, NoneType] = None, file_format: Union[str, NoneType] = None, row_format: Union[str, NoneType] = None, tbl_properties: Union[str, NoneType] = None, partitions: Union[List[dbt.contracts.graph.unparsed.ExternalPartition], NoneType] = None)" + }, + "ExternalPartition": { + "type": "object", + "required": [], + "properties": { + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "data_type": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + } + }, + "additionalProperties": true, + "description": "ExternalPartition(_extra: Dict[str, Any] = , name: str = '', description: str = '', data_type: str = '', meta: Dict[str, Any] = )" + }, + "SourceConfig": { + "type": "object", + "required": [], + "properties": { + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": true, + "description": "SourceConfig(_extra: Dict[str, Any] = , enabled: bool = True)" + }, + "ParsedMacro": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "macro_sql", + "resource_type" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "macro_sql": { + "type": "string" + }, + "resource_type": { + "type": "string", + "enum": [ + "macro" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/MacroDependsOn", + "default": { + "macros": [] + } + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "default": {} + }, + "docs": { + "$ref": "#/definitions/Docs", + "default": { + "show": true + } + }, + "patch_path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "arguments": { + "type": "array", + "items": { + "$ref": "#/definitions/MacroArgument" + }, + "default": [] + }, + "created_at": { + "type": "number", + "default": 1638236147.345993 + } + }, + "additionalProperties": false, + "description": "ParsedMacro(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, macro_sql: str, resource_type: dbt.node_types.NodeType, tags: List[str] = , depends_on: dbt.contracts.graph.parsed.MacroDependsOn = , description: str = '', meta: Dict[str, Any] = , docs: dbt.contracts.graph.unparsed.Docs = , patch_path: Union[str, NoneType] = None, arguments: List[dbt.contracts.graph.unparsed.MacroArgument] = , created_at: float = )" + }, + "MacroDependsOn": { + "type": "object", + "required": [], + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false, + "description": "MacroDependsOn(macros: List[str] = )" + }, + "MacroArgument": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string", + "default": "" + } + }, + "additionalProperties": false, + "description": "MacroArgument(name: str, type: Union[str, NoneType] = None, description: str = '')" + }, + "ParsedDocumentation": { + "type": "object", + "required": [ + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "block_contents" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "block_contents": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "ParsedDocumentation(unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, block_contents: str)" + }, + "ParsedExposure": { + "type": "object", + "required": [ + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "name", + "type", + "owner" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "owner": { + "$ref": "#/definitions/ExposureOwner" + }, + "resource_type": { + "type": "string", + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql", + "docs", + "source", + "macro", + "exposure", + "metric" + ], + "default": "exposure" + }, + "description": { + "type": "string", + "default": "" + }, + "maturity": { + "oneOf": [ + { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + { + "type": "null" + } + ] + }, + "meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "url": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "created_at": { + "type": "number", + "default": 1638236147.347234 + } + }, + "additionalProperties": false, + "description": "ParsedExposure(fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, name: str, type: dbt.contracts.graph.unparsed.ExposureType, owner: dbt.contracts.graph.unparsed.ExposureOwner, resource_type: dbt.node_types.NodeType = , description: str = '', maturity: Union[dbt.contracts.graph.unparsed.MaturityType, NoneType] = None, meta: Dict[str, Any] = , tags: List[str] = , url: Union[str, NoneType] = None, depends_on: dbt.contracts.graph.parsed.DependsOn = , refs: List[List[str]] = , sources: List[List[str]] = , created_at: float = )" + }, + "ExposureOwner": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "ExposureOwner(email: str, name: Union[str, NoneType] = None)" + }, + "ParsedMetric": { + "type": "object", + "required": [ + "fqn", + "unique_id", + "package_name", + "root_path", + "path", + "original_file_path", + "model", + "name", + "description", + "label", + "type", + "filters", + "time_grains", + "dimensions" + ], + "properties": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "unique_id": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "root_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "model": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "type": { + "type": "string" + }, + "sql": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "timestamp": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricFilter" + } + }, + "time_grains": { + "type": "array", + "items": { + "type": "string" + } + }, + "dimensions": { + "type": "array", + "items": { + "type": "string" + } + }, + "resource_type": { + "type": "string", + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql", + "docs", + "source", + "macro", + "exposure", + "metric" + ], + "default": "metric" + }, + "meta": { + "type": "object", + "default": {} + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "depends_on": { + "$ref": "#/definitions/DependsOn", + "default": { + "macros": [], + "nodes": [] + } + }, + "refs": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": [] + }, + "created_at": { + "type": "number", + "default": 1638236147.348404 + } + }, + "additionalProperties": false, + "description": "ParsedMetric(fqn: List[str], unique_id: str, package_name: str, root_path: str, path: str, original_file_path: str, model: str, name: str, description: str, label: str, type: str, sql: Union[str, NoneType], timestamp: Union[str, NoneType], filters: List[dbt.contracts.graph.unparsed.MetricFilter], time_grains: List[str], dimensions: List[str], resource_type: dbt.node_types.NodeType = , meta: Dict[str, Any] = , tags: List[str] = , sources: List[List[str]] = , depends_on: dbt.contracts.graph.parsed.DependsOn = , refs: List[List[str]] = , created_at: float = )" + }, + "MetricFilter": { + "type": "object", + "required": [ + "field", + "operator", + "value" + ], + "properties": { + "field": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "MetricFilter(field: str, operator: str, value: str)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/manifest/v4.json" +} \ No newline at end of file diff --git a/dbt_artifacts_parser/resources/run-results/run-results_v1.json b/dbt_artifacts_parser/resources/run-results/run-results_v1.json new file mode 100644 index 0000000..38b4d02 --- /dev/null +++ b/dbt_artifacts_parser/resources/run-results/run-results_v1.json @@ -0,0 +1,183 @@ +{ + "title": "Run Results", + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/BaseArtifactMetadata" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RunResultOutput" + } + }, + "elapsed_time": { + "type": "number" + }, + "args": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "RunResultsArtifact(metadata: dbt.contracts.util.BaseArtifactMetadata, results: Sequence[dbt.contracts.results.RunResultOutput], elapsed_time: float, args: Dict[str, Any] = )", + "definitions": { + "BaseArtifactMetadata": { + "type": "object", + "required": [ + "dbt_schema_version" + ], + "properties": { + "dbt_schema_version": { + "type": "string" + }, + "dbt_version": { + "type": "string", + "default": "0.19.0" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-02-10T04:42:33.678063Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "BaseArtifactMetadata(dbt_schema_version: str, dbt_version: str = '0.19.0', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "RunResultOutput": { + "type": "object", + "required": [ + "status", + "timing", + "thread_id", + "execution_time", + "adapter_response", + "unique_id" + ], + "properties": { + "status": { + "oneOf": [ + { + "type": "string", + "enum": [ + "success", + "error", + "skipped" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "error", + "fail", + "warn" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + } + ] + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "adapter_response": { + "type": "object" + }, + "unique_id": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "RunResultOutput(status: Union[dbt.contracts.results.RunStatus, dbt.contracts.results.TestStatus, dbt.contracts.results.FreshnessStatus], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float, message: Union[str, int, NoneType], adapter_response: Dict[str, Any], unique_id: str)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/run-results/v1.json" +} diff --git a/dbt_artifacts_parser/resources/run-results/run-results_v2.json b/dbt_artifacts_parser/resources/run-results/run-results_v2.json new file mode 100644 index 0000000..ce5efe2 --- /dev/null +++ b/dbt_artifacts_parser/resources/run-results/run-results_v2.json @@ -0,0 +1,190 @@ +{ + "title": "RunResults", + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/BaseArtifactMetadata" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RunResultOutput" + } + }, + "elapsed_time": { + "type": "number" + }, + "args": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "RunResultsArtifact(metadata: dbt.contracts.util.BaseArtifactMetadata, results: Sequence[dbt.contracts.results.RunResultOutput], elapsed_time: float, args: Dict[str, Any] = )", + "definitions": { + "BaseArtifactMetadata": { + "type": "object", + "required": [ + "dbt_schema_version" + ], + "properties": { + "dbt_schema_version": { + "type": "string" + }, + "dbt_version": { + "type": "string", + "default": "0.20.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-06-07T14:49:01.097134Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "BaseArtifactMetadata(dbt_schema_version: str, dbt_version: str = '0.20.0rc1', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "RunResultOutput": { + "type": "object", + "required": [ + "status", + "timing", + "thread_id", + "execution_time", + "adapter_response", + "unique_id" + ], + "properties": { + "status": { + "oneOf": [ + { + "type": "string", + "enum": [ + "success", + "error", + "skipped" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "error", + "fail", + "warn" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + } + ] + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + }, + "adapter_response": { + "type": "object" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "failures": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "unique_id": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "RunResultOutput(status: Union[dbt.contracts.results.RunStatus, dbt.contracts.results.TestStatus, dbt.contracts.results.FreshnessStatus], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float, adapter_response: Dict[str, Any], message: Union[str, NoneType], failures: Union[int, NoneType], unique_id: str)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/run-results/v2.json" +} diff --git a/dbt_artifacts_parser/resources/run-results/run-results_v3.json b/dbt_artifacts_parser/resources/run-results/run-results_v3.json new file mode 100644 index 0000000..cbd2596 --- /dev/null +++ b/dbt_artifacts_parser/resources/run-results/run-results_v3.json @@ -0,0 +1,381 @@ +{ + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/BaseArtifactMetadata" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RunResultOutput" + } + }, + "elapsed_time": { + "type": "number" + }, + "args": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "RunResultsArtifact(metadata: dbt.contracts.util.BaseArtifactMetadata, results: Sequence[dbt.contracts.results.RunResultOutput], elapsed_time: float, args: Dict[str, Any] = )", + "definitions": { + "BaseArtifactMetadata": { + "type": "object", + "required": [ + "dbt_schema_version" + ], + "properties": { + "dbt_schema_version": { + "type": "string" + }, + "dbt_version": { + "type": "string", + "default": "0.21.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-09-24T13:29:14.315088Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "BaseArtifactMetadata(dbt_schema_version: str, dbt_version: str = '0.21.0rc1', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "RunResultOutput": { + "type": "object", + "required": [ + "status", + "timing", + "thread_id", + "execution_time", + "adapter_response", + "unique_id" + ], + "properties": { + "status": { + "oneOf": [ + { + "type": "string", + "enum": [ + "success", + "error", + "skipped" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "error", + "fail", + "warn", + "skipped" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + } + ] + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + }, + "adapter_response": { + "type": "object" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "failures": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "unique_id": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "RunResultOutput(status: Union[dbt.contracts.results.RunStatus, dbt.contracts.results.TestStatus, dbt.contracts.results.FreshnessStatus], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float, adapter_response: Dict[str, Any], message: Union[str, NoneType], failures: Union[int, NoneType], unique_id: str)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + }, + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v2.json" + }, + "dbt_version": { + "type": "string", + "default": "0.21.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-09-24T13:29:14.312598Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '0.21.0rc1', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response", + "timing", + "thread_id", + "execution_time" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, filter: Union[str, NoneType] = None)" + }, + "Time": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false, + "description": "Time(count: int, period: dbt.contracts.graph.unparsed.TimePeriod)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/run-results/v3.json" +} \ No newline at end of file diff --git a/dbt_artifacts_parser/resources/run-results/run-results_v4.json b/dbt_artifacts_parser/resources/run-results/run-results_v4.json new file mode 100644 index 0000000..9d79de0 --- /dev/null +++ b/dbt_artifacts_parser/resources/run-results/run-results_v4.json @@ -0,0 +1,400 @@ +{ + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/BaseArtifactMetadata" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RunResultOutput" + } + }, + "elapsed_time": { + "type": "number" + }, + "args": { + "type": "object", + "default": {} + } + }, + "additionalProperties": false, + "description": "RunResultsArtifact(metadata: dbt.contracts.util.BaseArtifactMetadata, results: Sequence[dbt.contracts.results.RunResultOutput], elapsed_time: float, args: Dict[str, Any] = )", + "definitions": { + "BaseArtifactMetadata": { + "type": "object", + "required": [ + "dbt_schema_version" + ], + "properties": { + "dbt_schema_version": { + "type": "string" + }, + "dbt_version": { + "type": "string", + "default": "1.0.0b2" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-11-02T20:18:06.799863Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "BaseArtifactMetadata(dbt_schema_version: str, dbt_version: str = '1.0.0b2', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "RunResultOutput": { + "type": "object", + "required": [ + "status", + "timing", + "thread_id", + "execution_time", + "adapter_response", + "unique_id" + ], + "properties": { + "status": { + "oneOf": [ + { + "type": "string", + "enum": [ + "success", + "error", + "skipped" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "error", + "fail", + "warn", + "skipped" + ] + }, + { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + } + ] + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + }, + "adapter_response": { + "type": "object" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "failures": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "unique_id": { + "type": "string" + } + }, + "additionalProperties": false, + "description": "RunResultOutput(status: Union[dbt.contracts.results.RunStatus, dbt.contracts.results.TestStatus, dbt.contracts.results.FreshnessStatus], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float, adapter_response: Dict[str, Any], message: Union[str, NoneType], failures: Union[int, NoneType], unique_id: str)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + }, + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v3.json" + }, + "dbt_version": { + "type": "string", + "default": "1.0.0b2" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-11-02T20:18:06.796684Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '1.0.0b2', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response", + "timing", + "thread_id", + "execution_time" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ], + "default": { + "count": null, + "period": null + } + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ], + "default": { + "count": null, + "period": null + } + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = , error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = , filter: Union[str, NoneType] = None)" + }, + "Time": { + "type": "object", + "required": [], + "properties": { + "count": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "period": { + "oneOf": [ + { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Time(count: Union[int, NoneType] = None, period: Union[dbt.contracts.graph.unparsed.TimePeriod, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/run-results/v4.json" +} \ No newline at end of file diff --git a/dbt_artifacts_parser/resources/sources/sources_v1.json b/dbt_artifacts_parser/resources/sources/sources_v1.json new file mode 100644 index 0000000..21c0202 --- /dev/null +++ b/dbt_artifacts_parser/resources/sources/sources_v1.json @@ -0,0 +1,212 @@ +{ + "title": "Sources", + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/FreshnessMetadata" + }, + "results": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/SourceFreshnessRuntimeError" + }, + { + "$ref": "#/definitions/SourceFreshnessOutput" + } + ] + } + }, + "elapsed_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "FreshnessExecutionResultArtifact(metadata: dbt.contracts.results.FreshnessMetadata, results: Sequence[Union[dbt.contracts.results.SourceFreshnessRuntimeError, dbt.contracts.results.SourceFreshnessOutput]], elapsed_time: float)", + "definitions": { + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v1.json" + }, + "dbt_version": { + "type": "string", + "default": "0.19.0" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-02-10T04:42:33.675309Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '0.19.0', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any])" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, filter: Union[str, NoneType] = None)" + }, + "Time": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false, + "description": "Time(count: int, period: dbt.contracts.graph.unparsed.TimePeriod)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/sources/v1.json" +} diff --git a/dbt_artifacts_parser/resources/sources/sources_v2.json b/dbt_artifacts_parser/resources/sources/sources_v2.json new file mode 100644 index 0000000..4804e66 --- /dev/null +++ b/dbt_artifacts_parser/resources/sources/sources_v2.json @@ -0,0 +1,261 @@ +{ + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/FreshnessMetadata" + }, + "results": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/SourceFreshnessRuntimeError" + }, + { + "$ref": "#/definitions/SourceFreshnessOutput" + } + ] + } + }, + "elapsed_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "FreshnessExecutionResultArtifact(metadata: dbt.contracts.results.FreshnessMetadata, results: Sequence[Union[dbt.contracts.results.SourceFreshnessRuntimeError, dbt.contracts.results.SourceFreshnessOutput]], elapsed_time: float)", + "definitions": { + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v2.json" + }, + "dbt_version": { + "type": "string", + "default": "0.21.0rc1" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-09-24T13:29:14.312598Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '0.21.0rc1', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response", + "timing", + "thread_id", + "execution_time" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = None, filter: Union[str, NoneType] = None)" + }, + "Time": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false, + "description": "Time(count: int, period: dbt.contracts.graph.unparsed.TimePeriod)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/sources/v2.json" +} \ No newline at end of file diff --git a/dbt_artifacts_parser/resources/sources/sources_v3.json b/dbt_artifacts_parser/resources/sources/sources_v3.json new file mode 100644 index 0000000..58f5418 --- /dev/null +++ b/dbt_artifacts_parser/resources/sources/sources_v3.json @@ -0,0 +1,280 @@ +{ + "type": "object", + "required": [ + "metadata", + "results", + "elapsed_time" + ], + "properties": { + "metadata": { + "$ref": "#/definitions/FreshnessMetadata" + }, + "results": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/SourceFreshnessRuntimeError" + }, + { + "$ref": "#/definitions/SourceFreshnessOutput" + } + ] + } + }, + "elapsed_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "FreshnessExecutionResultArtifact(metadata: dbt.contracts.results.FreshnessMetadata, results: Sequence[Union[dbt.contracts.results.SourceFreshnessRuntimeError, dbt.contracts.results.SourceFreshnessOutput]], elapsed_time: float)", + "definitions": { + "FreshnessMetadata": { + "type": "object", + "required": [], + "properties": { + "dbt_schema_version": { + "type": "string", + "default": "https://schemas.getdbt.com/dbt/sources/v3.json" + }, + "dbt_version": { + "type": "string", + "default": "1.0.0b2" + }, + "generated_at": { + "type": "string", + "format": "date-time", + "default": "2021-11-02T20:18:06.796684Z" + }, + "invocation_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + } + }, + "additionalProperties": false, + "description": "FreshnessMetadata(dbt_schema_version: str = , dbt_version: str = '1.0.0b2', generated_at: datetime.datetime = , invocation_id: Union[str, NoneType] = , env: Dict[str, str] = )" + }, + "SourceFreshnessRuntimeError": { + "type": "object", + "required": [ + "unique_id", + "status" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "error": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "runtime error" + ] + } + }, + "additionalProperties": false, + "description": "SourceFreshnessRuntimeError(unique_id: str, error: Union[str, int, NoneType], status: dbt.contracts.results.FreshnessErrorEnum)" + }, + "SourceFreshnessOutput": { + "type": "object", + "required": [ + "unique_id", + "max_loaded_at", + "snapshotted_at", + "max_loaded_at_time_ago_in_s", + "status", + "criteria", + "adapter_response", + "timing", + "thread_id", + "execution_time" + ], + "properties": { + "unique_id": { + "type": "string" + }, + "max_loaded_at": { + "type": "string", + "format": "date-time" + }, + "snapshotted_at": { + "type": "string", + "format": "date-time" + }, + "max_loaded_at_time_ago_in_s": { + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "pass", + "warn", + "error", + "runtime error" + ] + }, + "criteria": { + "$ref": "#/definitions/FreshnessThreshold" + }, + "adapter_response": { + "type": "object" + }, + "timing": { + "type": "array", + "items": { + "$ref": "#/definitions/TimingInfo" + } + }, + "thread_id": { + "type": "string" + }, + "execution_time": { + "type": "number" + } + }, + "additionalProperties": false, + "description": "SourceFreshnessOutput(unique_id: str, max_loaded_at: datetime.datetime, snapshotted_at: datetime.datetime, max_loaded_at_time_ago_in_s: float, status: dbt.contracts.results.FreshnessStatus, criteria: dbt.contracts.graph.unparsed.FreshnessThreshold, adapter_response: Dict[str, Any], timing: List[dbt.contracts.results.TimingInfo], thread_id: str, execution_time: float)" + }, + "FreshnessThreshold": { + "type": "object", + "required": [], + "properties": { + "warn_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ], + "default": { + "count": null, + "period": null + } + }, + "error_after": { + "oneOf": [ + { + "$ref": "#/definitions/Time" + }, + { + "type": "null" + } + ], + "default": { + "count": null, + "period": null + } + }, + "filter": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "FreshnessThreshold(warn_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = , error_after: Union[dbt.contracts.graph.unparsed.Time, NoneType] = , filter: Union[str, NoneType] = None)" + }, + "Time": { + "type": "object", + "required": [], + "properties": { + "count": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "period": { + "oneOf": [ + { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "Time(count: Union[int, NoneType] = None, period: Union[dbt.contracts.graph.unparsed.TimePeriod, NoneType] = None)" + }, + "TimingInfo": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "started_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "description": "TimingInfo(name: str, started_at: Union[datetime.datetime, NoneType] = None, completed_at: Union[datetime.datetime, NoneType] = None)" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.getdbt.com/dbt/sources/v3.json" +} \ No newline at end of file diff --git a/dbt_artifacts_parser/utils.py b/dbt_artifacts_parser/utils.py new file mode 100644 index 0000000..7c4609a --- /dev/null +++ b/dbt_artifacts_parser/utils.py @@ -0,0 +1,27 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os + + +def get_project_root() -> str: + """Get the path to the project root. + + Returns: + str: the path to the project root. + """ + return os.path.abspath(os.path.dirname(os.path.dirname(__file__))) diff --git a/dev/clean.sh b/dev/clean.sh new file mode 100755 index 0000000..10167e1 --- /dev/null +++ b/dev/clean.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e +set -x + +# Constants +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_DIR="$(dirname "$SCRIPT_DIR")" + +cleaned_dirs=( + dist + sdist + .pytest_cache +) + +for cleaned_dir in "${cleaned_dirs[@]}" +do + if [ -d "${MODULE_DIR}/${cleaned_dir}" ] ; then + rm -r "${MODULE_DIR:?}/${cleaned_dir}" + fi +done diff --git a/dev/format_python.sh b/dev/format_python.sh new file mode 100755 index 0000000..caada10 --- /dev/null +++ b/dev/format_python.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e +set -x + +set -e + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_ROOT="$(dirname "$SCRIPT_DIR")" + +yapf --recursive --parallel --in-place "${MODULE_ROOT}/dbt_artifacts_parser" "${MODULE_ROOT}/tests" diff --git a/dev/generate_parser_classes.sh b/dev/generate_parser_classes.sh new file mode 100644 index 0000000..2cc9ade --- /dev/null +++ b/dev/generate_parser_classes.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +set -e + +# Constants +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_ROOT="$(dirname "$SCRIPT_DIR")" + +# Base class +base_class="dbt_artifacts_parser.parsers.base.BaseParserModel" + +# +# catalog +# +catalog_versions=("v1") +for ver in "${catalog_versions[@]}" +do + # Convert `v1` to `V1` + upper_ver=${ver^v} + destination="${MODULE_ROOT}/dbt_artifacts_parser/parsers/catalog/catalog_${ver}.py" + echo "Generate ${destination}" + datamodel-codegen --input-file-type jsonschema \ + --base-class "$base_class" \ + --class-name "Catalog${upper_ver}" \ + --input "${MODULE_ROOT}/dbt_artifacts_parser/resources/catalog/catalog_${ver}.json" \ + --output "${destination}" +done + +# +# manifest +# +manifest_versions=("v1" "v2" "v3" "v4") +for ver in "${manifest_versions[@]}" +do + # Convert `v1` to `V1` + upper_ver=${ver^v} + destination="${MODULE_ROOT}/dbt_artifacts_parser/parsers/manifest/manifest_${ver}.py" + echo "Generate ${destination}" + datamodel-codegen --input-file-type jsonschema \ + --base-class "$base_class" \ + --class-name "Manifest${upper_ver}" \ + --input "${MODULE_ROOT}/dbt_artifacts_parser/resources/manifest/manifest_${ver}.json" \ + --output "${destination}" +done + +# +# run-results +# +run_results_versions=("v1" "v2" "v3" "v4") +for ver in "${run_results_versions[@]}" +do + # Convert `v1` to `V1` + upper_ver=${ver^v} + destination="${MODULE_ROOT}/dbt_artifacts_parser/parsers/run_results/run_results_${ver}.py" + echo "Generate ${destination}" + datamodel-codegen --input-file-type jsonschema \ + --base-class "$base_class" \ + --class-name "RunResults${upper_ver}" \ + --input "${MODULE_ROOT}/dbt_artifacts_parser/resources/run-results/run-results_${ver}.json" \ + --output "${destination}" +done + +# +# sources +# +sources_versions=("v1" "v2" "v3") +for ver in "${sources_versions[@]}" +do + # Convert `v1` to `V1` + upper_ver=${ver^v} + destination="${MODULE_ROOT}/dbt_artifacts_parser/parsers/sources/sources_${ver}.py" + echo "Generate ${destination}" + datamodel-codegen --input-file-type jsonschema \ + --base-class "$base_class" \ + --class-name "Sources${upper_ver}" \ + --input "${MODULE_ROOT}/dbt_artifacts_parser/resources/sources/sources_${ver}.json" \ + --output "${destination}" +done diff --git a/dev/lint_python.sh b/dev/lint_python.sh new file mode 100644 index 0000000..3dc630a --- /dev/null +++ b/dev/lint_python.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e + +# Constants +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_DIR="$(dirname "$SCRIPT_DIR")" + +pylint -v "${MODULE_DIR}"/dbt_artifacts_parser "${MODULE_DIR}"/tests diff --git a/dev/publish.sh b/dev/publish.sh new file mode 100755 index 0000000..5cba979 --- /dev/null +++ b/dev/publish.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e +set -x + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_DIR="$(dirname "$SCRIPT_DIR")" + +cd "$MODULE_DIR" + +# Arguments +target=${1:?"target is not set"} + +# SEE https://flit.readthedocs.io/en/latest/reproducible.html +SOURCE_DATE_EPOCH=$(date +%s) +export SOURCE_DATE_EPOCH + +if [[ "$target" == "pypi" ]] ; then + flit publish --repository "${target}" --pypirc "${MODULE_DIR}/.pypirc" --setup-py +elif [[ "$target" == "testpypi" ]] ; then + flit publish --repository "${target}" --pypirc "${MODULE_DIR}/.pypirc" --setup-py +else + echo "No such target ${target}" + exit 1 +fi diff --git a/dev/setup.sh b/dev/setup.sh new file mode 100755 index 0000000..ab82554 --- /dev/null +++ b/dev/setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e + +# Constants +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_DIR="$(dirname "$SCRIPT_DIR")" + +cd "$MODULE_DIR" + +FLIT_VERSION="3.7.1" +pip install -U flit=="$FLIT_VERSION" +flit install --deps develop --symlink diff --git a/dev/test_python.sh b/dev/test_python.sh new file mode 100755 index 0000000..6ebcc33 --- /dev/null +++ b/dev/test_python.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -e + +# Constants +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +MODULE_DIR="$(dirname "$SCRIPT_DIR")" + +pytest -v -s --cache-clear "${MODULE_DIR}/tests" diff --git a/pylintrc b/pylintrc new file mode 100644 index 0000000..416b7cf --- /dev/null +++ b/pylintrc @@ -0,0 +1,431 @@ +# This Pylint rcfile contains a best-effort configuration to uphold the +# best-practices and style described in the Google Python style guide: +# https://google.github.io/styleguide/pyguide.html +# +# Its canonical open-source location is: +# https://google.github.io/styleguide/pylintrc + +[MASTER] + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=third_party + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Pickle collected data for later comparisons. +persistent=no + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +#enable= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=apply-builtin, + backtick, + bad-option-value, + basestring-builtin, + buffer-builtin, + c-extension-no-member, + cmp-builtin, + cmp-method, + coerce-builtin, + coerce-method, + delslice-method, + div-method, + duplicate-code, + eq-without-hash, + execfile-builtin, + file-builtin, + filter-builtin-not-iterating, + fixme, + getslice-method, + global-statement, + hex-method, + idiv-method, + implicit-str-concat-in-sequence, + import-error, + import-self, + import-star-module-level, + input-builtin, + intern-builtin, + invalid-str-codec, + locally-disabled, + long-builtin, + long-suffix, + map-builtin-not-iterating, + metaclass-assignment, + next-method-called, + next-method-defined, + no-absolute-import, + no-else-break, + no-else-continue, + no-else-raise, + no-else-return, + no-member, + no-self-use, + nonzero-method, + oct-method, + old-division, + old-ne-operator, + old-octal-literal, + old-raise-syntax, + parameter-unpacking, + print-statement, + raising-string, + range-builtin-not-iterating, + raw_input-builtin, + rdiv-method, + reduce-builtin, + relative-import, + reload-builtin, + round-builtin, + setslice-method, + signature-differs, + standarderror-builtin, + suppressed-message, + sys-max-int, + too-few-public-methods, + too-many-ancestors, + too-many-arguments, + too-many-boolean-expressions, + too-many-branches, + too-many-instance-attributes, + too-many-locals, + too-many-public-methods, + too-many-return-statements, + too-many-statements, + trailing-newlines, + unichr-builtin, + unicode-builtin, + unpacking-in-except, + useless-else-on-loop, + useless-suppression, + using-cmp-argument, + xrange-builtin, + zip-builtin-not-iterating, + missing-module-docstring, + missing-class-docstring, + consider-using-f-string, + invalid-name, + + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". This option is deprecated +# and it will be removed in Pylint 2.0. +files-output=no + +# Tells whether to display a full report or only the messages +reports=no + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + + +[BASIC] + +# Good variable names which should always be accepted, separated by a comma +good-names=main,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty,cached_property.cached_property,cached_property.threaded_cached_property,cached_property.cached_property_with_ttl,cached_property.threaded_cached_property_with_ttl + +# Regular expression matching correct function names +function-rgx=^(?:(?PsetUp|tearDown|setUpModule|tearDownModule)|(?P_?[A-Z][a-zA-Z0-9]*)|(?P_?[a-z][a-z0-9_]*))$ + +# Regular expression matching correct variable names +variable-rgx=^[a-z][a-z0-9_]*$ + +# Regular expression matching correct constant names +const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ + +# Regular expression matching correct attribute names +attr-rgx=^_{0,2}[a-z][a-z0-9_]*$ + +# Regular expression matching correct argument names +argument-rgx=^[a-z][a-z0-9_]*$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=^[a-z][a-z0-9_]*$ + +# Regular expression matching correct class names +class-rgx=^_?[A-Z][a-zA-Z0-9]*$ + +# Regular expression matching correct module names +module-rgx=^(_?[a-z][a-z0-9_]*|__init__)$ + +# Regular expression matching correct method names +method-rgx=(?x)^(?:(?P_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P_{0,2}[a-z][a-z0-9_]*))$ + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=(__.*__|main|test.*|.*test|.*Test)$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=10 + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=120 + +# TODO(https://github.com/PyCQA/pylint/issues/3352): Direct pylint to exempt +# lines made too long by directives to pytype. + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=(?x)( + ^\s*(\#\ )??$| + ^\s*(from\s+\S+\s+)?import\s+.+$) + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=yes + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check= + +# Maximum number of lines in a module +max-module-lines=99999 + +# String used as indentation unit. The internal Google style guide mandates 2 +# spaces. Google's externaly-published style guide says 4, consistent with +# PEP 8. Here, we use 2 spaces, for conformity with many open-sourced Google +# projects (like TensorFlow). +indent-string=' ' + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=TODO + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_) + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six,six.moves,past.builtins,future.builtins,functools + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging,absl.logging,tensorflow.google.logging + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub, + TERMIOS, + Bastion, + rexec, + sets + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant, absl + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls, + class_ + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=StandardError, + Exception, + BaseException diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d9fc55b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[tool.flit.module] +name = "dbt_artifacts_parser" + +[project] +name = "dbt-artifacts-parser" +authors = [{name = "yu-iskw"}] +readme = "README.md" +license = {file = "LICENSE"} +requires-python = ">=3.7.0" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Information Technology", + "Intended Audience :: System Administrators", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Typing :: Typed", +] +dynamic = ["version", "description"] +dependencies = [ + "pydantic >=1.6", + "datamodel-code-generator >=0.11.13", +] + +[project.urls] +Home = "https://github.com/yu-iskw/dbt-artifacts-parser" + +[project.optional-dependencies] +test = [ + "pytest >=6.2.4,<7.0.0", + "pylint >=2.12.0", + "mypy ==0.910", + "flake8 >=3.8.3,<4.0.0", + "black ==21.9b0", + "isort >=5.0.6,<6.0.0", + "yapf >=0.29.0", +] +dev = [ + "flit ==3.7.1", + "build ==0.7.0", + "yapf >=0.29.0", + "pyyaml >=5.3", + "pdoc3 >=0.9.2", +] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e232fe3 --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from setuptools import setup + +setup() diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..98aa80e --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,14 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/parsers/__init__.py b/tests/parsers/__init__.py new file mode 100644 index 0000000..3cfa191 --- /dev/null +++ b/tests/parsers/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/tests/parsers/test_utils.py b/tests/parsers/test_utils.py new file mode 100644 index 0000000..401146a --- /dev/null +++ b/tests/parsers/test_utils.py @@ -0,0 +1,115 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +import os +import unittest +import json + +from dbt_artifacts_parser.utils import get_project_root +from dbt_artifacts_parser.parsers.utils import get_dbt_schema_version, get_model_class + +from dbt_artifacts_parser.parsers.catalog.catalog_v1 import CatalogV1 +from dbt_artifacts_parser.parsers.manifest.manifest_v1 import ManifestV1 +from dbt_artifacts_parser.parsers.manifest.manifest_v2 import ManifestV2 +from dbt_artifacts_parser.parsers.manifest.manifest_v3 import ManifestV3 +from dbt_artifacts_parser.parsers.manifest.manifest_v4 import ManifestV4 +from dbt_artifacts_parser.parsers.run_results.run_results_v1 import RunResultsV1 +from dbt_artifacts_parser.parsers.run_results.run_results_v2 import RunResultsV2 +from dbt_artifacts_parser.parsers.run_results.run_results_v3 import RunResultsV3 +from dbt_artifacts_parser.parsers.run_results.run_results_v4 import RunResultsV4 +from dbt_artifacts_parser.parsers.sources.sources_v1 import SourcesV1 +from dbt_artifacts_parser.parsers.sources.sources_v2 import SourcesV2 +from dbt_artifacts_parser.parsers.sources.sources_v3 import SourcesV3 +from dbt_artifacts_parser.parsers.version_map import ArtifactTypes + + +class TestDbtUtils(unittest.TestCase): + + def test_get_dbt_schema_version(self): + # v1 + v1_artifacts = { + "catalog.json": + "https://schemas.getdbt.com/dbt/catalog/v1.json", + "manifest.json": + "https://schemas.getdbt.com/dbt/manifest/v1.json", + "run_results.json": + "https://schemas.getdbt.com/dbt/run-results/v1.json", + } + for file, expected_dbt_schema_version in v1_artifacts.items(): + path = os.path.join(get_project_root(), "tests", "resources", "v1", + "jaffle_shop", file) + with open(path, "r", encoding="utf-8") as fp: + artifact_json = json.load(fp) + dbt_schema_version = get_dbt_schema_version( + artifact_json=artifact_json) + self.assertEqual(dbt_schema_version, + expected_dbt_schema_version) + # v2 + v1_artifacts = { + "manifest.json": + "https://schemas.getdbt.com/dbt/manifest/v2.json", + "run_results.json": + "https://schemas.getdbt.com/dbt/run-results/v2.json", + } + for file, expected_dbt_schema_version in v1_artifacts.items(): + path = os.path.join(get_project_root(), "tests", "resources", "v2", + "jaffle_shop", file) + with open(path, "r", encoding="utf-8") as fp: + artifact_json = json.load(fp) + dbt_schema_version = get_dbt_schema_version( + artifact_json=artifact_json) + self.assertEqual(dbt_schema_version, + expected_dbt_schema_version) + # v3 + v1_artifacts = { + "manifest.json": + "https://schemas.getdbt.com/dbt/manifest/v3.json", + "run_results.json": + "https://schemas.getdbt.com/dbt/run-results/v3.json", + } + for file, expected_dbt_schema_version in v1_artifacts.items(): + path = os.path.join(get_project_root(), "tests", "resources", "v3", + "jaffle_shop", file) + with open(path, "r", encoding="utf-8") as fp: + artifact_json = json.load(fp) + dbt_schema_version = get_dbt_schema_version( + artifact_json=artifact_json) + self.assertEqual(dbt_schema_version, + expected_dbt_schema_version) + + def test_get_model_class(self): + test_sets = [ + # v1 + (ArtifactTypes.CATALOG_V1, CatalogV1), + (ArtifactTypes.MANIFEST_V1, ManifestV1), + (ArtifactTypes.RUN_RESULTS_V1, RunResultsV1), + (ArtifactTypes.SOURCES_V1, SourcesV1), + # v2 + (ArtifactTypes.MANIFEST_V2, ManifestV2), + (ArtifactTypes.RUN_RESULTS_V2, RunResultsV2), + (ArtifactTypes.SOURCES_V2, SourcesV2), + # v3 + (ArtifactTypes.MANIFEST_V3, ManifestV3), + (ArtifactTypes.RUN_RESULTS_V3, RunResultsV3), + (ArtifactTypes.SOURCES_V3, SourcesV3), + # v4 + (ArtifactTypes.MANIFEST_V4, ManifestV4), + (ArtifactTypes.RUN_RESULTS_V4, RunResultsV4), + ] + for (artifact_type, expected_class) in test_sets: + klass = get_model_class(artifact_type=artifact_type) + self.assertEqual(klass, expected_class) diff --git a/tests/resources/v1/jaffle_shop/catalog.json b/tests/resources/v1/jaffle_shop/catalog.json new file mode 100644 index 0000000..6170ceb --- /dev/null +++ b/tests/resources/v1/jaffle_shop/catalog.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-10-09T00:10:46.594322Z", "invocation_id": "be2b8b55-869c-40a8-ab31-64994e471783", "env": {}}, "nodes": {"seed.jaffle_shop.raw_payments": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "raw_payments", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "STRING", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INT64", "index": 4, "name": "amount", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 113.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4158.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.jaffle_shop.raw_payments"}, "seed.jaffle_shop.raw_orders": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "raw_orders", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "STRING", "index": 4, "name": "status", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 99.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3406.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.jaffle_shop.raw_orders"}, "model.jaffle_shop.fct_orders": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "fct_orders", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INT64", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INT64", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "STRING", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "FLOAT64", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "FLOAT64", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "FLOAT64", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "FLOAT64", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "FLOAT64", "index": 9, "name": "amount", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 99.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7366.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.fct_orders"}, "model.jaffle_shop.customer_payments": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "customer_payments", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "total_amount": {"type": "FLOAT64", "index": 2, "name": "total_amount", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 62.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 992.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.customer_payments"}, "model.jaffle_shop.customer_orders": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "customer_orders", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "first_order": {"type": "DATE", "index": 2, "name": "first_order", "comment": null}, "most_recent_order": {"type": "DATE", "index": 3, "name": "most_recent_order", "comment": null}, "number_of_orders": {"type": "INT64", "index": 4, "name": "number_of_orders", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 62.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1984.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.customer_orders"}, "model.jaffle_shop.order_payments": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "order_payments", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INT64", "index": 1, "name": "order_id", "comment": null}, "credit_card_amount": {"type": "FLOAT64", "index": 2, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "FLOAT64", "index": 3, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "FLOAT64", "index": 4, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "FLOAT64", "index": 5, "name": "gift_card_amount", "comment": null}, "total_amount": {"type": "FLOAT64", "index": 6, "name": "total_amount", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 99.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4752.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.order_payments"}, "model.jaffle_shop.dim_customers": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "dim_customers", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "first_order": {"type": "DATE", "index": 2, "name": "first_order", "comment": null}, "most_recent_order": {"type": "DATE", "index": 3, "name": "most_recent_order", "comment": null}, "number_of_orders": {"type": "INT64", "index": 4, "name": "number_of_orders", "comment": null}, "customer_lifetime_value": {"type": "FLOAT64", "index": 5, "name": "customer_lifetime_value", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 100.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2784.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.dim_customers"}, "model.jaffle_shop.stg_orders": {"metadata": {"type": "view", "schema": "jaffle_shop", "name": "stg_orders", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INT64", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INT64", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "STRING", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.stg_orders"}, "model.jaffle_shop.stg_customers": {"metadata": {"type": "view", "schema": "jaffle_shop", "name": "stg_customers", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "INT64", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "STRING", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "STRING", "index": 3, "name": "last_name", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.stg_customers"}, "seed.jaffle_shop.raw_customers": {"metadata": {"type": "table", "schema": "jaffle_shop", "name": "raw_customers", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "STRING", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "STRING", "index": 3, "name": "last_name", "comment": null}, "email": {"type": "STRING", "index": 4, "name": "email", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 100.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4571.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.jaffle_shop.raw_customers"}, "model.jaffle_shop.stg_payments": {"metadata": {"type": "view", "schema": "jaffle_shop", "name": "stg_payments", "database": "your-gcp-project", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INT64", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INT64", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "STRING", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "FLOAT64", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.jaffle_shop.stg_payments"}}, "sources": {}, "errors": null} diff --git a/tests/resources/v1/jaffle_shop/manifest.json b/tests/resources/v1/jaffle_shop/manifest.json new file mode 100644 index 0000000..022d77d --- /dev/null +++ b/tests/resources/v1/jaffle_shop/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-06-16T08:34:18.410075Z", "invocation_id": "c5d218c3-4376-492b-8a59-011b343ad9a3", "env": {}, "project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "bigquery"}, "nodes": {"model.jaffle_shop.stg_customers": {"raw_sql": "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 email\n\n from source\n\n)\n\nselect * from renamed", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_customers"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": ["staging", "hourly"], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_customers"], "unique_id": "model.jaffle_shop.stg_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_customers.sql", "original_file_path": "models/staging/stg_customers.sql", "name": "stg_customers", "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "8aaf3f82d6948a706a8fd6e40493a59446ab84436c800b9bb986d6af6d3dc073"}, "tags": ["staging", "hourly"], "refs": [["raw_customers"]], "sources": [], "description": "", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "tags": ["staging", "hourly"]}}, "model.jaffle_shop.stg_payments": {"raw_sql": "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", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_payments"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": ["staging", "hourly"], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_payments"], "unique_id": "model.jaffle_shop.stg_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_payments.sql", "original_file_path": "models/staging/stg_payments.sql", "name": "stg_payments", "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "113502ed19f04efb2af0629ff139f57f7463347b6d5218f3b80a8d128cc96852"}, "tags": ["staging", "hourly"], "refs": [["raw_payments"]], "sources": [], "description": "", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "tags": ["staging", "hourly"]}}, "model.jaffle_shop.stg_orders": {"raw_sql": "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", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_orders"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": ["staging", "hourly"], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_orders"], "unique_id": "model.jaffle_shop.stg_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_orders.sql", "original_file_path": "models/staging/stg_orders.sql", "name": "stg_orders", "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "afffa9cbc57e5fd2cf5898ebf571d444a62c9d6d7929d8133d30567fb9a2ce97"}, "tags": ["staging", "hourly"], "refs": [["raw_orders"]], "sources": [], "description": "", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/staging/schema.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "tags": ["staging", "hourly"]}}, "model.jaffle_shop.dim_customers": {"raw_sql": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\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 using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_customers", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "dim_customers"], "unique_id": "model.jaffle_shop.dim_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/dim_customers.sql", "original_file_path": "models/marts/core/dim_customers.sql", "name": "dim_customers", "alias": "dim_customers", "checksum": {"name": "sha256", "checksum": "95d544c0e900d9ac69d0471bad24e03c63a268dbc493559023b58b7618c49b3a"}, "tags": [], "refs": [["stg_customers"], ["customer_orders"], ["customer_payments"]], "sources": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "Customer's email address. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_order": {"name": "first_order", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "most_recent_order": {"name": "most_recent_order", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_order_amount": {"name": "total_order_amount", "description": "Total value (AUD) of a customer's orders", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/marts/core/schema.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}}, "model.jaffle_shop.fct_orders": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\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 left join order_payments using (order_id)\n\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.order_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "fct_orders"], "unique_id": "model.jaffle_shop.fct_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/fct_orders.sql", "original_file_path": "models/marts/core/fct_orders.sql", "name": "fct_orders", "alias": "fct_orders", "checksum": {"name": "sha256", "checksum": "49634cca4e40171ea98f62a1a3a9999e3487c42aca3ee79ecaaf99900ead1fd8"}, "tags": [], "refs": [["stg_orders"], ["order_payments"]], "sources": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "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": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "models/marts/core/schema.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}}, "model.jaffle_shop.order_payments": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "order_payments"], "unique_id": "model.jaffle_shop.order_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/order_payments.sql", "original_file_path": "models/marts/core/intermediate/order_payments.sql", "name": "order_payments", "alias": "order_payments", "checksum": {"name": "sha256", "checksum": "6af89b1b7d0e9fe6b2b54118cf2addf0bab34ccc49b054eab93f8d7056fb7c52"}, "tags": [], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}}, "model.jaffle_shop.customer_payments": {"raw_sql": "with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments", "model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_payments"], "unique_id": "model.jaffle_shop.customer_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/customer_payments.sql", "original_file_path": "models/marts/core/intermediate/customer_payments.sql", "name": "customer_payments", "alias": "customer_payments", "checksum": {"name": "sha256", "checksum": "feb9a66904fe7968464b947a2289c795d58fbc7f1e14a3c9975dc261d94cb351"}, "tags": [], "refs": [["stg_payments"], ["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}}, "model.jaffle_shop.customer_orders": {"raw_sql": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_orders"], "unique_id": "model.jaffle_shop.customer_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/customer_orders.sql", "original_file_path": "models/marts/core/intermediate/customer_orders.sql", "name": "customer_orders", "alias": "customer_orders", "checksum": {"name": "sha256", "checksum": "20c96fcb3cf2235582de807d64cd1cdbdd3a419786bf1ceaae0ef208e7ed3dd7"}, "tags": [], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}}, "seed.jaffle_shop.raw_customers": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_customers"], "unique_id": "seed.jaffle_shop.raw_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_customers.csv", "original_file_path": "data/raw_customers.csv", "name": "raw_customers", "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "714f9e3dddfcd62fe967462621908ba59cae1502d1661ee8d8649ba7a56cb830"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}}, "seed.jaffle_shop.raw_orders": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_orders"], "unique_id": "seed.jaffle_shop.raw_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_orders.csv", "original_file_path": "data/raw_orders.csv", "name": "raw_orders", "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ee6c68d1639ec2b23a4495ec12475e09b8ed4b61e23ab0411ea7ec76648356f7"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}}, "seed.jaffle_shop.raw_payments": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_payments"], "unique_id": "seed.jaffle_shop.raw_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_payments.csv", "original_file_path": "data/raw_payments.csv", "name": "raw_payments", "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "03fd407f3135f84456431a923f22fc185a2154079e210c20b690e3ab11687d11"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}}, "test.jaffle_shop.unique_stg_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ ref('stg_customers') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "unique_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_customers_customer_id", "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "customer_id"}, "test.jaffle_shop.not_null_stg_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ ref('stg_customers') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_customers_customer_id", "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "customer_id"}, "test.jaffle_shop.unique_stg_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_order_id"], "unique_id": "test.jaffle_shop.unique_stg_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_order_id", "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "order_id"}, "test.jaffle_shop.not_null_stg_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ ref('stg_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_orders_order_id", "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "order_id"}, "test.jaffle_shop.unique_stg_orders_status__False": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"store_failures": false, "column_name": "status", "model": "{{ ref('stg_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_status__False"], "unique_id": "test.jaffle_shop.unique_stg_orders_status__False", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_orders_status__False.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_status__False", "alias": "unique_stg_orders_status__False", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "status"}, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ ref('stg_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_stg_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "status"}, "test.jaffle_shop.unique_stg_payments_payment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ ref('stg_payments') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "unique_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_payments_payment_id", "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "payment_id"}, "test.jaffle_shop.not_null_stg_payments_payment_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ ref('stg_payments') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_payments_payment_id", "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "payment_id"}, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ ref('stg_payments') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_stg_payments_944011baab727320a6b119d4d81589ae.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "alias": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "payment_method"}, "test.jaffle_shop.unique_dim_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ ref('dim_customers') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.dim_customers"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "unique_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_dim_customers_customer_id", "alias": "unique_dim_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "customer_id"}, "test.jaffle_shop.not_null_dim_customers_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ ref('dim_customers') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.dim_customers"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_dim_customers_customer_id", "alias": "not_null_dim_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "customer_id"}, "test.jaffle_shop.unique_fct_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "unique_fct_orders_order_id"], "unique_id": "test.jaffle_shop.unique_fct_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_fct_orders_order_id", "alias": "unique_fct_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "order_id"}, "test.jaffle_shop.not_null_fct_orders_order_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_order_id", "alias": "not_null_fct_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "order_id"}, "test.jaffle_shop.not_null_fct_orders_customer_id": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_customer_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_customer_id", "alias": "not_null_fct_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "customer_id"}, "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_relationships(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('dim_customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_relationships"], "nodes": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"], "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/relationships_fct_orders_535c445ac9111d4713c286f097da3132.sql", "original_file_path": "models/marts/core/schema.yml", "name": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "alias": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"], ["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "customer_id"}, "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_accepted_values(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_fct_orders_758238c28b8980ea7fe9d60a8d851ea8.sql", "original_file_path": "models/marts/core/schema.yml", "name": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "status"}, "test.jaffle_shop.not_null_fct_orders_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_amount", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_amount", "alias": "not_null_fct_orders_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "amount"}, "test.jaffle_shop.not_null_fct_orders_credit_card_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_credit_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_credit_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_credit_card_amount", "alias": "not_null_fct_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "credit_card_amount"}, "test.jaffle_shop.not_null_fct_orders_coupon_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_coupon_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_coupon_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_coupon_amount", "alias": "not_null_fct_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "coupon_amount"}, "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_bank_transfer_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_bank_transfer_amount", "alias": "not_null_fct_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "bank_transfer_amount"}, "test.jaffle_shop.not_null_fct_orders_gift_card_amount": {"raw_sql": "{{ config(severity='ERROR') }}{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ ref('fct_orders') }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_gift_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_gift_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_gift_card_amount", "alias": "not_null_fct_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "severity": "ERROR"}, "column_name": "gift_card_amount"}}, "sources": {}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__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\n create or replace view {{ relation }}\n {{ bigquery_table_options(config, model, temporary=false) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view(run_outside_transaction_hooks=False) %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {# there should be exactly one ref or exactly one source #}\n {% set destination = this.incorporate(type='table') %}\n\n {% set dependency_type = none %}\n {% if (model.refs | length) == 1 and (model.sources | length) == 0 %}\n {% set dependency_type = 'ref' %}\n {% elif (model.refs | length) == 0 and (model.sources | length) == 1 %}\n {% set dependency_type = 'source' %}\n {% else %}\n {% set msg %}\n Expected exactly one ref or exactly one source, instead got {{ model.refs | length }} models and {{ model.sources | length }} sources.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% if dependency_type == 'ref' %}\n {% set src = ref(*model.refs[0]) %}\n {% else %}\n {% set src = source(*model.sources[0]) %}\n {% endif %}\n\n {%- set result_str = adapter.copy_table(\n src,\n destination,\n config.get('copy_materialization', 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }};\n\n set _dbt_max_partition = (\n select max({{ partition_by.field }}) from {{ this }}\n );\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation,\n target_relation,\n sql,\n unique_key,\n partition_by,\n partitions,\n dest_columns) %}\n\n {% else %}\n {#-- wrap sql in parens to make it a subquery --#}\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n ;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/fishtown-analytics/dbt/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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = snapshot_string_as_time(now) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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_sql']) %}\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 {% do persist_docs(target_relation, model) %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.basic_load_csv_rows": {"unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n %s\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\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 {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set backup_identifier = existing_relation.identifier ~ \"__dbt_backup\" %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_merge_sql", "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 sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\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 {% 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 in dest_columns -%}\n {{ adapter.quote(column.name) }} = DBT_INTERNAL_SOURCE.{{ adapter.quote(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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\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{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_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 is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch(\"handle_existing_table\", packages=['dbt'])(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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 {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_relation", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, to, field) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('from')) %}\n\n\nselect count(*) as validation_errors\nfrom (\n select {{ column_name }} as id from {{ model }}\n) as child\nleft join (\n select {{ field }} as id from {{ to }}\n) as parent on parent.id = child.id\nwhere child.id is not null\n and parent.id is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% macro test_relationships(model, to, field) %}\n {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, to, field, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "test_not_null", "macro_sql": "{% macro test_not_null(model) %}\n {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n\nselect count(*) as validation_errors\nfrom (\n\n select\n {{ column_name }}\n\n from {{ model }}\n where {{ column_name }} is not null\n group by {{ column_name }}\n having count(*) > 1\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% macro test_unique(model) %}\n {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, values) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('field')) %}\n{% set quote_values = kwargs.get('quote', True) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field not in (\n {% for value in values -%}\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n)\n\nselect count(*) as validation_errors\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "test_accepted_values", "macro_sql": "{% macro test_accepted_values(model, values) %}\n {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, values, **kwargs) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": []}}, "docs": {"jaffle_shop.__overview__": {"unique_id": "jaffle_shop.__overview__", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "overview.md", "original_file_path": "models/overview.md", "name": "__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "jaffle_shop.orders_status": {"unique_id": "jaffle_shop.orders_status", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/docs.md", "original_file_path": "models/marts/core/docs.md", "name": "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 |"}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/python3.8/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], "model.jaffle_shop.stg_payments": ["seed.jaffle_shop.raw_payments"], "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], "model.jaffle_shop.dim_customers": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.stg_customers"], "model.jaffle_shop.fct_orders": ["model.jaffle_shop.order_payments", "model.jaffle_shop.stg_orders"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_customers": [], "seed.jaffle_shop.raw_orders": [], "seed.jaffle_shop.raw_payments": [], "test.jaffle_shop.unique_stg_customers_customer_id": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.not_null_stg_customers_customer_id": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.unique_stg_orders_order_id": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.not_null_stg_orders_order_id": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_orders_status__False": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_payments_payment_id": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.not_null_stg_payments_payment_id": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_dim_customers_customer_id": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.not_null_dim_customers_customer_id": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.unique_fct_orders_order_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_order_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_customer_id": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_credit_card_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_coupon_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_gift_card_amount": ["model.jaffle_shop.fct_orders"]}, "child_map": {"model.jaffle_shop.stg_customers": ["model.jaffle_shop.dim_customers", "test.jaffle_shop.not_null_stg_customers_customer_id", "test.jaffle_shop.unique_stg_customers_customer_id"], "model.jaffle_shop.stg_payments": ["model.jaffle_shop.customer_payments", "model.jaffle_shop.order_payments", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "test.jaffle_shop.not_null_stg_payments_payment_id", "test.jaffle_shop.unique_stg_payments_payment_id"], "model.jaffle_shop.stg_orders": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.fct_orders", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.not_null_stg_orders_order_id", "test.jaffle_shop.unique_stg_orders_order_id", "test.jaffle_shop.unique_stg_orders_status__False"], "model.jaffle_shop.dim_customers": ["test.jaffle_shop.not_null_dim_customers_customer_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.unique_dim_customers_customer_id"], "model.jaffle_shop.fct_orders": ["test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "test.jaffle_shop.not_null_fct_orders_amount", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount", "test.jaffle_shop.not_null_fct_orders_coupon_amount", "test.jaffle_shop.not_null_fct_orders_credit_card_amount", "test.jaffle_shop.not_null_fct_orders_customer_id", "test.jaffle_shop.not_null_fct_orders_gift_card_amount", "test.jaffle_shop.not_null_fct_orders_order_id", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "test.jaffle_shop.unique_fct_orders_order_id"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.fct_orders"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.dim_customers"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.dim_customers"], "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_stg_customers_customer_id": [], "test.jaffle_shop.not_null_stg_customers_customer_id": [], "test.jaffle_shop.unique_stg_orders_order_id": [], "test.jaffle_shop.not_null_stg_orders_order_id": [], "test.jaffle_shop.unique_stg_orders_status__False": [], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned": [], "test.jaffle_shop.unique_stg_payments_payment_id": [], "test.jaffle_shop.not_null_stg_payments_payment_id": [], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card": [], "test.jaffle_shop.unique_dim_customers_customer_id": [], "test.jaffle_shop.not_null_dim_customers_customer_id": [], "test.jaffle_shop.unique_fct_orders_order_id": [], "test.jaffle_shop.not_null_fct_orders_order_id": [], "test.jaffle_shop.not_null_fct_orders_customer_id": [], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_": [], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned": [], "test.jaffle_shop.not_null_fct_orders_amount": [], "test.jaffle_shop.not_null_fct_orders_credit_card_amount": [], "test.jaffle_shop.not_null_fct_orders_coupon_amount": [], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount": [], "test.jaffle_shop.not_null_fct_orders_gift_card_amount": []}} diff --git a/tests/resources/v1/jaffle_shop/run_results.json b/tests/resources/v1/jaffle_shop/run_results.json new file mode 100644 index 0000000..a5bfaa9 --- /dev/null +++ b/tests/resources/v1/jaffle_shop/run_results.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v1.json", "dbt_version": "0.19.1", "generated_at": "2021-08-12T09:12:01.872900Z", "invocation_id": "196871b6-901c-4992-9c1e-10f8a44b999f", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:56.136770Z", "completed_at": "2021-08-12T09:11:56.147256Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:56.147738Z", "completed_at": "2021-08-12T09:11:56.927114Z"}], "thread_id": "Thread-2", "execution_time": 0.7918922901153564, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "unique_id": "model.jaffle_shop.stg_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:56.136618Z", "completed_at": "2021-08-12T09:11:56.147584Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:56.185753Z", "completed_at": "2021-08-12T09:11:56.957773Z"}], "thread_id": "Thread-1", "execution_time": 0.8230679035186768, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "unique_id": "model.jaffle_shop.stg_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:56.136878Z", "completed_at": "2021-08-12T09:11:56.147459Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:56.172485Z", "completed_at": "2021-08-12T09:11:57.041799Z"}], "thread_id": "Thread-3", "execution_time": 0.9059498310089111, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "unique_id": "model.jaffle_shop.stg_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:56.929552Z", "completed_at": "2021-08-12T09:11:56.933100Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:56.933298Z", "completed_at": "2021-08-12T09:11:59.361211Z"}], "thread_id": "Thread-5", "execution_time": 2.4326581954956055, "adapter_response": {"_message": "CREATE TABLE (99.0 rows, 3.2 KB processed)", "code": "CREATE TABLE", "rows_affected": 99, "bytes_processed": 3254}, "message": "CREATE TABLE (99.0 rows, 3.2 KB processed)", "unique_id": "model.jaffle_shop.order_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:56.963433Z", "completed_at": "2021-08-12T09:11:56.977044Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:56.977407Z", "completed_at": "2021-08-12T09:11:59.377625Z"}], "thread_id": "Thread-2", "execution_time": 2.4203131198883057, "adapter_response": {"_message": "CREATE TABLE (62.0 rows, 2.3 KB processed)", "code": "CREATE TABLE", "rows_affected": 62, "bytes_processed": 2376}, "message": "CREATE TABLE (62.0 rows, 2.3 KB processed)", "unique_id": "model.jaffle_shop.customer_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:56.963628Z", "completed_at": "2021-08-12T09:11:56.973638Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:56.973856Z", "completed_at": "2021-08-12T09:11:59.484602Z"}], "thread_id": "Thread-4", "execution_time": 2.5220348834991455, "adapter_response": {"_message": "CREATE TABLE (62.0 rows, 3.3 KB processed)", "code": "CREATE TABLE", "rows_affected": 62, "bytes_processed": 3392}, "message": "CREATE TABLE (62.0 rows, 3.3 KB processed)", "unique_id": "model.jaffle_shop.customer_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:59.384641Z", "completed_at": "2021-08-12T09:11:59.389650Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:59.389908Z", "completed_at": "2021-08-12T09:12:01.680562Z"}], "thread_id": "Thread-1", "execution_time": 2.2967240810394287, "adapter_response": {"_message": "CREATE TABLE (99.0 rows, 8.0 KB processed)", "code": "CREATE TABLE", "rows_affected": 99, "bytes_processed": 8158}, "message": "CREATE TABLE (99.0 rows, 8.0 KB processed)", "unique_id": "model.jaffle_shop.fct_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-08-12T09:11:59.486299Z", "completed_at": "2021-08-12T09:11:59.489512Z"}, {"name": "execute", "started_at": "2021-08-12T09:11:59.489651Z", "completed_at": "2021-08-12T09:12:01.869270Z"}], "thread_id": "Thread-5", "execution_time": 2.3836779594421387, "adapter_response": {"_message": "CREATE TABLE (100.0 rows, 3.7 KB processed)", "code": "CREATE TABLE", "rows_affected": 100, "bytes_processed": 3776}, "message": "CREATE TABLE (100.0 rows, 3.7 KB processed)", "unique_id": "model.jaffle_shop.dim_customers"}], "elapsed_time": 7.887428045272827, "args": {"log_format": "default", "write_json": true, "profiles_dir": ".", "use_cache": true, "version_check": true, "which": "run", "rpc_method": "run"}} diff --git a/tests/resources/v2/jaffle_shop/manifest.json b/tests/resources/v2/jaffle_shop/manifest.json new file mode 100644 index 0000000..045f7a9 --- /dev/null +++ b/tests/resources/v2/jaffle_shop/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-10-12T02:03:51.251037+00:00", "invocation_id": "b890f1d0-e95f-4cf0-b98e-64305db9f389", "env": {}, "project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "bigquery"}, "nodes": {"model.jaffle_shop.stg_customers": {"raw_sql": "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 email\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_customers"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": ["staging", "hourly"], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_customers"], "unique_id": "model.jaffle_shop.stg_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_customers.sql", "original_file_path": "models/staging/stg_customers.sql", "name": "stg_customers", "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "8aaf3f82d6948a706a8fd6e40493a59446ab84436c800b9bb986d6af6d3dc073"}, "tags": ["staging", "hourly"], "refs": [["raw_customers"]], "sources": [], "description": "", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/staging/stg_customers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "tags": ["staging", "hourly"]}, "created_at": 1634004231, "compiled_sql": "with source as (\n select * from `your-gcp-project`.`jaffle_shop`.`raw_customers`\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`stg_customers`"}, "model.jaffle_shop.stg_payments": {"raw_sql": "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", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_payments"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": ["staging", "hourly"], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_payments"], "unique_id": "model.jaffle_shop.stg_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_payments.sql", "original_file_path": "models/staging/stg_payments.sql", "name": "stg_payments", "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "113502ed19f04efb2af0629ff139f57f7463347b6d5218f3b80a8d128cc96852"}, "tags": ["staging", "hourly"], "refs": [["raw_payments"]], "sources": [], "description": "", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/staging/stg_payments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "tags": ["staging", "hourly"]}, "created_at": 1634004231, "compiled_sql": "with source as (\n select * from `your-gcp-project`.`jaffle_shop`.`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", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`stg_payments`"}, "model.jaffle_shop.stg_orders": {"raw_sql": "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", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_orders"]}, "config": {"enabled": true, "materialized": "view", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": ["staging", "hourly"], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_orders"], "unique_id": "model.jaffle_shop.stg_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_orders.sql", "original_file_path": "models/staging/stg_orders.sql", "name": "stg_orders", "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "afffa9cbc57e5fd2cf5898ebf571d444a62c9d6d7929d8133d30567fb9a2ce97"}, "tags": ["staging", "hourly"], "refs": [["raw_orders"]], "sources": [], "description": "", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/staging/stg_orders.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "tags": ["staging", "hourly"]}, "created_at": 1634004231, "compiled_sql": "with source as (\n select * from `your-gcp-project`.`jaffle_shop`.`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", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`stg_orders`"}, "model.jaffle_shop.dim_customers": {"raw_sql": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\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 using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_customers", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "dim_customers"], "unique_id": "model.jaffle_shop.dim_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/dim_customers.sql", "original_file_path": "models/marts/core/dim_customers.sql", "name": "dim_customers", "alias": "dim_customers", "checksum": {"name": "sha256", "checksum": "95d544c0e900d9ac69d0471bad24e03c63a268dbc493559023b58b7618c49b3a"}, "tags": [], "refs": [["stg_customers"], ["customer_orders"], ["customer_payments"]], "sources": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "Customer's email address. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_order": {"name": "first_order", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "most_recent_order": {"name": "most_recent_order", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_order_amount": {"name": "total_order_amount", "description": "Total value (AUD) of a customer's orders", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/marts/core/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/marts/core/dim_customers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1634004232, "compiled_sql": "with customers as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_customers`\n\n),\n\ncustomer_orders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`customer_orders`\n\n),\n\ncustomer_payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`customer_payments`\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\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 using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`dim_customers`"}, "model.jaffle_shop.fct_orders": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\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 left join order_payments using (order_id)\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.order_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "fct_orders"], "unique_id": "model.jaffle_shop.fct_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/fct_orders.sql", "original_file_path": "models/marts/core/fct_orders.sql", "name": "fct_orders", "alias": "fct_orders", "checksum": {"name": "sha256", "checksum": "49634cca4e40171ea98f62a1a3a9999e3487c42aca3ee79ecaaf99900ead1fd8"}, "tags": [], "refs": [["stg_orders"], ["order_payments"]], "sources": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "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": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/marts/core/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/marts/core/fct_orders.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1634004232, "compiled_sql": "\n\nwith orders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n\n),\n\norder_payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`order_payments`\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 order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments using (order_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`fct_orders`"}, "model.jaffle_shop.order_payments": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "order_payments"], "unique_id": "model.jaffle_shop.order_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/order_payments.sql", "original_file_path": "models/marts/core/intermediate/order_payments.sql", "name": "order_payments", "alias": "order_payments", "checksum": {"name": "sha256", "checksum": "6af89b1b7d0e9fe6b2b54118cf2addf0bab34ccc49b054eab93f8d7056fb7c52"}, "tags": [], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/intermediate/order_payments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1634004231, "compiled_sql": "\n\nwith payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_payments`\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`order_payments`"}, "model.jaffle_shop.customer_payments": {"raw_sql": "with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_payments", "model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_payments"], "unique_id": "model.jaffle_shop.customer_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/customer_payments.sql", "original_file_path": "models/marts/core/intermediate/customer_payments.sql", "name": "customer_payments", "alias": "customer_payments", "checksum": {"name": "sha256", "checksum": "feb9a66904fe7968464b947a2289c795d58fbc7f1e14a3c9975dc261d94cb351"}, "tags": [], "refs": [["stg_payments"], ["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/intermediate/customer_payments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1634004231, "compiled_sql": "with payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_payments`\n\n),\n\norders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`customer_payments`"}, "model.jaffle_shop.customer_orders": {"raw_sql": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "table", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_orders"], "unique_id": "model.jaffle_shop.customer_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/customer_orders.sql", "original_file_path": "models/marts/core/intermediate/customer_orders.sql", "name": "customer_orders", "alias": "customer_orders", "checksum": {"name": "sha256", "checksum": "20c96fcb3cf2235582de807d64cd1cdbdd3a419786bf1ceaae0ef208e7ed3dd7"}, "tags": [], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/intermediate/customer_orders.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1634004231, "compiled_sql": "with orders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`customer_orders`"}, "seed.jaffle_shop.raw_customers": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_customers"], "unique_id": "seed.jaffle_shop.raw_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_customers.csv", "original_file_path": "data/raw_customers.csv", "name": "raw_customers", "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "714f9e3dddfcd62fe967462621908ba59cae1502d1661ee8d8649ba7a56cb830"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`raw_customers`"}, "seed.jaffle_shop.raw_orders": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_orders"], "unique_id": "seed.jaffle_shop.raw_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_orders.csv", "original_file_path": "data/raw_orders.csv", "name": "raw_orders", "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ee6c68d1639ec2b23a4495ec12475e09b8ed4b61e23ab0411ea7ec76648356f7"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`raw_orders`"}, "seed.jaffle_shop.raw_payments": {"raw_sql": "", "compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "materialized": "seed", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": null, "database": null, "tags": [], "full_refresh": null, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_payments"], "unique_id": "seed.jaffle_shop.raw_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_payments.csv", "original_file_path": "data/raw_payments.csv", "name": "raw_payments", "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "03fd407f3135f84456431a923f22fc185a2154079e210c20b690e3ab11687d11"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`raw_payments`"}, "test.jaffle_shop.unique_stg_customers_customer_id.5530022331": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_customers') }} where {{config.get('where')}}) stg_customers{% else %}{{ ref('stg_customers') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id.5530022331", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_customers_customer_id", "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_customers_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_customers`\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.not_null_stg_customers_customer_id.4ab9034fe1": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_customers') }} where {{config.get('where')}}) stg_customers{% else %}{{ ref('stg_customers') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id.4ab9034fe1", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_customers_customer_id", "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_customers_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`stg_customers`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.unique_stg_orders_order_id.99e62d7d48": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_orders') }} where {{config.get('where')}}) stg_orders{% else %}{{ ref('stg_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_order_id"], "unique_id": "test.jaffle_shop.unique_stg_orders_order_id.99e62d7d48", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_order_id", "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_orders_order_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_orders`\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.not_null_stg_orders_order_id.052f14ae90": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_orders') }} where {{config.get('where')}}) stg_orders{% else %}{{ ref('stg_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id.052f14ae90", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_orders_order_id", "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_orders_order_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`stg_orders`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.unique_stg_orders_status.c1012c9cf4": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}{{ config(store_failures=False) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "status", "model": "{% if config.get('where') %}(select * from {{ ref('stg_orders') }} where {{config.get('where')}}) stg_orders{% else %}{{ ref('stg_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": false, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_status"], "unique_id": "test.jaffle_shop.unique_stg_orders_status.c1012c9cf4", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_orders_status.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_status", "alias": "unique_stg_orders_status", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_orders_status.sql", "build_path": null, "deferred": false, "unrendered_config": {"store_failures": false}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect\n status as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_orders`\nwhere status is not null\ngroup by status\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "status"}, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.1b7358ad3f": {"raw_sql": "{{ test_accepted_values(**_dbt_schema_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{% if config.get('where') %}(select * from {{ ref('stg_orders') }} where {{config.get('where')}}) stg_orders{% else %}{{ ref('stg_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.default__test_accepted_values"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.1b7358ad3f", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n group by 1\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "status"}, "test.jaffle_shop.unique_stg_payments_payment_id.5f5522e7d6": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_payments') }} where {{config.get('where')}}) stg_payments{% else %}{{ ref('stg_payments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id.5f5522e7d6", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_payments_payment_id", "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_payments_payment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_payments`\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "payment_id"}, "test.jaffle_shop.not_null_stg_payments_payment_id.ece096e012": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{% if config.get('where') %}(select * from {{ ref('stg_payments') }} where {{config.get('where')}}) stg_payments{% else %}{{ ref('stg_payments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id.ece096e012", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_payments_payment_id", "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_payments_payment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`stg_payments`\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "payment_id"}, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.59d3da1081": {"raw_sql": "{{ test_accepted_values(**_dbt_schema_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{% if config.get('where') %}(select * from {{ ref('stg_payments') }} where {{config.get('where')}}) stg_payments{% else %}{{ ref('stg_payments') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.default__test_accepted_values"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.59d3da1081", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1634004231, "compiled_sql": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from `your-gcp-project`.`jaffle_shop`.`stg_payments`\n group by 1\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "payment_method"}, "test.jaffle_shop.unique_dim_customers_customer_id.614ed4fd85": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('dim_customers') }} where {{config.get('where')}}) dim_customers{% else %}{{ ref('dim_customers') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.dim_customers"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id.614ed4fd85", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_dim_customers_customer_id", "alias": "unique_dim_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_dim_customers_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`dim_customers`\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.not_null_dim_customers_customer_id.f962be5a88": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('dim_customers') }} where {{config.get('where')}}) dim_customers{% else %}{{ ref('dim_customers') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.dim_customers"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id.f962be5a88", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_dim_customers_customer_id", "alias": "not_null_dim_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_dim_customers_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`dim_customers`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.unique_fct_orders_order_id.751c25cf10": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_fct_orders_order_id"], "unique_id": "test.jaffle_shop.unique_fct_orders_order_id.751c25cf10", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_fct_orders_order_id", "alias": "unique_fct_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_fct_orders_order_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.not_null_fct_orders_order_id.98fd6393e1": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id.98fd6393e1", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_order_id", "alias": "not_null_fct_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_order_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.not_null_fct_orders_customer_id.2dcbb6b255": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_customer_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id.2dcbb6b255", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_customer_id", "alias": "not_null_fct_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_customer_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a": {"raw_sql": "{{ test_relationships(**_dbt_schema_test_kwargs) }}{{ config(alias=\"relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c\") }}", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('dim_customers')", "field": "customer_id", "column_name": "customer_id", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.default__test_relationships"], "nodes": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"], "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c.sql", "original_file_path": "models/marts/core/schema.yml", "name": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "alias": "relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"], ["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c"}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nwith child as (\n select customer_id as from_field\n from `your-gcp-project`.`jaffle_shop`.`fct_orders`\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from `your-gcp-project`.`jaffle_shop`.`dim_customers`\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\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.c6ceeada8f": {"raw_sql": "{{ test_accepted_values(**_dbt_schema_test_kwargs) }}{{ config(alias=\"accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.default__test_accepted_values"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": "accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81", "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.c6ceeada8f", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81.sql", "original_file_path": "models/marts/core/schema.yml", "name": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81"}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from `your-gcp-project`.`jaffle_shop`.`fct_orders`\n group by 1\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "status"}, "test.jaffle_shop.not_null_fct_orders_amount.096cbd4ed3": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_amount.096cbd4ed3", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_amount", "alias": "not_null_fct_orders_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_amount.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "amount"}, "test.jaffle_shop.not_null_fct_orders_credit_card_amount.f435aa4336": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_credit_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount.f435aa4336", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_credit_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_credit_card_amount", "alias": "not_null_fct_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_credit_card_amount.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "credit_card_amount"}, "test.jaffle_shop.not_null_fct_orders_coupon_amount.725a493a4f": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_coupon_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount.725a493a4f", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_coupon_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_coupon_amount", "alias": "not_null_fct_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_coupon_amount.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "coupon_amount"}, "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.3fc63a21e2": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_bank_transfer_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.3fc63a21e2", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_bank_transfer_amount", "alias": "not_null_fct_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_bank_transfer_amount.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "bank_transfer_amount"}, "test.jaffle_shop.not_null_fct_orders_gift_card_amount.559f930602": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{% if config.get('where') %}(select * from {{ ref('fct_orders') }} where {{config.get('where')}}) fct_orders{% else %}{{ ref('fct_orders') }}{% endif %}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "materialized": "test", "persist_docs": {}, "vars": {}, "quoting": {}, "column_types": {}, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "full_refresh": null, "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_gift_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount.559f930602", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_gift_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_gift_card_amount", "alias": "not_null_fct_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_gift_card_amount.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1634004232, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "gift_card_amount"}}, "sources": {}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__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\n create or replace view {{ relation }}\n {{ bigquery_table_options(config, model, temporary=false) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view(run_outside_transaction_hooks=False) %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt_bigquery.make_date_partitioned_table", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {# there should be exactly one ref or exactly one source #}\n {% set destination = this.incorporate(type='table') %}\n\n {% set dependency_type = none %}\n {% if (model.refs | length) == 1 and (model.sources | length) == 0 %}\n {% set dependency_type = 'ref' %}\n {% elif (model.refs | length) == 0 and (model.sources | length) == 1 %}\n {% set dependency_type = 'source' %}\n {% else %}\n {% set msg %}\n Expected exactly one ref or exactly one source, instead got {{ model.refs | length }} models and {{ model.sources | length }} sources.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n\n {% if dependency_type == 'ref' %}\n {% set src = ref(*model.refs[0]) %}\n {% else %}\n {% set src = source(*model.sources[0]) %}\n {% endif %}\n\n {%- set result_str = adapter.copy_table(\n src,\n destination,\n config.get('copy_materialization', 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% else %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation,\n target_relation,\n sql,\n unique_key,\n partition_by,\n partitions,\n dest_columns) %}\n\n {% else %}\n {#-- wrap sql in parens to make it a subquery --#}\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "materialization_test_default", "macro_sql": "\n\n{%- 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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n ;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/fishtown-analytics/dbt/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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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_sql']) %}\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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "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.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.basic_load_csv_rows": {"unique_id": "macro.dbt.basic_load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "basic_load_csv_rows", "macro_sql": "{% macro basic_load_csv_rows(model, batch_size, agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n %s\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_seed_column_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n {{ return(basic_load_csv_rows(model, 10000, agate_table) )}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.basic_load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\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 {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\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 %}", "resource_type": "macro", "tags": [], "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.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\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 {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n {% elif existing_relation.is_view or should_full_refresh() %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% do adapter.drop_relation(intermediate_relation) %}\n {% do adapter.drop_relation(backup_relation) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\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 {% endif %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.should_full_refresh", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.incremental_upsert", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_merge_sql", "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 update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\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{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_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 is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n );\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.common_get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\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\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exists for some reason\n {{ adapter.drop_relation(intermediate_relation) }}\n {{ adapter.drop_relation(backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(target_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs", "macro.dbt.drop_relation_if_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', macro_namespace = 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view(run_outside_transaction_hooks=True) %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\n {% if run_outside_transaction_hooks %}\n -- no transactions on BigQuery\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n {% endif %}\n\n -- `BEGIN` happens here on Snowflake\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\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 {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if run_outside_transaction_hooks %}\n -- No transactions on BigQuery\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n {% endif %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_relation", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by 1\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1634004231}}, "docs": {"jaffle_shop.__overview__": {"unique_id": "jaffle_shop.__overview__", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "overview.md", "original_file_path": "models/overview.md", "name": "__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "jaffle_shop.orders_status": {"unique_id": "jaffle_shop.orders_status", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/docs.md", "original_file_path": "models/marts/core/docs.md", "name": "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 |"}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.20/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], "model.jaffle_shop.stg_payments": ["seed.jaffle_shop.raw_payments"], "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], "model.jaffle_shop.dim_customers": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.stg_customers"], "model.jaffle_shop.fct_orders": ["model.jaffle_shop.order_payments", "model.jaffle_shop.stg_orders"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_customers": [], "seed.jaffle_shop.raw_orders": [], "seed.jaffle_shop.raw_payments": [], "test.jaffle_shop.unique_stg_customers_customer_id.5530022331": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.not_null_stg_customers_customer_id.4ab9034fe1": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.unique_stg_orders_order_id.99e62d7d48": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.not_null_stg_orders_order_id.052f14ae90": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_orders_status.c1012c9cf4": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.1b7358ad3f": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_payments_payment_id.5f5522e7d6": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.not_null_stg_payments_payment_id.ece096e012": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.59d3da1081": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_dim_customers_customer_id.614ed4fd85": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.not_null_dim_customers_customer_id.f962be5a88": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.unique_fct_orders_order_id.751c25cf10": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_order_id.98fd6393e1": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_customer_id.2dcbb6b255": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.c6ceeada8f": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_amount.096cbd4ed3": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_credit_card_amount.f435aa4336": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_coupon_amount.725a493a4f": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.3fc63a21e2": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_gift_card_amount.559f930602": ["model.jaffle_shop.fct_orders"]}, "child_map": {"model.jaffle_shop.stg_customers": ["model.jaffle_shop.dim_customers", "test.jaffle_shop.not_null_stg_customers_customer_id.4ab9034fe1", "test.jaffle_shop.unique_stg_customers_customer_id.5530022331"], "model.jaffle_shop.stg_payments": ["model.jaffle_shop.customer_payments", "model.jaffle_shop.order_payments", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.59d3da1081", "test.jaffle_shop.not_null_stg_payments_payment_id.ece096e012", "test.jaffle_shop.unique_stg_payments_payment_id.5f5522e7d6"], "model.jaffle_shop.stg_orders": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.fct_orders", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.1b7358ad3f", "test.jaffle_shop.not_null_stg_orders_order_id.052f14ae90", "test.jaffle_shop.unique_stg_orders_order_id.99e62d7d48", "test.jaffle_shop.unique_stg_orders_status.c1012c9cf4"], "model.jaffle_shop.dim_customers": ["test.jaffle_shop.not_null_dim_customers_customer_id.f962be5a88", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a", "test.jaffle_shop.unique_dim_customers_customer_id.614ed4fd85"], "model.jaffle_shop.fct_orders": ["test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.c6ceeada8f", "test.jaffle_shop.not_null_fct_orders_amount.096cbd4ed3", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.3fc63a21e2", "test.jaffle_shop.not_null_fct_orders_coupon_amount.725a493a4f", "test.jaffle_shop.not_null_fct_orders_credit_card_amount.f435aa4336", "test.jaffle_shop.not_null_fct_orders_customer_id.2dcbb6b255", "test.jaffle_shop.not_null_fct_orders_gift_card_amount.559f930602", "test.jaffle_shop.not_null_fct_orders_order_id.98fd6393e1", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a", "test.jaffle_shop.unique_fct_orders_order_id.751c25cf10"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.fct_orders"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.dim_customers"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.dim_customers"], "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_stg_customers_customer_id.5530022331": [], "test.jaffle_shop.not_null_stg_customers_customer_id.4ab9034fe1": [], "test.jaffle_shop.unique_stg_orders_order_id.99e62d7d48": [], "test.jaffle_shop.not_null_stg_orders_order_id.052f14ae90": [], "test.jaffle_shop.unique_stg_orders_status.c1012c9cf4": [], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.1b7358ad3f": [], "test.jaffle_shop.unique_stg_payments_payment_id.5f5522e7d6": [], "test.jaffle_shop.not_null_stg_payments_payment_id.ece096e012": [], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.59d3da1081": [], "test.jaffle_shop.unique_dim_customers_customer_id.614ed4fd85": [], "test.jaffle_shop.not_null_dim_customers_customer_id.f962be5a88": [], "test.jaffle_shop.unique_fct_orders_order_id.751c25cf10": [], "test.jaffle_shop.not_null_fct_orders_order_id.98fd6393e1": [], "test.jaffle_shop.not_null_fct_orders_customer_id.2dcbb6b255": [], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a": [], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.c6ceeada8f": [], "test.jaffle_shop.not_null_fct_orders_amount.096cbd4ed3": [], "test.jaffle_shop.not_null_fct_orders_credit_card_amount.f435aa4336": [], "test.jaffle_shop.not_null_fct_orders_coupon_amount.725a493a4f": [], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.3fc63a21e2": [], "test.jaffle_shop.not_null_fct_orders_gift_card_amount.559f930602": []}} diff --git a/tests/resources/v2/jaffle_shop/run_results.json b/tests/resources/v2/jaffle_shop/run_results.json new file mode 100644 index 0000000..a0e5a0a --- /dev/null +++ b/tests/resources/v2/jaffle_shop/run_results.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v2.json", "dbt_version": "0.20.2", "generated_at": "2021-10-12T02:04:52.706766Z", "invocation_id": "8421d116-cbcd-420a-8e74-9f958fdddb37", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.508436Z", "completed_at": "2021-10-12T02:04:52.515334Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.518874Z", "completed_at": "2021-10-12T02:04:52.518927Z"}], "thread_id": "Thread-1", "execution_time": 0.012974977493286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.jaffle_shop.raw_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.509239Z", "completed_at": "2021-10-12T02:04:52.518633Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.519307Z", "completed_at": "2021-10-12T02:04:52.519321Z"}], "thread_id": "Thread-2", "execution_time": 0.012588024139404297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.jaffle_shop.raw_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.512350Z", "completed_at": "2021-10-12T02:04:52.522212Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.523093Z", "completed_at": "2021-10-12T02:04:52.523106Z"}], "thread_id": "Thread-3", "execution_time": 0.014930248260498047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.jaffle_shop.raw_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.523236Z", "completed_at": "2021-10-12T02:04:52.532326Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.534876Z", "completed_at": "2021-10-12T02:04:52.534889Z"}], "thread_id": "Thread-5", "execution_time": 0.01318216323852539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.stg_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.523349Z", "completed_at": "2021-10-12T02:04:52.535072Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.535720Z", "completed_at": "2021-10-12T02:04:52.535727Z"}], "thread_id": "Thread-1", "execution_time": 0.013710975646972656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.stg_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.532194Z", "completed_at": "2021-10-12T02:04:52.536161Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.536945Z", "completed_at": "2021-10-12T02:04:52.536984Z"}], "thread_id": "Thread-2", "execution_time": 0.006134033203125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.stg_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.539929Z", "completed_at": "2021-10-12T02:04:52.571195Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.571808Z", "completed_at": "2021-10-12T02:04:52.571953Z"}], "thread_id": "Thread-3", "execution_time": 0.034677982330322266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.customer_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.540077Z", "completed_at": "2021-10-12T02:04:52.571489Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.572523Z", "completed_at": "2021-10-12T02:04:52.572543Z"}], "thread_id": "Thread-1", "execution_time": 0.03581118583679199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.1b7358ad3f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.540207Z", "completed_at": "2021-10-12T02:04:52.572323Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.573934Z", "completed_at": "2021-10-12T02:04:52.573950Z"}], "thread_id": "Thread-4", "execution_time": 0.03645205497741699, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id.052f14ae90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.540572Z", "completed_at": "2021-10-12T02:04:52.573578Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.575106Z", "completed_at": "2021-10-12T02:04:52.575116Z"}], "thread_id": "Thread-5", "execution_time": 0.036599159240722656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.unique_stg_orders_order_id.99e62d7d48"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.559498Z", "completed_at": "2021-10-12T02:04:52.573711Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.575242Z", "completed_at": "2021-10-12T02:04:52.575250Z"}], "thread_id": "Thread-2", "execution_time": 0.0361020565032959, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.unique_stg_orders_status.c1012c9cf4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.577141Z", "completed_at": "2021-10-12T02:04:52.591894Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.599644Z", "completed_at": "2021-10-12T02:04:52.599657Z"}], "thread_id": "Thread-3", "execution_time": 0.02526688575744629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.customer_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.577865Z", "completed_at": "2021-10-12T02:04:52.599317Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.600460Z", "completed_at": "2021-10-12T02:04:52.600469Z"}], "thread_id": "Thread-1", "execution_time": 0.024742841720581055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.order_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.581674Z", "completed_at": "2021-10-12T02:04:52.600158Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.601283Z", "completed_at": "2021-10-12T02:04:52.601291Z"}], "thread_id": "Thread-4", "execution_time": 0.025011777877807617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.59d3da1081"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.585094Z", "completed_at": "2021-10-12T02:04:52.600684Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.601751Z", "completed_at": "2021-10-12T02:04:52.601757Z"}], "thread_id": "Thread-5", "execution_time": 0.02197098731994629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id.ece096e012"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.585306Z", "completed_at": "2021-10-12T02:04:52.601123Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.602116Z", "completed_at": "2021-10-12T02:04:52.602121Z"}], "thread_id": "Thread-2", "execution_time": 0.022360801696777344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id.5f5522e7d6"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.604590Z", "completed_at": "2021-10-12T02:04:52.620201Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.621010Z", "completed_at": "2021-10-12T02:04:52.621023Z"}], "thread_id": "Thread-3", "execution_time": 0.018351078033447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id.4ab9034fe1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.605049Z", "completed_at": "2021-10-12T02:04:52.620781Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.621373Z", "completed_at": "2021-10-12T02:04:52.621382Z"}], "thread_id": "Thread-1", "execution_time": 0.018207311630249023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id.5530022331"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.609700Z", "completed_at": "2021-10-12T02:04:52.621226Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.621923Z", "completed_at": "2021-10-12T02:04:52.621929Z"}], "thread_id": "Thread-4", "execution_time": 0.018020153045654297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.dim_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.613465Z", "completed_at": "2021-10-12T02:04:52.622018Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.622932Z", "completed_at": "2021-10-12T02:04:52.622937Z"}], "thread_id": "Thread-5", "execution_time": 0.01856207847595215, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.jaffle_shop.fct_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.625119Z", "completed_at": "2021-10-12T02:04:52.646708Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.650656Z", "completed_at": "2021-10-12T02:04:52.650669Z"}], "thread_id": "Thread-5", "execution_time": 0.027801036834716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id.f962be5a88"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.625740Z", "completed_at": "2021-10-12T02:04:52.646848Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.651123Z", "completed_at": "2021-10-12T02:04:52.651132Z"}], "thread_id": "Thread-2", "execution_time": 0.027894020080566406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id.614ed4fd85"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.635718Z", "completed_at": "2021-10-12T02:04:52.651280Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.652783Z", "completed_at": "2021-10-12T02:04:52.652791Z"}], "thread_id": "Thread-1", "execution_time": 0.023637056350708008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.c6ceeada8f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.635922Z", "completed_at": "2021-10-12T02:04:52.651607Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.653009Z", "completed_at": "2021-10-12T02:04:52.653017Z"}], "thread_id": "Thread-4", "execution_time": 0.023411989212036133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_amount.096cbd4ed3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.636162Z", "completed_at": "2021-10-12T02:04:52.653154Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.654286Z", "completed_at": "2021-10-12T02:04:52.654294Z"}], "thread_id": "Thread-3", "execution_time": 0.02017688751220703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.3fc63a21e2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.655730Z", "completed_at": "2021-10-12T02:04:52.677865Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.684823Z", "completed_at": "2021-10-12T02:04:52.684842Z"}], "thread_id": "Thread-2", "execution_time": 0.03143310546875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount.f435aa4336"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.655580Z", "completed_at": "2021-10-12T02:04:52.683570Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.685319Z", "completed_at": "2021-10-12T02:04:52.685333Z"}], "thread_id": "Thread-5", "execution_time": 0.032566070556640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount.725a493a4f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.663386Z", "completed_at": "2021-10-12T02:04:52.685047Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.686473Z", "completed_at": "2021-10-12T02:04:52.686498Z"}], "thread_id": "Thread-1", "execution_time": 0.03232383728027344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id.2dcbb6b255"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.663486Z", "completed_at": "2021-10-12T02:04:52.685690Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.687373Z", "completed_at": "2021-10-12T02:04:52.687388Z"}], "thread_id": "Thread-4", "execution_time": 0.03291893005371094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount.559f930602"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.675629Z", "completed_at": "2021-10-12T02:04:52.687568Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.689200Z", "completed_at": "2021-10-12T02:04:52.689215Z"}], "thread_id": "Thread-3", "execution_time": 0.026946067810058594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id.98fd6393e1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.690746Z", "completed_at": "2021-10-12T02:04:52.703727Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.703875Z", "completed_at": "2021-10-12T02:04:52.703915Z"}], "thread_id": "Thread-2", "execution_time": 0.014830827713012695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.b0e7be428a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-10-12T02:04:52.690864Z", "completed_at": "2021-10-12T02:04:52.704468Z"}, {"name": "execute", "started_at": "2021-10-12T02:04:52.704620Z", "completed_at": "2021-10-12T02:04:52.704627Z"}], "thread_id": "Thread-5", "execution_time": 0.014948844909667969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.jaffle_shop.unique_fct_orders_order_id.751c25cf10"}], "elapsed_time": 1.3820841312408447, "args": {"log_format": "default", "write_json": true, "use_experimental_parser": false, "profiles_dir": "/Users/yu/local/src/github/jaffle_shop", "use_cache": true, "compile": true, "version_check": true, "which": "generate", "rpc_method": "docs.generate"}} \ No newline at end of file diff --git a/tests/resources/v3/jaffle_shop/manifest.json b/tests/resources/v3/jaffle_shop/manifest.json new file mode 100644 index 0000000..73748f2 --- /dev/null +++ b/tests/resources/v3/jaffle_shop/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v3.json", "dbt_version": "0.21.0", "generated_at": "2021-11-08T09:31:10.463219+00:00", "invocation_id": "82d7358c-727f-4eef-88d2-26be34c225b1", "env": {}, "project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "bigquery"}, "nodes": {"model.jaffle_shop.stg_customers": {"raw_sql": "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 email\n\n from source\n\n)\n\nselect * from renamed", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"], "nodes": ["seed.jaffle_shop.raw_customers"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_customers"], "unique_id": "model.jaffle_shop.stg_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_customers.sql", "original_file_path": "models/staging/stg_customers.sql", "name": "stg_customers", "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "8aaf3f82d6948a706a8fd6e40493a59446ab84436c800b9bb986d6af6d3dc073"}, "tags": [], "refs": [["raw_customers"]], "sources": [], "description": "", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/staging/stg_customers.sql", "build_path": "target/run/jaffle_shop/models/staging/stg_customers.sql", "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1636363871, "compiled_sql": "with source as (\n select * from `your-gcp-project`.`jaffle_shop`.`raw_customers`\n\n),\n\nrenamed as (\n\n select\n id as customer_id,\n first_name,\n last_name,\n email\n\n from source\n\n)\n\nselect * from renamed", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`stg_customers`"}, "model.jaffle_shop.stg_payments": {"raw_sql": "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", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"], "nodes": ["seed.jaffle_shop.raw_payments"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_payments"], "unique_id": "model.jaffle_shop.stg_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_payments.sql", "original_file_path": "models/staging/stg_payments.sql", "name": "stg_payments", "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "113502ed19f04efb2af0629ff139f57f7463347b6d5218f3b80a8d128cc96852"}, "tags": [], "refs": [["raw_payments"]], "sources": [], "description": "", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/staging/stg_payments.sql", "build_path": "target/run/jaffle_shop/models/staging/stg_payments.sql", "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1636363871, "compiled_sql": "with source as (\n select * from `your-gcp-project`.`jaffle_shop`.`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", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`stg_payments`"}, "model.jaffle_shop.dim_customers": {"raw_sql": "with customers as (\n\n select * from {{ ref('stg_customers') }}\n\n),\n\ncustomer_orders as (\n\n select * from {{ ref('customer_orders') }}\n\n),\n\ncustomer_payments as (\n\n select * from {{ ref('customer_payments') }}\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\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 using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.persist_docs"], "nodes": ["model.jaffle_shop.stg_customers", "model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "dim_customers"], "unique_id": "model.jaffle_shop.dim_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/dim_customers.sql", "original_file_path": "models/marts/core/dim_customers.sql", "name": "dim_customers", "alias": "dim_customers", "checksum": {"name": "sha256", "checksum": "95d544c0e900d9ac69d0471bad24e03c63a268dbc493559023b58b7618c49b3a"}, "tags": [], "refs": [["stg_customers"], ["customer_orders"], ["customer_payments"]], "sources": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "email": {"name": "email", "description": "Customer's email address. PII.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_order": {"name": "first_order", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "most_recent_order": {"name": "most_recent_order", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_order_amount": {"name": "total_order_amount", "description": "Total value (AUD) of a customer's orders", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/marts/core/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/marts/core/dim_customers.sql", "build_path": "target/run/jaffle_shop/models/marts/core/dim_customers.sql", "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1636363871, "compiled_sql": "with customers as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_customers`\n\n),\n\ncustomer_orders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`customer_orders`\n\n),\n\ncustomer_payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`customer_payments`\n\n),\n\nfinal as (\n\n select\n customers.customer_id,\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 using (customer_id)\n\n left join customer_payments using (customer_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`dim_customers`"}, "model.jaffle_shop.fct_orders": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\norder_payments as (\n\n select * from {{ ref('order_payments') }}\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 left join order_payments using (order_id)\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.persist_docs"], "nodes": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.order_payments"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "fct_orders"], "unique_id": "model.jaffle_shop.fct_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/fct_orders.sql", "original_file_path": "models/marts/core/fct_orders.sql", "name": "fct_orders", "alias": "fct_orders", "checksum": {"name": "sha256", "checksum": "49634cca4e40171ea98f62a1a3a9999e3487c42aca3ee79ecaaf99900ead1fd8"}, "tags": [], "refs": [["stg_orders"], ["order_payments"]], "sources": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "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": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/marts/core/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/marts/core/fct_orders.sql", "build_path": "target/run/jaffle_shop/models/marts/core/fct_orders.sql", "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1636363871, "compiled_sql": "\n\nwith orders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n\n),\n\norder_payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`order_payments`\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 order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments using (order_id)\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`fct_orders`"}, "model.jaffle_shop.order_payments": {"raw_sql": "{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}\n\nwith payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.persist_docs"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "order_payments"], "unique_id": "model.jaffle_shop.order_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/order_payments.sql", "original_file_path": "models/marts/core/intermediate/order_payments.sql", "name": "order_payments", "alias": "order_payments", "checksum": {"name": "sha256", "checksum": "6af89b1b7d0e9fe6b2b54118cf2addf0bab34ccc49b054eab93f8d7056fb7c52"}, "tags": [], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/intermediate/order_payments.sql", "build_path": "target/run/jaffle_shop/models/marts/core/intermediate/order_payments.sql", "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1636363871, "compiled_sql": "\n\nwith payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_payments`\n\n),\n\nfinal as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`order_payments`"}, "model.jaffle_shop.customer_payments": {"raw_sql": "with payments as (\n\n select * from {{ ref('stg_payments') }}\n\n),\n\norders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.persist_docs"], "nodes": ["model.jaffle_shop.stg_payments", "model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_payments"], "unique_id": "model.jaffle_shop.customer_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/customer_payments.sql", "original_file_path": "models/marts/core/intermediate/customer_payments.sql", "name": "customer_payments", "alias": "customer_payments", "checksum": {"name": "sha256", "checksum": "feb9a66904fe7968464b947a2289c795d58fbc7f1e14a3c9975dc261d94cb351"}, "tags": [], "refs": [["stg_payments"], ["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/intermediate/customer_payments.sql", "build_path": "target/run/jaffle_shop/models/marts/core/intermediate/customer_payments.sql", "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1636363871, "compiled_sql": "with payments as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_payments`\n\n),\n\norders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n\n),\n\nfinal as (\n\n select\n orders.customer_id,\n sum(amount) as total_amount\n\n from payments\n\n left join orders using (order_id)\n\n group by 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`customer_payments`"}, "model.jaffle_shop.customer_orders": {"raw_sql": "with orders as (\n\n select * from {{ ref('stg_orders') }}\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.persist_docs"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "marts", "core", "intermediate", "customer_orders"], "unique_id": "model.jaffle_shop.customer_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/intermediate/customer_orders.sql", "original_file_path": "models/marts/core/intermediate/customer_orders.sql", "name": "customer_orders", "alias": "customer_orders", "checksum": {"name": "sha256", "checksum": "20c96fcb3cf2235582de807d64cd1cdbdd3a419786bf1ceaae0ef208e7ed3dd7"}, "tags": [], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/intermediate/customer_orders.sql", "build_path": "target/run/jaffle_shop/models/marts/core/intermediate/customer_orders.sql", "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1636363871, "compiled_sql": "with orders as (\n\n select * from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n\n),\n\nfinal 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 1\n\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`customer_orders`"}, "seed.jaffle_shop.raw_customers": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_customers"], "unique_id": "seed.jaffle_shop.raw_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_customers.csv", "original_file_path": "data/raw_customers.csv", "name": "raw_customers", "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "714f9e3dddfcd62fe967462621908ba59cae1502d1661ee8d8649ba7a56cb830"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": "target/run/jaffle_shop/data/raw_customers.csv", "deferred": false, "unrendered_config": {}, "created_at": 1636363871}, "seed.jaffle_shop.raw_orders": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_orders"], "unique_id": "seed.jaffle_shop.raw_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_orders.csv", "original_file_path": "data/raw_orders.csv", "name": "raw_orders", "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ee6c68d1639ec2b23a4495ec12475e09b8ed4b61e23ab0411ea7ec76648356f7"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": "target/run/jaffle_shop/data/raw_orders.csv", "deferred": false, "unrendered_config": {}, "created_at": 1636363871}, "seed.jaffle_shop.raw_payments": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_payments"], "unique_id": "seed.jaffle_shop.raw_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_payments.csv", "original_file_path": "data/raw_payments.csv", "name": "raw_payments", "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "03fd407f3135f84456431a923f22fc185a2154079e210c20b690e3ab11687d11"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": "target/run/jaffle_shop/data/raw_payments.csv", "deferred": false, "unrendered_config": {}, "created_at": 1636363871}, "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_customers_customer_id", "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_customers_customer_id.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_customers_customer_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_customers`\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_customers_customer_id", "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_customers_customer_id.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_customers_customer_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`stg_customers`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id.3744510712", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_payments_payment_id", "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_payments_payment_id.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_payments_payment_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_payments`\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "payment_id"}, "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_payments_payment_id", "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_payments_payment_id.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_payments_payment_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`stg_payments`\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "payment_id"}, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"raw_sql": "{{ test_accepted_values(**_dbt_schema_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.default__test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from `your-gcp-project`.`jaffle_shop`.`stg_payments`\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "payment_method"}, "test.jaffle_shop.unique_dim_customers_customer_id.15c9f1e2fd": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('dim_customers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.dim_customers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id.15c9f1e2fd", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_dim_customers_customer_id", "alias": "unique_dim_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_dim_customers_customer_id.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_dim_customers_customer_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`dim_customers`\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.not_null_dim_customers_customer_id.dd91cd1c8d": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('dim_customers')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.dim_customers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_dim_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id.dd91cd1c8d", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_dim_customers_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_dim_customers_customer_id", "alias": "not_null_dim_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_dim_customers_customer_id.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_dim_customers_customer_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`dim_customers`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.unique_fct_orders_order_id.523ddb6ce5": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_fct_orders_order_id"], "unique_id": "test.jaffle_shop.unique_fct_orders_order_id.523ddb6ce5", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "unique_fct_orders_order_id", "alias": "unique_fct_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_fct_orders_order_id.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/unique_fct_orders_order_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.not_null_fct_orders_order_id.4e687af8d0": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id.4e687af8d0", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_order_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_order_id", "alias": "not_null_fct_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_order_id.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_order_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.not_null_fct_orders_customer_id.16fe324f7b": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_customer_id"], "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id.16fe324f7b", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_customer_id.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_customer_id", "alias": "not_null_fct_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_customer_id.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_customer_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4": {"raw_sql": "{{ test_relationships(**_dbt_schema_test_kwargs) }}{{ config(alias=\"relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c\") }}", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('dim_customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.default__test_relationships", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": "relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_"], "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c.sql", "original_file_path": "models/marts/core/schema.yml", "name": "relationships_fct_orders_customer_id__customer_id__ref_dim_customers_", "alias": "relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["dim_customers"], ["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c.sql", "deferred": false, "unrendered_config": {"alias": "relationships_fct_orders_0c6c6d9e6f30dfb9b653557ebf38e47c"}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nwith child as (\n select customer_id as from_field\n from `your-gcp-project`.`jaffle_shop`.`fct_orders`\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from `your-gcp-project`.`jaffle_shop`.`dim_customers`\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\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "customer_id"}, "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.0aa0973768": {"raw_sql": "{{ test_accepted_values(**_dbt_schema_test_kwargs) }}{{ config(alias=\"accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.default__test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": "accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.0aa0973768", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81.sql", "original_file_path": "models/marts/core/schema.yml", "name": "accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81.sql", "deferred": false, "unrendered_config": {"alias": "accepted_values_fct_orders_910d5f3356b5e7a6f7932211f0768f81"}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from `your-gcp-project`.`jaffle_shop`.`fct_orders`\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "status"}, "test.jaffle_shop.not_null_fct_orders_amount.66810a8d08": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_amount.66810a8d08", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_amount", "alias": "not_null_fct_orders_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_amount.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_amount.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "amount"}, "test.jaffle_shop.not_null_fct_orders_credit_card_amount.56131cba63": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_credit_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount.56131cba63", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_credit_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_credit_card_amount", "alias": "not_null_fct_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_credit_card_amount.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_credit_card_amount.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "credit_card_amount"}, "test.jaffle_shop.not_null_fct_orders_coupon_amount.8a700a9568": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_coupon_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount.8a700a9568", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_coupon_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_coupon_amount", "alias": "not_null_fct_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_coupon_amount.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_coupon_amount.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "coupon_amount"}, "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.d808dd4fab": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_bank_transfer_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.d808dd4fab", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_bank_transfer_amount", "alias": "not_null_fct_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_bank_transfer_amount.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_bank_transfer_amount.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "bank_transfer_amount"}, "test.jaffle_shop.not_null_fct_orders_gift_card_amount.ec93756487": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('fct_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.fct_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_fct_orders_gift_card_amount"], "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount.ec93756487", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_fct_orders_gift_card_amount.sql", "original_file_path": "models/marts/core/schema.yml", "name": "not_null_fct_orders_gift_card_amount", "alias": "not_null_fct_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["fct_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_gift_card_amount.sql", "build_path": "target/run/jaffle_shop/models/marts/core/schema.yml/schema_test/not_null_fct_orders_gift_card_amount.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636363871, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`fct_orders`\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "gift_card_amount"}, "model.jaffle_shop.stg_orders": {"raw_sql": "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", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"], "nodes": ["seed.jaffle_shop.raw_orders"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_orders"], "unique_id": "model.jaffle_shop.stg_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_orders.sql", "original_file_path": "models/staging/stg_orders.sql", "name": "stg_orders", "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "afffa9cbc57e5fd2cf5898ebf571d444a62c9d6d7929d8133d30567fb9a2ce97"}, "tags": [], "refs": [["raw_orders"]], "sources": [], "description": "", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": "target/compiled/jaffle_shop/models/staging/stg_orders.sql", "build_path": "target/run/jaffle_shop/models/staging/stg_orders.sql", "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1636364061, "compiled_sql": "with source as (\n select * from `your-gcp-project`.`jaffle_shop`.`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", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`your-gcp-project`.`jaffle_shop`.`stg_orders`"}, "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": {"raw_sql": "{{ test_unique(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "unique_stg_orders_order_id"], "unique_id": "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_order_id", "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_orders_order_id.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/unique_stg_orders_order_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636364061, "compiled_sql": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom `your-gcp-project`.`jaffle_shop`.`stg_orders`\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": {"raw_sql": "{{ test_not_null(**_dbt_schema_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "not_null_stg_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_orders_order_id", "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_orders_order_id.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/not_null_stg_orders_order_id.sql", "deferred": false, "unrendered_config": {}, "created_at": 1636364061, "compiled_sql": "\n \n \n\nselect *\nfrom `your-gcp-project`.`jaffle_shop`.`stg_orders`\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "order_id"}, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"raw_sql": "{{ test_accepted_values(**_dbt_schema_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.default__test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "schema_test", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "schema_test/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "tags": ["schema"], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "build_path": "target/run/jaffle_shop/models/staging/schema.yml/schema_test/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1636364061, "compiled_sql": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from `your-gcp-project`.`jaffle_shop`.`stg_orders`\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "status"}}, "sources": {}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__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\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.make_date_partitioned_table": {"unique_id": "macro.dbt_bigquery.make_date_partitioned_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "make_date_partitioned_table", "macro_sql": "{% macro make_date_partitioned_table(model, relation, dates, should_create, verbose=False) %}\n\n {% if should_create %}\n {{ adapter.make_date_partitioned_table(relation) }}\n {% endif %}\n\n {% for date in dates %}\n {% set date = (date | string) %}\n {% if verbose %}\n {% set table_start_time = modules.datetime.datetime.now().strftime(\"%H:%M:%S\") %}\n {{ log(table_start_time ~ ' | -> Running for day ' ~ date, info=True) }}\n {% endif %}\n\n {% set fixed_sql = model['compiled_sql'] | replace('[DBT__PARTITION_DATE]', date) %}\n {% set _ = adapter.execute_model(model, 'table', fixed_sql, decorator=date) %}\n {% endfor %}\n\n {% set num_days = dates | length %}\n {% if num_days == 1 %}\n {% set result_str = 'CREATED 1 PARTITION' %}\n {% else %}\n {% set result_str = 'CREATED ' ~ num_days ~ ' PARTITIONS' %}\n {% endif %}\n\n {{ store_result('main', response=result_str) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n {%- set verbose = config.get('verbose', False) -%}\n\n {# partitions: iterate over each partition, running a separate query in a for-loop #}\n {%- set partitions = config.get('partitions') -%}\n\n {% if partitions %}\n {% if partitions is number or partitions is string %}\n {% set partitions = [(partitions | string)] %}\n {% endif %}\n\n {% if partitions is not iterable %}\n {{ exceptions.raise_compiler_error(\"Provided `partitions` configuration is not a list. Got: \" ~ partitions, model) }}\n {% endif %}\n {% endif %}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n Since dbt uses WRITE_TRUNCATE mode for tables, we only need to drop this thing\n if it is not a table. If it _is_ already a table, then we can overwrite it without downtime\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {% if partitions %}\n {# Create the dp-table if 1. it does not exist or 2. it existed, but we just dropped it #}\n {%- set should_create = (old_relation is none or exists_not_as_table) -%}\n {{ make_date_partitioned_table(model, target_relation, partitions, should_create, verbose) }}\n {% else %}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt_bigquery.make_date_partitioned_table", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% set tmp_relation_exists = true %}\n {% do process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n \n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/core.sql", "original_file_path": "macros/core.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "materialization_test_default", "macro_sql": "\n\n{%- 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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.column_list": {"unique_id": "macro.dbt.column_list", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list", "macro_sql": "{% macro column_list(columns) %}\n {%- for col in columns %}\n {{ col.name }} {% if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.column_list_for_create_table": {"unique_id": "macro.dbt.column_list_for_create_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "column_list_for_create_table", "macro_sql": "{% macro column_list_for_create_table(columns) %}\n {%- for col in columns %}\n {{ col.name }} {{ col.data_type }} {%- if not loop.last %},{% endif %}\n {% endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/helpers.sql", "original_file_path": "macros/materializations/helpers.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt/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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/strategies.sql", "original_file_path": "macros/materializations/snapshot/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshot/snapshot.sql", "original_file_path": "macros/materializations/snapshot/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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_sql']) %}\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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "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.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seed/seed.sql", "original_file_path": "macros/materializations/seed/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\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 {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\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 %}", "resource_type": "macro", "tags": [], "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.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.incremental_upsert": {"unique_id": "macro.dbt.incremental_upsert", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/helpers.sql", "original_file_path": "macros/materializations/incremental/helpers.sql", "name": "incremental_upsert", "macro_sql": "{% macro incremental_upsert(tmp_relation, target_relation, unique_key=none, statement_name=\"main\") %}\n \n {%- set dest_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set dest_cols_csv = dest_columns | map(attribute='quoted') | join(', ') -%}\n\n {%- if unique_key is not none -%}\n delete\n from {{ target_relation }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ tmp_relation }}\n );\n {%- endif %}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ tmp_relation }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/incremental.sql", "original_file_path": "macros/materializations/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ 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 = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=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 {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {% do process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% set build_sql = incremental_upsert(tmp_relation, target_relation, unique_key=unique_key) %}\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 {% endif %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.incremental_upsert", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/incremental/on_schema_change.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/incremental/on_schema_change.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n \n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change != 'ignore' %}\n \n {% 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 {% 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 {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_merge_sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_delete_insert_merge_sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_merge_sql", "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 update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\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{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.common_get_delete_insert_merge_sql": {"unique_id": "macro.dbt.common_get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "common_get_delete_insert_merge_sql", "macro_sql": "{% macro common_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 is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ common_get_delete_insert_merge_sql(target, source, unique_key, dest_columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.common_get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/common/merge.sql", "original_file_path": "macros/materializations/common/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/table/table.sql", "original_file_path": "macros/materializations/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\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 = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\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 {{ create_table_as(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/view.sql", "original_file_path": "macros/materializations/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\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 = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\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 {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\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 {{ create_view_as(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_alias.sql", "original_file_path": "macros/etc/get_custom_alias.sql", "name": "default__generate_alias_name", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/query.sql", "original_file_path": "macros/etc/query.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/is_incremental.sql", "original_file_path": "macros/etc/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/where_subquery.sql", "original_file_path": "macros/etc/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/where_subquery.sql", "original_file_path": "macros/etc/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_schema.sql", "original_file_path": "macros/etc/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/get_custom_database.sql", "original_file_path": "macros/etc/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__drop_relation", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/common.sql", "original_file_path": "macros/adapters/common.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if remove_columns | length > 0 }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/relationships.sql", "original_file_path": "macros/schema_tests/relationships.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/not_null.sql", "original_file_path": "macros/schema_tests/not_null.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/unique.sql", "original_file_path": "macros/schema_tests/unique.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/schema_tests/accepted_values.sql", "original_file_path": "macros/schema_tests/accepted_values.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1636363870}}, "docs": {"jaffle_shop.__overview__": {"unique_id": "jaffle_shop.__overview__", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "overview.md", "original_file_path": "models/overview.md", "name": "__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 demonstrations and tutorials.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "jaffle_shop.orders_status": {"unique_id": "jaffle_shop.orders_status", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "marts/core/docs.md", "original_file_path": "models/marts/core/docs.md", "name": "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 |"}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-0.21/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__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 `--models` 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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [chat](https://community.getdbt.com/) on Slack for live questions and support."}}, "exposures": {}, "selectors": {}, "disabled": [], "parent_map": {"model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], "model.jaffle_shop.stg_payments": ["seed.jaffle_shop.raw_payments"], "model.jaffle_shop.dim_customers": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.stg_customers"], "model.jaffle_shop.fct_orders": ["model.jaffle_shop.order_payments", "model.jaffle_shop.stg_orders"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_customers": [], "seed.jaffle_shop.raw_orders": [], "seed.jaffle_shop.raw_payments": [], "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_dim_customers_customer_id.15c9f1e2fd": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.not_null_dim_customers_customer_id.dd91cd1c8d": ["model.jaffle_shop.dim_customers"], "test.jaffle_shop.unique_fct_orders_order_id.523ddb6ce5": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_order_id.4e687af8d0": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_customer_id.16fe324f7b": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4": ["model.jaffle_shop.dim_customers", "model.jaffle_shop.fct_orders"], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.0aa0973768": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_amount.66810a8d08": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_credit_card_amount.56131cba63": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_coupon_amount.8a700a9568": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.d808dd4fab": ["model.jaffle_shop.fct_orders"], "test.jaffle_shop.not_null_fct_orders_gift_card_amount.ec93756487": ["model.jaffle_shop.fct_orders"], "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.jaffle_shop.stg_orders"]}, "child_map": {"model.jaffle_shop.stg_customers": ["model.jaffle_shop.dim_customers", "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada"], "model.jaffle_shop.stg_payments": ["model.jaffle_shop.customer_payments", "model.jaffle_shop.order_payments", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075", "test.jaffle_shop.unique_stg_payments_payment_id.3744510712"], "model.jaffle_shop.dim_customers": ["test.jaffle_shop.not_null_dim_customers_customer_id.dd91cd1c8d", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4", "test.jaffle_shop.unique_dim_customers_customer_id.15c9f1e2fd"], "model.jaffle_shop.fct_orders": ["test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.0aa0973768", "test.jaffle_shop.not_null_fct_orders_amount.66810a8d08", "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.d808dd4fab", "test.jaffle_shop.not_null_fct_orders_coupon_amount.8a700a9568", "test.jaffle_shop.not_null_fct_orders_credit_card_amount.56131cba63", "test.jaffle_shop.not_null_fct_orders_customer_id.16fe324f7b", "test.jaffle_shop.not_null_fct_orders_gift_card_amount.ec93756487", "test.jaffle_shop.not_null_fct_orders_order_id.4e687af8d0", "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4", "test.jaffle_shop.unique_fct_orders_order_id.523ddb6ce5"], "model.jaffle_shop.order_payments": ["model.jaffle_shop.fct_orders"], "model.jaffle_shop.customer_payments": ["model.jaffle_shop.dim_customers"], "model.jaffle_shop.customer_orders": ["model.jaffle_shop.dim_customers"], "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": [], "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": [], "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": [], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.jaffle_shop.unique_dim_customers_customer_id.15c9f1e2fd": [], "test.jaffle_shop.not_null_dim_customers_customer_id.dd91cd1c8d": [], "test.jaffle_shop.unique_fct_orders_order_id.523ddb6ce5": [], "test.jaffle_shop.not_null_fct_orders_order_id.4e687af8d0": [], "test.jaffle_shop.not_null_fct_orders_customer_id.16fe324f7b": [], "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4": [], "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.0aa0973768": [], "test.jaffle_shop.not_null_fct_orders_amount.66810a8d08": [], "test.jaffle_shop.not_null_fct_orders_credit_card_amount.56131cba63": [], "test.jaffle_shop.not_null_fct_orders_coupon_amount.8a700a9568": [], "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.d808dd4fab": [], "test.jaffle_shop.not_null_fct_orders_gift_card_amount.ec93756487": [], "model.jaffle_shop.stg_orders": ["model.jaffle_shop.customer_orders", "model.jaffle_shop.customer_payments", "model.jaffle_shop.fct_orders", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64", "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a"], "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": [], "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": [], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": []}} diff --git a/tests/resources/v3/jaffle_shop/run_results.json b/tests/resources/v3/jaffle_shop/run_results.json new file mode 100644 index 0000000..4a42611 --- /dev/null +++ b/tests/resources/v3/jaffle_shop/run_results.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v3.json", "dbt_version": "0.21.0", "generated_at": "2021-11-08T09:34:50.678255Z", "invocation_id": "24b76bb7-4791-4342-a0c3-67d110184e2f", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:24.787182Z", "completed_at": "2021-11-08T09:34:24.787187Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:24.805768Z", "completed_at": "2021-11-08T09:34:28.021636Z"}], "thread_id": "Thread-2", "execution_time": 3.236814022064209, "adapter_response": {"_message": "INSERT 99", "code": "INSERT", "rows_affected": 99}, "message": "INSERT 99", "failures": null, "unique_id": "seed.jaffle_shop.raw_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:28.025136Z", "completed_at": "2021-11-08T09:34:28.028944Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:28.029228Z", "completed_at": "2021-11-08T09:34:28.769176Z"}], "thread_id": "Thread-5", "execution_time": 0.7457098960876465, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "failures": null, "unique_id": "model.jaffle_shop.stg_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:24.787506Z", "completed_at": "2021-11-08T09:34:24.787509Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:24.823639Z", "completed_at": "2021-11-08T09:34:29.545351Z"}], "thread_id": "Thread-3", "execution_time": 4.760100841522217, "adapter_response": {"_message": "INSERT 113", "code": "INSERT", "rows_affected": 113}, "message": "INSERT 113", "failures": null, "unique_id": "seed.jaffle_shop.raw_payments"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:28.776802Z", "completed_at": "2021-11-08T09:34:28.813212Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:28.819714Z", "completed_at": "2021-11-08T09:34:30.185280Z"}], "thread_id": "Thread-4", "execution_time": 1.4110770225524902, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:28.775861Z", "completed_at": "2021-11-08T09:34:28.806159Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:28.807053Z", "completed_at": "2021-11-08T09:34:30.228783Z"}], "thread_id": "Thread-2", "execution_time": 1.4551002979278564, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:28.789965Z", "completed_at": "2021-11-08T09:34:28.819110Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:28.829129Z", "completed_at": "2021-11-08T09:34:30.817056Z"}], "thread_id": "Thread-5", "execution_time": 2.0415360927581787, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:29.552293Z", "completed_at": "2021-11-08T09:34:29.558220Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:29.558644Z", "completed_at": "2021-11-08T09:34:33.494007Z"}], "thread_id": "Thread-3", "execution_time": 3.9440672397613525, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "failures": null, "unique_id": "model.jaffle_shop.stg_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:24.786744Z", "completed_at": "2021-11-08T09:34:24.786750Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:24.787807Z", "completed_at": "2021-11-08T09:34:33.804064Z"}], "thread_id": "Thread-1", "execution_time": 9.020055055618286, "adapter_response": {"_message": "INSERT 100", "code": "INSERT", "rows_affected": 100}, "message": "INSERT 100", "failures": null, "unique_id": "seed.jaffle_shop.raw_customers"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:33.505691Z", "completed_at": "2021-11-08T09:34:33.523390Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:33.523769Z", "completed_at": "2021-11-08T09:34:34.934106Z"}], "thread_id": "Thread-2", "execution_time": 1.4307079315185547, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:33.505990Z", "completed_at": "2021-11-08T09:34:33.526123Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:33.526515Z", "completed_at": "2021-11-08T09:34:35.000474Z"}], "thread_id": "Thread-3", "execution_time": 1.496135950088501, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id.3744510712"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:33.505392Z", "completed_at": "2021-11-08T09:34:33.528334Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:33.528654Z", "completed_at": "2021-11-08T09:34:36.068230Z"}], "thread_id": "Thread-5", "execution_time": 2.565700054168701, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:36.078251Z", "completed_at": "2021-11-08T09:34:36.090422Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:36.093200Z", "completed_at": "2021-11-08T09:34:38.335130Z"}], "thread_id": "Thread-3", "execution_time": 2.2597551345825195, "adapter_response": {"_message": "CREATE TABLE (99.0 rows, 3.2 KB processed)", "code": "CREATE TABLE", "rows_affected": 99, "bytes_processed": 3254}, "message": "CREATE TABLE (99.0 rows, 3.2 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.order_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:36.077853Z", "completed_at": "2021-11-08T09:34:36.089918Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:36.090895Z", "completed_at": "2021-11-08T09:34:38.703983Z"}], "thread_id": "Thread-2", "execution_time": 2.6290571689605713, "adapter_response": {"_message": "CREATE TABLE (62.0 rows, 3.3 KB processed)", "code": "CREATE TABLE", "rows_affected": 62, "bytes_processed": 3392}, "message": "CREATE TABLE (62.0 rows, 3.3 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.customer_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:33.809059Z", "completed_at": "2021-11-08T09:34:33.813844Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:33.814172Z", "completed_at": "2021-11-08T09:34:40.123353Z"}], "thread_id": "Thread-1", "execution_time": 6.316112995147705, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "failures": null, "unique_id": "model.jaffle_shop.stg_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:30.820151Z", "completed_at": "2021-11-08T09:34:30.823586Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:30.823915Z", "completed_at": "2021-11-08T09:34:40.344836Z"}], "thread_id": "Thread-4", "execution_time": 9.526283979415894, "adapter_response": {"_message": "CREATE TABLE (62.0 rows, 2.3 KB processed)", "code": "CREATE TABLE", "rows_affected": 62, "bytes_processed": 2376}, "message": "CREATE TABLE (62.0 rows, 2.3 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.customer_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:38.348089Z", "completed_at": "2021-11-08T09:34:38.358883Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:38.359907Z", "completed_at": "2021-11-08T09:34:40.837392Z"}], "thread_id": "Thread-5", "execution_time": 2.4914329051971436, "adapter_response": {"_message": "CREATE TABLE (99.0 rows, 8.0 KB processed)", "code": "CREATE TABLE", "rows_affected": 99, "bytes_processed": 8158}, "message": "CREATE TABLE (99.0 rows, 8.0 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.fct_orders"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:40.855044Z", "completed_at": "2021-11-08T09:34:40.869876Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:40.870837Z", "completed_at": "2021-11-08T09:34:42.369448Z"}], "thread_id": "Thread-5", "execution_time": 1.524596929550171, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_bank_transfer_amount.d808dd4fab"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:40.846640Z", "completed_at": "2021-11-08T09:34:40.866759Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:40.867181Z", "completed_at": "2021-11-08T09:34:42.419845Z"}], "thread_id": "Thread-4", "execution_time": 1.5763030052185059, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_amount.66810a8d08"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:40.131911Z", "completed_at": "2021-11-08T09:34:40.148496Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:40.149918Z", "completed_at": "2021-11-08T09:34:42.669744Z"}], "thread_id": "Thread-2", "execution_time": 2.5402638912200928, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:40.131477Z", "completed_at": "2021-11-08T09:34:40.158768Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:40.160314Z", "completed_at": "2021-11-08T09:34:42.913399Z"}], "thread_id": "Thread-3", "execution_time": 2.7853550910949707, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:42.379679Z", "completed_at": "2021-11-08T09:34:42.388388Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:42.389318Z", "completed_at": "2021-11-08T09:34:43.745396Z"}], "thread_id": "Thread-5", "execution_time": 1.3676810264587402, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_coupon_amount.8a700a9568"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:42.673431Z", "completed_at": "2021-11-08T09:34:42.680155Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:42.680732Z", "completed_at": "2021-11-08T09:34:43.755769Z"}], "thread_id": "Thread-2", "execution_time": 1.0850849151611328, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_customer_id.16fe324f7b"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:40.845560Z", "completed_at": "2021-11-08T09:34:40.864518Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:40.864969Z", "completed_at": "2021-11-08T09:34:43.974228Z"}], "thread_id": "Thread-1", "execution_time": 3.132451057434082, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.accepted_values_fct_orders_status__placed__shipped__completed__return_pending__returned.0aa0973768"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:42.920130Z", "completed_at": "2021-11-08T09:34:42.929901Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:42.930405Z", "completed_at": "2021-11-08T09:34:44.179988Z"}], "thread_id": "Thread-3", "execution_time": 1.2623889446258545, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_gift_card_amount.ec93756487"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:42.422354Z", "completed_at": "2021-11-08T09:34:42.429142Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:42.429442Z", "completed_at": "2021-11-08T09:34:44.465317Z"}], "thread_id": "Thread-4", "execution_time": 2.0467162132263184, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_credit_card_amount.56131cba63"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:43.747756Z", "completed_at": "2021-11-08T09:34:43.756763Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:43.758541Z", "completed_at": "2021-11-08T09:34:45.050521Z"}], "thread_id": "Thread-5", "execution_time": 1.3045201301574707, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_fct_orders_order_id.4e687af8d0"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:43.979603Z", "completed_at": "2021-11-08T09:34:43.986188Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:43.986895Z", "completed_at": "2021-11-08T09:34:46.670064Z"}], "thread_id": "Thread-1", "execution_time": 2.692615032196045, "adapter_response": {"_message": "CREATE TABLE (100.0 rows, 3.7 KB processed)", "code": "CREATE TABLE", "rows_affected": 100, "bytes_processed": 3776}, "message": "CREATE TABLE (100.0 rows, 3.7 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.dim_customers"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:43.763749Z", "completed_at": "2021-11-08T09:34:43.773410Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:43.774667Z", "completed_at": "2021-11-08T09:34:47.097305Z"}], "thread_id": "Thread-2", "execution_time": 3.3351659774780273, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_fct_orders_order_id.523ddb6ce5"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:46.680768Z", "completed_at": "2021-11-08T09:34:46.749563Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:46.752516Z", "completed_at": "2021-11-08T09:34:48.189302Z"}], "thread_id": "Thread-5", "execution_time": 1.5110719203948975, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_dim_customers_customer_id.15c9f1e2fd"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:46.679770Z", "completed_at": "2021-11-08T09:34:46.770987Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:46.771340Z", "completed_at": "2021-11-08T09:34:48.939132Z"}], "thread_id": "Thread-3", "execution_time": 2.2624120712280273, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_dim_customers_customer_id.dd91cd1c8d"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-11-08T09:34:46.680327Z", "completed_at": "2021-11-08T09:34:46.748916Z"}, {"name": "execute", "started_at": "2021-11-08T09:34:46.749770Z", "completed_at": "2021-11-08T09:34:50.667601Z"}], "thread_id": "Thread-4", "execution_time": 3.9905641078948975, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.relationships_fct_orders_customer_id__customer_id__ref_dim_customers_.d5636051d4"}], "elapsed_time": 28.74850106239319, "args": {"log_format": "default", "write_json": true, "use_experimental_parser": false, "profiles_dir": "/Users/yu/local/src/github/jaffle_shop", "use_cache": true, "store_failures": false, "greedy": false, "resource_types": [], "version_check": true, "which": "build", "rpc_method": "build"}} \ No newline at end of file diff --git a/tests/resources/v4/jaffle_shop/manifest.json b/tests/resources/v4/jaffle_shop/manifest.json new file mode 100644 index 0000000..8649972 --- /dev/null +++ b/tests/resources/v4/jaffle_shop/manifest.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.0", "generated_at": "2021-12-09T13:45:59.538982Z", "invocation_id": "a9750daa-d2e7-42aa-8a86-f57a27373b08", "env": {}, "project_id": "06e5b98c2db46f8a72cc4f66410e9b3b", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "bigquery"}, "nodes": {"model.jaffle_shop.orders": {"raw_sql": "{% 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", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "orders"], "unique_id": "model.jaffle_shop.orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "orders.sql", "original_file_path": "models/orders.sql", "name": "orders", "alias": "orders", "checksum": {"name": "sha256", "checksum": "53950235d8e29690d259e95ee49bda6a5b7911b44c739b738a646dc6014bcfcd"}, "tags": [], "refs": [["stg_orders"], ["stg_payments"]], "sources": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "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": {}, "data_type": null, "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": null, "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1638874111.205596}, "model.jaffle_shop.stg_customers": {"raw_sql": "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", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_customers"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_customers"], "unique_id": "model.jaffle_shop.stg_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_customers.sql", "original_file_path": "models/staging/stg_customers.sql", "name": "stg_customers", "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "6f18a29204dad1de6dbb0c288144c4990742e0a1e065c3b2a67b5f98334c22ba"}, "tags": [], "refs": [["raw_customers"]], "sources": [], "description": "", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1638874111.2681239}, "model.jaffle_shop.stg_payments": {"raw_sql": "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", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_payments"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_payments"], "unique_id": "model.jaffle_shop.stg_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_payments.sql", "original_file_path": "models/staging/stg_payments.sql", "name": "stg_payments", "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "eb899938258d1fba27fca716a7c334119912a2f9601282026097a7b6ce8cfcd2"}, "tags": [], "refs": [["raw_payments"]], "sources": [], "description": "", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1638874111.270873}, "model.jaffle_shop.stg_orders": {"raw_sql": "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", "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.jaffle_shop.raw_orders"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "staging", "stg_orders"], "unique_id": "model.jaffle_shop.stg_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "staging/stg_orders.sql", "original_file_path": "models/staging/stg_orders.sql", "name": "stg_orders", "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "afffa9cbc57e5fd2cf5898ebf571d444a62c9d6d7929d8133d30567fb9a2ce97"}, "tags": [], "refs": [["raw_orders"]], "sources": [], "description": "", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/staging/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1638874111.269592}, "seed.jaffle_shop.raw_customers": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_customers"], "unique_id": "seed.jaffle_shop.raw_customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "name": "raw_customers", "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "24579b4b26098d43265376f3c50be8b10faf8e8fd95f5508074f10f76a12671d"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.176461}, "seed.jaffle_shop.raw_orders": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_orders"], "unique_id": "seed.jaffle_shop.raw_orders", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "name": "raw_orders", "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ee6c68d1639ec2b23a4495ec12475e09b8ed4b61e23ab0411ea7ec76648356f7"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.178276}, "seed.jaffle_shop.raw_payments": {"raw_sql": "", "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "raw_payments"], "unique_id": "seed.jaffle_shop.raw_payments", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "name": "raw_payments", "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "03fd407f3135f84456431a923f22fc185a2154079e210c20b690e3ab11687d11"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.1797628}, "test.jaffle_shop.unique_orders_order_id.fed79b3a6e": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "unique_orders_order_id"], "unique_id": "test.jaffle_shop.unique_orders_order_id.fed79b3a6e", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "unique_orders_order_id.sql", "original_file_path": "models/schema.yml", "name": "unique_orders_order_id", "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.21875, "column_name": "order_id", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_order_id.cf6c17daed": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_orders_order_id.cf6c17daed", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_order_id.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_order_id", "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.2210822, "column_name": "order_id", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_customer_id.c5f02694af": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_customer_id"], "unique_id": "test.jaffle_shop.not_null_orders_customer_id.c5f02694af", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_customer_id", "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.2229462, "column_name": "customer_id", "file_key_name": "models.orders"}, "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"raw_sql": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.jaffle_shop.customers", "model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "relationships_orders_customer_id__customer_id__ref_customers_"], "unique_id": "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/schema.yml", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["customers"], ["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.225913, "column_name": "customer_id", "file_key_name": "models.orders"}, "test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"raw_sql": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/schema.yml", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1638874111.2412522, "column_name": "status", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_amount.106140f9fd": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_amount"], "unique_id": "test.jaffle_shop.not_null_orders_amount.106140f9fd", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_amount.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_amount", "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.2536461, "column_name": "amount", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_credit_card_amount"], "unique_id": "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_credit_card_amount", "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.255841, "column_name": "credit_card_amount", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_coupon_amount"], "unique_id": "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_coupon_amount", "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.2605639, "column_name": "coupon_amount", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_bank_transfer_amount"], "unique_id": "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_bank_transfer_amount", "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.262654, "column_name": "bank_transfer_amount", "file_key_name": "models.orders"}, "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_orders_gift_card_amount"], "unique_id": "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/schema.yml", "name": "not_null_orders_gift_card_amount", "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.264856, "column_name": "gift_card_amount", "file_key_name": "models.orders"}, "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "unique_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_customers_customer_id", "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.2720482, "column_name": "customer_id", "file_key_name": "models.stg_customers"}, "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_customers"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "not_null_stg_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_customers_customer_id", "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.2750778, "column_name": "customer_id", "file_key_name": "models.stg_customers"}, "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "unique_stg_orders_order_id"], "unique_id": "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_orders_order_id", "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.277935, "column_name": "order_id", "file_key_name": "models.stg_orders"}, "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "not_null_stg_orders_order_id"], "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_orders_order_id", "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.280527, "column_name": "order_id", "file_key_name": "models.stg_orders"}, "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"raw_sql": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.jaffle_shop.stg_orders"]}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_orders"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1638874111.2827, "column_name": "status", "file_key_name": "models.stg_orders"}, "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "unique_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id.3744510712", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "unique_stg_payments_payment_id", "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.290727, "column_name": "payment_id", "file_key_name": "models.stg_payments"}, "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "not_null_stg_payments_payment_id"], "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/schema.yml", "name": "not_null_stg_payments_payment_id", "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1638874111.293498, "column_name": "payment_id", "file_key_name": "models.stg_payments"}, "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"raw_sql": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.jaffle_shop.stg_payments"]}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "staging", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/schema.yml", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1638874111.297858, "column_name": "payment_method", "file_key_name": "models.stg_payments"}, "model.jaffle_shop.test_insert_overwrite": {"raw_sql": "{{\n config(\n full_refresh=true,\n materialized=\"incremental\",\n incremental_strategy='insert_overwrite',\n require_partition_filter=true,\n alias=\"test_insert_overwrite\",\n post_hook=\"ALTER TABLE IF EXISTS {{ this}} SET OPTIONS ( require_partition_filter = false)\",\n partition_by={\n \"field\": \"event_time\",\n \"data_type\": \"timestamp\",\n \"granularity\": \"day\",\n },\n )\n}}\n\nSELECT\n CURRENT_TIMESTAMP() AS event_time", "resource_type": "model", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "test_insert_overwrite", "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "incremental", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": true, "on_schema_change": "ignore", "partition_by": {"field": "event_time", "data_type": "timestamp", "granularity": "day"}, "require_partition_filter": true, "incremental_strategy": "insert_overwrite", "post-hook": [{"sql": "ALTER TABLE IF EXISTS {{ this}} SET OPTIONS ( require_partition_filter = false)", "transaction": true, "index": null}], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "test_insert_overwrite"], "unique_id": "model.jaffle_shop.test_insert_overwrite", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "test_insert_overwrite.sql", "original_file_path": "models/test_insert_overwrite.sql", "name": "test_insert_overwrite", "alias": "test_insert_overwrite", "checksum": {"name": "sha256", "checksum": "4c3e123323726085623b9b05d229c880b6b9f7486b5124883a3fde13d85f9a7c"}, "tags": [], "refs": [], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "incremental", "full_refresh": true, "incremental_strategy": "insert_overwrite", "require_partition_filter": true, "alias": "test_insert_overwrite", "partition_by": {"field": "event_time", "data_type": "timestamp", "granularity": "day"}, "post-hook": ["ALTER TABLE IF EXISTS {{ this}} SET OPTIONS ( require_partition_filter = false)"]}, "created_at": 1639057490.0378728}, "test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "unique_customers_customer_id"], "unique_id": "test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "unique_customers_customer_id.sql", "original_file_path": "models/schema.yml", "name": "unique_customers_customer_id", "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1639057559.6246989, "column_name": "customer_id", "file_key_name": "models.customers"}, "test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "your-gcp-project", "schema": "jaffle_shop_dbt_test__audit", "fqn": ["jaffle_shop", "not_null_customers_customer_id"], "unique_id": "test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/schema.yml", "name": "not_null_customers_customer_id", "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["customers"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1639057559.627947, "column_name": "customer_id", "file_key_name": "models.customers"}}, "sources": {}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.57728}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.5777762}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.578512}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.585095}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.5962691}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.597173}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.5980039}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.5986161}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, sql) -%}\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set raw_cluster_by = config.get('cluster_by', none) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {%- set partition_config = adapter.parse_partition_by(raw_partition_by) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {{ partition_by(partition_config) }}\n {{ cluster_by(raw_cluster_by) }}\n {{ bigquery_table_options(config, model, temporary) }}\n as (\n {{ sql }}\n );\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.600078}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.600619}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__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\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.601582}, "macro.dbt_bigquery.bigquery__create_schema": {"unique_id": "macro.dbt_bigquery.bigquery__create_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_schema", "macro_sql": "{% macro bigquery__create_schema(relation) -%}\n {{ adapter.create_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.601946}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.602249}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.602722}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6032991}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.604012}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() -%}\n CURRENT_TIMESTAMP()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.604269}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__snapshot_string_as_time", "macro_sql": "{% macro bigquery__snapshot_string_as_time(timestamp) -%}\n {%- set result = 'TIMESTAMP(\"' ~ timestamp ~ '\")' -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.604723}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.605139}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.605599}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6067588}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6072161}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.60763}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.608799}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.609889}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6118531}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.612413}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.613626}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.614027}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.61539}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.616815}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.618321}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery' -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6226869}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.626122}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6299179}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\", default=\"merge\") -%}\n\n {% set invalid_strategy_msg -%}\n Invalid incremental strategy provided: {{ strategy }}\n Expected one of: 'merge', 'insert_overwrite'\n {%- endset %}\n {% if strategy not in ['merge', 'insert_overwrite'] %}\n {% do exceptions.raise_compiler_error(invalid_strategy_msg) %}\n {% endif %}\n\n {% do return(strategy) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.630995}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.634032}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.635929}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery' -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\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, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.643311}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.644673}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.645196}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6456928}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.648566}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.649052}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6494222}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.64977}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.650141}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.651139}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.651804}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6524742}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.653553}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.654141}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6616828}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.662225}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6627772}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.66309}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6633039}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.664995}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.665534}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.665942}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\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(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.668206}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \n {% set select_current_time -%}\n select {{ snapshot_get_time() }} as snapshot_start\n {%- endset %}\n\n {#-- don't access the column by name, to avoid dealing with casing issues on snowflake #}\n {%- set now = run_query(select_current_time)[0][0] -%}\n {% if now is none or now is undefined -%}\n {%- do exceptions.raise_compiler_error('Could not get a snapshot start time from the database') -%}\n {%- endif %}\n {% set updated_at = config.get('updated_at', snapshot_string_as_time(now)) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n TRUE\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.672915}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.679339}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.680039}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.680434}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.68063}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6813362}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.683378}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6838028}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6843688}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6853278}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% if not adapter.check_schema_exists(model.database, model.schema) %}\n {% do create_schema(model.database, model.schema) %}\n {% endif %}\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_sql']) %}\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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "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.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.6995158}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% 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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7043571}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.705564}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.706496}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.707893}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7088509}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.710819}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.712181}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7138171}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.720268}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "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 update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.723395}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.72449}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "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 is not none %}\n delete from {{ target }}\n where ({{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7255108}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7261}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.727581}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.729457}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ 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 = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=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 {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_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, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\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 {% endif %}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.740619}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7513049}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.754504}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7587168}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.760654}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\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 = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\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 old_relation is not none %}\n {{ adapter.rename_relation(old_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 {% 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["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.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.770237}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.771749}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.772286}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7729878}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n \n {{ sql_header if sql_header is not none }}\n \n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7742631}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\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 = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\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 \"old_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 old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_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 old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\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 {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.782917}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.784052}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.784637}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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\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 {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.788082}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.789519}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7900002}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.790936}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7915862}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\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 {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\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 %}", "resource_type": "macro", "tags": [], "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.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.7997582}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.808664}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.811178}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.811758}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.812855}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.813216}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.813746}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.815409}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.816094}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.81825}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.818986}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8245802}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8261929}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.826974}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.828705}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8293278}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.830034}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.831441}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.832027}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.832993}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.833554}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.834242}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8364391}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\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 {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.839422}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8411489}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.842001}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.845844}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.84925}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.851205}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.851912}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.853065}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8535008}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.853868}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.854395}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.856103}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.856529}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8569002}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.858238}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.863501}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.864594}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8650398}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8655639}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.865972}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.866325}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8669271}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.867566}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.868203}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.869421}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.869924}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8703501}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.871636}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8721652}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.872952}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8744588}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8764071}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.876811}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.877267}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.877634}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.87825}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.87961}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8827038}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.883379}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.883935}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.884355}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.884746}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8852952}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8857431}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8865888}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8869948}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.887378}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.891505}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.892017}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.892797}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.893358}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n 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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.894495}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.8950882}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.896468}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.897054}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.899231}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.900637}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.9011729}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.901807}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1638874110.902404}}, "docs": {"jaffle_shop.__overview__": {"unique_id": "jaffle_shop.__overview__", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "overview.md", "original_file_path": "models/overview.md", "name": "__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)."}, "jaffle_shop.orders_status": {"unique_id": "jaffle_shop.orders_status", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "docs.md", "original_file_path": "models/docs.md", "name": "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 |"}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/Users/yu/anaconda2/envs/dbt-1.0/lib/python3.8/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__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/overview)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {"model.jaffle_shop.customers": [{"raw_sql": "{{ config(enabled=false) }}\n\nwith 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", "resource_type": "model", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "your-gcp-project", "schema": "jaffle_shop", "fqn": ["jaffle_shop", "customers"], "unique_id": "model.jaffle_shop.customers", "package_name": "jaffle_shop", "root_path": "/Users/yu/local/src/github/jaffle_shop", "path": "customers.sql", "original_file_path": "models/customers.sql", "name": "customers", "alias": "customers", "checksum": {"name": "sha256", "checksum": "30ea8a24d039f78187c5d90931863ef35e8e73485d3ecc6c8367c20d2833284b"}, "tags": [], "refs": [["stg_customers"], ["stg_orders"], ["stg_payments"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": "jaffle_shop://models/schema.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": false}, "created_at": 1639057559.594421}]}, "parent_map": {"model.jaffle_shop.orders": ["model.jaffle_shop.stg_orders", "model.jaffle_shop.stg_payments"], "model.jaffle_shop.stg_customers": ["seed.jaffle_shop.raw_customers"], "model.jaffle_shop.stg_payments": ["seed.jaffle_shop.raw_payments"], "model.jaffle_shop.stg_orders": ["seed.jaffle_shop.raw_orders"], "seed.jaffle_shop.raw_customers": [], "seed.jaffle_shop.raw_orders": [], "seed.jaffle_shop.raw_payments": [], "test.jaffle_shop.unique_orders_order_id.fed79b3a6e": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_order_id.cf6c17daed": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_customer_id.c5f02694af": ["model.jaffle_shop.orders"], "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.jaffle_shop.customers", "model.jaffle_shop.orders"], "test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_amount.106140f9fd": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49": ["model.jaffle_shop.orders"], "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a": ["model.jaffle_shop.orders"], "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.jaffle_shop.stg_customers"], "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.jaffle_shop.stg_orders"], "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.jaffle_shop.stg_payments"], "model.jaffle_shop.test_insert_overwrite": [], "test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1": [], "test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d": []}, "child_map": {"model.jaffle_shop.orders": ["test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.jaffle_shop.not_null_orders_amount.106140f9fd", "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49", "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625", "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59", "test.jaffle_shop.not_null_orders_customer_id.c5f02694af", "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a", "test.jaffle_shop.not_null_orders_order_id.cf6c17daed", "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.jaffle_shop.unique_orders_order_id.fed79b3a6e"], "model.jaffle_shop.stg_customers": ["test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada"], "model.jaffle_shop.stg_payments": ["model.jaffle_shop.orders", "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075", "test.jaffle_shop.unique_stg_payments_payment_id.3744510712"], "model.jaffle_shop.stg_orders": ["model.jaffle_shop.orders", "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64", "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a"], "seed.jaffle_shop.raw_customers": ["model.jaffle_shop.stg_customers"], "seed.jaffle_shop.raw_orders": ["model.jaffle_shop.stg_orders"], "seed.jaffle_shop.raw_payments": ["model.jaffle_shop.stg_payments"], "test.jaffle_shop.unique_orders_order_id.fed79b3a6e": [], "test.jaffle_shop.not_null_orders_order_id.cf6c17daed": [], "test.jaffle_shop.not_null_orders_customer_id.c5f02694af": [], "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.jaffle_shop.not_null_orders_amount.106140f9fd": [], "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59": [], "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625": [], "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49": [], "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada": [], "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a": [], "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64": [], "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.jaffle_shop.unique_stg_payments_payment_id.3744510712": [], "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075": [], "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "model.jaffle_shop.test_insert_overwrite": [], "test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1": [], "test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d": []}} diff --git a/tests/resources/v4/jaffle_shop/run_results.json b/tests/resources/v4/jaffle_shop/run_results.json new file mode 100644 index 0000000..9bfb55f --- /dev/null +++ b/tests/resources/v4/jaffle_shop/run_results.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.0.0", "generated_at": "2021-12-07T10:49:34.224220Z", "invocation_id": "5b7ab67d-5559-49b8-9373-35eab8b9f2f7", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:20.193225Z", "completed_at": "2021-12-07T10:49:20.193229Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:20.200036Z", "completed_at": "2021-12-07T10:49:23.894804Z"}], "thread_id": "Thread-2", "execution_time": 3.705381155014038, "adapter_response": {"_message": "INSERT 100", "code": "INSERT", "rows_affected": 100}, "message": "INSERT 100", "failures": null, "unique_id": "seed.jaffle_shop.raw_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:20.198729Z", "completed_at": "2021-12-07T10:49:20.198734Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:20.224096Z", "completed_at": "2021-12-07T10:49:24.072707Z"}], "thread_id": "Thread-4", "execution_time": 3.8813393115997314, "adapter_response": {"_message": "INSERT 113", "code": "INSERT", "rows_affected": 113}, "message": "INSERT 113", "failures": null, "unique_id": "seed.jaffle_shop.raw_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:20.198402Z", "completed_at": "2021-12-07T10:49:20.198407Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:20.220469Z", "completed_at": "2021-12-07T10:49:24.366128Z"}], "thread_id": "Thread-3", "execution_time": 4.175883054733276, "adapter_response": {"_message": "INSERT 99", "code": "INSERT", "rows_affected": 99}, "message": "INSERT 99", "failures": null, "unique_id": "seed.jaffle_shop.raw_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:23.901305Z", "completed_at": "2021-12-07T10:49:23.906371Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:23.907272Z", "completed_at": "2021-12-07T10:49:24.856319Z"}], "thread_id": "Thread-5", "execution_time": 0.9575939178466797, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "failures": null, "unique_id": "model.jaffle_shop.stg_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:24.075826Z", "completed_at": "2021-12-07T10:49:24.079073Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:24.079543Z", "completed_at": "2021-12-07T10:49:24.890385Z"}], "thread_id": "Thread-2", "execution_time": 0.8353207111358643, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "failures": null, "unique_id": "model.jaffle_shop.stg_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:24.372188Z", "completed_at": "2021-12-07T10:49:24.377411Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:24.378010Z", "completed_at": "2021-12-07T10:49:25.156493Z"}], "thread_id": "Thread-4", "execution_time": 0.7858743667602539, "adapter_response": {"_message": "OK", "code": "CREATE VIEW"}, "message": "OK", "failures": null, "unique_id": "model.jaffle_shop.stg_orders"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:24.919936Z", "completed_at": "2021-12-07T10:49:24.936810Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:24.940156Z", "completed_at": "2021-12-07T10:49:26.268713Z"}], "thread_id": "Thread-2", "execution_time": 1.3578460216522217, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:24.861370Z", "completed_at": "2021-12-07T10:49:24.880792Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:24.882423Z", "completed_at": "2021-12-07T10:49:26.272237Z"}], "thread_id": "Thread-5", "execution_time": 1.4139142036437988, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_stg_customers_customer_id.c7614daada"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:24.861166Z", "completed_at": "2021-12-07T10:49:24.881261Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:24.907747Z", "completed_at": "2021-12-07T10:49:26.322257Z"}], "thread_id": "Thread-3", "execution_time": 1.4640240669250488, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_stg_customers_customer_id.e2cfb1f9aa"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:25.159472Z", "completed_at": "2021-12-07T10:49:25.163744Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:25.164271Z", "completed_at": "2021-12-07T10:49:26.412843Z"}], "thread_id": "Thread-4", "execution_time": 1.2550320625305176, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_stg_payments_payment_id.c19cc50075"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:26.289584Z", "completed_at": "2021-12-07T10:49:26.307229Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:26.317080Z", "completed_at": "2021-12-07T10:49:27.576890Z"}], "thread_id": "Thread-2", "execution_time": 1.294950008392334, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_stg_payments_payment_id.3744510712"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:26.290012Z", "completed_at": "2021-12-07T10:49:26.306961Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:26.308108Z", "completed_at": "2021-12-07T10:49:27.690028Z"}], "thread_id": "Thread-5", "execution_time": 1.4028940200805664, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:26.417761Z", "completed_at": "2021-12-07T10:49:26.429830Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:26.430776Z", "completed_at": "2021-12-07T10:49:27.708308Z"}], "thread_id": "Thread-4", "execution_time": 1.2929809093475342, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_stg_orders_order_id.e3b841c71a"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:26.328033Z", "completed_at": "2021-12-07T10:49:26.341553Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:26.342993Z", "completed_at": "2021-12-07T10:49:27.711016Z"}], "thread_id": "Thread-3", "execution_time": 1.3856201171875, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_stg_orders_order_id.81cfe2fe64"}, {"status": "error", "timing": [], "thread_id": "Thread-1", "execution_time": 9.394618034362793, "adapter_response": {}, "message": "Database Error in model test_insert_overwrite (models/test_insert_overwrite.sql)\n Query error: No matching signature for function TIMESTAMP_TRUNC for argument types: STRING, DATE_TIME_PART. Supported signatures: TIMESTAMP_TRUNC(TIMESTAMP, DATE_TIME_PART, [STRING]); TIMESTAMP_TRUNC(DATETIME, DATE_TIME_PART) at [52:14]\n compiled SQL at target/run/jaffle_shop/models/test_insert_overwrite.sql", "failures": null, "unique_id": "model.jaffle_shop.test_insert_overwrite"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:27.716338Z", "completed_at": "2021-12-07T10:49:27.727911Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:27.735471Z", "completed_at": "2021-12-07T10:49:30.405411Z"}], "thread_id": "Thread-5", "execution_time": 2.691401243209839, "adapter_response": {"_message": "CREATE TABLE (99.0 rows, 6.5 KB processed)", "code": "CREATE TABLE", "rows_affected": 99, "bytes_processed": 6660}, "message": "CREATE TABLE (99.0 rows, 6.5 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:27.716139Z", "completed_at": "2021-12-07T10:49:27.727561Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:27.728901Z", "completed_at": "2021-12-07T10:49:30.433984Z"}], "thread_id": "Thread-2", "execution_time": 2.7333171367645264, "adapter_response": {"_message": "CREATE TABLE (100.0 rows, 6.0 KB processed)", "code": "CREATE TABLE", "rows_affected": 100, "bytes_processed": 6170}, "message": "CREATE TABLE (100.0 rows, 6.0 KB processed)", "failures": null, "unique_id": "model.jaffle_shop.customers"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:30.434326Z", "completed_at": "2021-12-07T10:49:30.465801Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:30.472181Z", "completed_at": "2021-12-07T10:49:31.672522Z"}], "thread_id": "Thread-5", "execution_time": 1.2572300434112549, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_coupon_amount.ab90c90625"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:30.431175Z", "completed_at": "2021-12-07T10:49:30.459755Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:30.466468Z", "completed_at": "2021-12-07T10:49:31.722950Z"}], "thread_id": "Thread-1", "execution_time": 1.3079090118408203, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_bank_transfer_amount.7743500c49"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:30.428549Z", "completed_at": "2021-12-07T10:49:30.452707Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:30.463948Z", "completed_at": "2021-12-07T10:49:31.742960Z"}], "thread_id": "Thread-4", "execution_time": 1.329509973526001, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_amount.106140f9fd"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:30.476090Z", "completed_at": "2021-12-07T10:49:30.494723Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:30.501459Z", "completed_at": "2021-12-07T10:49:31.766661Z"}], "thread_id": "Thread-2", "execution_time": 1.2975051403045654, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_credit_card_amount.d3ca593b59"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:30.416967Z", "completed_at": "2021-12-07T10:49:30.439574Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:30.460076Z", "completed_at": "2021-12-07T10:49:31.897925Z"}], "thread_id": "Thread-3", "execution_time": 1.4864859580993652, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:31.774484Z", "completed_at": "2021-12-07T10:49:31.779096Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:31.780344Z", "completed_at": "2021-12-07T10:49:32.936619Z"}], "thread_id": "Thread-2", "execution_time": 1.1682441234588623, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_orders_order_id.fed79b3a6e"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:31.678346Z", "completed_at": "2021-12-07T10:49:31.684678Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:31.685333Z", "completed_at": "2021-12-07T10:49:32.940726Z"}], "thread_id": "Thread-5", "execution_time": 1.2650880813598633, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_customer_id.c5f02694af"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:31.725601Z", "completed_at": "2021-12-07T10:49:31.732789Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:31.733576Z", "completed_at": "2021-12-07T10:49:33.001288Z"}], "thread_id": "Thread-1", "execution_time": 1.2786297798156738, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_gift_card_amount.413a0d2d7a"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:31.750035Z", "completed_at": "2021-12-07T10:49:31.758200Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:31.759243Z", "completed_at": "2021-12-07T10:49:33.002889Z"}], "thread_id": "Thread-4", "execution_time": 1.2557940483093262, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_orders_order_id.cf6c17daed"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:31.900798Z", "completed_at": "2021-12-07T10:49:31.905247Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:31.905982Z", "completed_at": "2021-12-07T10:49:33.154537Z"}], "thread_id": "Thread-3", "execution_time": 1.2559359073638916, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.not_null_customers_customer_id.5c9bf9911d"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:32.945859Z", "completed_at": "2021-12-07T10:49:32.964783Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:32.966089Z", "completed_at": "2021-12-07T10:49:34.197916Z"}], "thread_id": "Thread-2", "execution_time": 1.2535018920898438, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2"}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2021-12-07T10:49:32.958268Z", "completed_at": "2021-12-07T10:49:32.965696Z"}, {"name": "execute", "started_at": "2021-12-07T10:49:32.968962Z", "completed_at": "2021-12-07T10:49:34.218347Z"}], "thread_id": "Thread-5", "execution_time": 1.2673461437225342, "adapter_response": {}, "message": null, "failures": 0, "unique_id": "test.jaffle_shop.unique_customers_customer_id.c5af1ff4b1"}], "elapsed_time": 16.181153059005737, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/yu/local/src/github/jaffle_shop", "send_anonymous_usage_stats": false, "event_buffer_size": 100000, "store_failures": false, "indirect_selection": "eager", "resource_types": [], "which": "build", "rpc_method": "build"}} \ No newline at end of file diff --git a/tests/test_basic.py b/tests/test_basic.py new file mode 100644 index 0000000..d26bbbf --- /dev/null +++ b/tests/test_basic.py @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import unittest + +import dbt_artifacts_parser + + +class TestBasicInformation(unittest.TestCase): + + def test_version(self): + self.assertIsNotNone(dbt_artifacts_parser.__version__) diff --git a/tests/test_parser.py b/tests/test_parser.py new file mode 100644 index 0000000..f744c11 --- /dev/null +++ b/tests/test_parser.py @@ -0,0 +1,197 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import unittest +import os +import yaml + +from dbt_artifacts_parser.utils import get_project_root + +from dbt_artifacts_parser.parser import ( + parse_catalog, + parse_catalog_v1, + parse_manifest, + parse_manifest_v1, + parse_manifest_v2, + parse_manifest_v3, + parse_manifest_v4, + parse_run_results, + parse_run_results_v1, + parse_run_results_v2, + parse_run_results_v3, + parse_run_results_v4, +) + + +class TestCatalogParser(unittest.TestCase): + + def test_parse_catalog(self): + path = os.path.join(get_project_root(), "tests", "resources", "v1", + "jaffle_shop", "catalog.json") + with open(path, "r", encoding="utf-8") as fp: + catalog_dict = yaml.safe_load(fp) + catalog_obj = parse_catalog(catalog_dict) + self.assertEqual(catalog_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/catalog/v1.json") + + def test_parse_catalog_v1(self): + path = os.path.join(get_project_root(), "tests", "resources", "v1", + "jaffle_shop", "catalog.json") + with open(path, "r", encoding="utf-8") as fp: + catalog_dict = yaml.safe_load(fp) + catalog_obj = parse_catalog_v1(catalog_dict) + self.assertEqual(catalog_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/catalog/v1.json") + + +class TestManifestParser(unittest.TestCase): + + def test_parse_manifest(self): + versions = ["v1", "v2", "v3", "v4"] + for version in versions: + path = os.path.join(get_project_root(), "tests", "resources", + version, "jaffle_shop", "manifest.json") + with open(path, "r", encoding="utf-8") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest(manifest_dict) + self.assertEqual( + manifest_obj.metadata.dbt_schema_version, + f"https://schemas.getdbt.com/dbt/manifest/{version}.json") + + def test_parse_manifest_v1(self): + path = os.path.join(get_project_root(), "tests", "resources", "v1", + "jaffle_shop", "manifest.json") + with open(path, "r", encoding="utf-8") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v1(manifest_dict) + self.assertEqual(manifest_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/manifest/v1.json") + + def test_parse_manifest_v2(self): + path = os.path.join(get_project_root(), "tests", "resources", "v2", + "jaffle_shop", "manifest.json") + with open(path, "r", encoding="utf-8") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v2(manifest_dict) + self.assertEqual(manifest_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/manifest/v2.json") + + def test_parse_manifest_v3(self): + path = os.path.join(get_project_root(), "tests", "resources", "v3", + "jaffle_shop", "manifest.json") + with open(path, "r", encoding="utf-8") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v3(manifest_dict) + self.assertEqual(manifest_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/manifest/v3.json") + + def test_parse_manifest_v4(self): + path = os.path.join(get_project_root(), "tests", "resources", "v4", + "jaffle_shop", "manifest.json") + with open(path, "r", encoding="utf-8") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_manifest_v4(manifest_dict) + self.assertEqual(manifest_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/manifest/v4.json") + + +class TestRunResultsParser(unittest.TestCase): + + def test_parse_run_results(self): + versions = ["v1", "v2", "v3", "v4"] + for version in versions: + path = os.path.join(get_project_root(), "tests", "resources", + version, "jaffle_shop", "run_results.json") + with open(path, "r", encoding="utf-8") as fp: + manifest_dict = yaml.safe_load(fp) + manifest_obj = parse_run_results(manifest_dict) + self.assertEqual( + manifest_obj.metadata.dbt_schema_version, + f"https://schemas.getdbt.com/dbt/run-results/{version}.json") + + def test_parse_run_results_v1(self): + path = os.path.join(get_project_root(), "tests", "resources", "v1", + "jaffle_shop", "run_results.json") + with open(path, "r", encoding="utf-8") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v1(run_results_dict) + self.assertEqual(run_results_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/run-results/v1.json") + + def test_parse_run_results_v2(self): + path = os.path.join(get_project_root(), "tests", "resources", "v2", + "jaffle_shop", "run_results.json") + with open(path, "r", encoding="utf-8") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v2(run_results_dict) + self.assertEqual(run_results_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/run-results/v2.json") + + def test_parse_run_results_v3(self): + path = os.path.join(get_project_root(), "tests", "resources", "v3", + "jaffle_shop", "run_results.json") + with open(path, "r", encoding="utf-8") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v3(run_results_dict) + self.assertEqual(run_results_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/run-results/v3.json") + + def test_parse_run_results_v4(self): + path = os.path.join(get_project_root(), "tests", "resources", "v4", + "jaffle_shop", "run_results.json") + with open(path, "r", encoding="utf-8") as fp: + run_results_dict = yaml.safe_load(fp) + run_results_obj = parse_run_results_v4(run_results_dict) + self.assertEqual(run_results_obj.metadata.dbt_schema_version, + "https://schemas.getdbt.com/dbt/run-results/v4.json") + + +# TODO add fixtures of sources.json +# class TestSourcesParser(unittest.TestCase): +# +# def test_parse_sources(self): +# versions = ["v1", "v2", "v3", "v4"] +# for version in versions: +# path = os.path.join(get_project_root(), "tests", "resources", version, "jaffle_shop", "sources.json") +# with open(path, "r", encoding="utf-8") as fp: +# manifest_dict = yaml.safe_load(fp) +# manifest_obj = parse_sources(manifest_dict) +# self.assertEqual(manifest_obj.metadata.dbt_schema_version, +# f"https://schemas.getdbt.com/dbt/manifest/{version}.json") +# +# def test_parse_sources_v1(self): +# path = os.path.join(get_project_root(), "tests", "resources", "v1", "jaffle_shop", "sources.json") +# with open(path, "r", encoding="utf-8") as fp: +# sources_dict = yaml.safe_load(fp) +# sources_obj = parse_sources_v1(sources_dict) +# self.assertEqual(sources_obj.metadata.dbt_schema_version, +# "https://schemas.getdbt.com/dbt/sources/v1.json") +# +# def test_parse_sources_v2(self): +# path = os.path.join(get_project_root(), "tests", "resources", "v2", "jaffle_shop", "sources.json") +# with open(path, "r", encoding="utf-8") as fp: +# sources_dict = yaml.safe_load(fp) +# sources_obj = parse_sources_v2(sources_dict) +# self.assertEqual(sources_obj.metadata.dbt_schema_version, +# "https://schemas.getdbt.com/dbt/sources/v2.json") +# +# def test_parse_sources_v3(self): +# path = os.path.join(get_project_root(), "tests", "resources", "v3", "jaffle_shop", "sources.json") +# with open(path, "r", encoding="utf-8") as fp: +# sources_dict = yaml.safe_load(fp) +# sources_obj = parse_sources_v3(sources_dict) +# self.assertEqual(sources_obj.metadata.dbt_schema_version, +# "https://schemas.getdbt.com/dbt/sources/v3.json") diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 0000000..060c04b --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import os +import unittest + +from dbt_artifacts_parser.utils import get_project_root + + +class TestUtils(unittest.TestCase): + + def test_get_project_root(self): + self.assertEqual( + get_project_root(), + os.path.abspath(os.path.dirname(os.path.dirname(__file__))))