Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dbt show tests #927

Merged
merged 6 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230925-143628.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Add tests for inlined limit + sql-header in dbt show query
time: 2023-09-25T14:36:28.335466+01:00
custom:
Author: michelleark
Issue: "940"
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# install latest changes in dbt-core
# TODO: how to automate switching from develop to version branches?
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-core.git@8496/limit-in-show-query#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git@8496/limit-in-show-query#egg=dbt-tests-adapter&subdirectory=tests/adapter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will undo before merging.


# if version 1.x or greater -> pin to major version
# if version 0.x -> pin to minor
Expand Down
29 changes: 29 additions & 0 deletions tests/functional/adapter/dbt_show/test_dbt_show.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pytest
from dbt.tests.adapter.dbt_show.test_dbt_show import BaseShowSqlHeader, BaseShowLimit


my_model_sql_header_sql = """
{{
config(
materialized = "table"
)
}}

{% call set_sql_header(config) %}
DECLARE DEMO STRING DEFAULT 'hello world';
{% endcall %}

SELECT DEMO as column_name
"""


class TestBigQueryShowLimit(BaseShowLimit):
pass


class TestBigQueryShowSqlHeader(BaseShowSqlHeader):
@pytest.fixture(scope="class")
def models(self):
return {
"sql_header.sql": my_model_sql_header_sql,
}
Loading