-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from codeforkjeff/improve-type-handling
Issue #30: Improve type handling
- Loading branch information
Showing
6 changed files
with
63 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
docker build . -t dbt-sqlite | ||
|
||
docker run \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
from dbt.tests.adapter.basic.test_snapshot_check_cols import BaseSnapshotCheckCols | ||
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp | ||
from dbt.tests.adapter.basic.test_adapter_methods import BaseAdapterMethod | ||
from dbt.tests.adapter.basic.test_docs_generate import BaseDocsGenerate, BaseDocsGenReferences | ||
from dbt.tests.adapter.basic.test_docs_generate import BaseDocsGenerate, BaseDocsGenReferences, models__schema_yml, models__readme_md | ||
|
||
|
||
class TestSimpleMaterializationsSqlite(BaseSimpleMaterializations): | ||
|
@@ -58,101 +58,11 @@ class TestBaseAdapterMethodSqlite(BaseAdapterMethod): | |
pass | ||
|
||
|
||
@pytest.mark.skip("TODO: fix data type problems") | ||
class TestDocsGenerateSqlite(BaseDocsGenerate): | ||
""" | ||
Change underlying test to avoid having views referencing views in other schemas, which is a no-no in sqlite. | ||
""" | ||
|
||
models__schema_yml = """ | ||
version: 2 | ||
models: | ||
- name: model | ||
description: "The test model" | ||
docs: | ||
show: false | ||
columns: | ||
- name: id | ||
description: The user ID number | ||
tests: | ||
- unique | ||
- not_null | ||
- name: first_name | ||
description: The user's first name | ||
- name: email | ||
description: The user's email | ||
- name: ip_address | ||
description: The user's IP address | ||
- name: updated_at | ||
description: The last time this user's email was updated | ||
tests: | ||
- test.nothing | ||
- name: second_model | ||
description: "The second test model" | ||
docs: | ||
show: false | ||
columns: | ||
- name: id | ||
description: The user ID number | ||
- name: first_name | ||
description: The user's first name | ||
- name: email | ||
description: The user's email | ||
- name: ip_address | ||
description: The user's IP address | ||
- name: updated_at | ||
description: The last time this user's email was updated | ||
sources: | ||
- name: my_source | ||
description: "My source" | ||
loader: a_loader | ||
schema: "{{ var('test_schema') }}" | ||
tables: | ||
- name: my_table | ||
description: "My table" | ||
identifier: seed | ||
quoting: | ||
identifier: True | ||
columns: | ||
- name: id | ||
description: "An ID field" | ||
exposures: | ||
- name: simple_exposure | ||
type: dashboard | ||
depends_on: | ||
- ref('model') | ||
- source('my_source', 'my_table') | ||
owner: | ||
email: [email protected] | ||
- name: notebook_exposure | ||
type: notebook | ||
depends_on: | ||
- ref('model') | ||
- ref('second_model') | ||
owner: | ||
email: [email protected] | ||
name: Some name | ||
description: > | ||
A description of the complex exposure | ||
maturity: medium | ||
meta: | ||
tool: 'my_tool' | ||
languages: | ||
- python | ||
tags: ['my_department'] | ||
url: http://example.com/notebook/1 | ||
""" | ||
|
||
models__readme_md = """ | ||
This is a readme.md file with {{ invalid-ish jinja }} in it | ||
""" | ||
|
||
models__model_sql = """ | ||
{{ | ||
config( | ||
|
@@ -178,9 +88,9 @@ class TestDocsGenerateSqlite(BaseDocsGenerate): | |
def models(self): | ||
# replace models with | ||
return { | ||
"schema.yml": self.models__schema_yml, | ||
"schema.yml": models__schema_yml, | ||
"second_model.sql": self.models__second_model_sql, | ||
"readme.md": self.models__readme_md, | ||
"readme.md": models__readme_md, | ||
"model.sql": self.models__model_sql, | ||
} | ||
|
||
|
@@ -191,7 +101,7 @@ def expected_catalog(self, project): | |
role=None, | ||
id_type="INT", | ||
text_type="TEXT", | ||
time_type="DATETIME", | ||
time_type="TEXT", | ||
view_type="view", | ||
table_type="table", | ||
model_stats=no_stats(), | ||
|
@@ -205,20 +115,21 @@ def expected_catalog(self, project): | |
return expected_catalog | ||
|
||
|
||
@pytest.mark.skip("TODO: fix data type problems") | ||
@pytest.mark.skip("TODO: not sure why 'index' values are off by 1") | ||
class TestDocsGenReferencesSqlite(BaseDocsGenReferences): | ||
|
||
@pytest.fixture(scope="class") | ||
def expected_catalog(self, project): | ||
return expected_references_catalog( | ||
project, | ||
role=None, | ||
id_type="INT", | ||
text_type="TEXT", | ||
time_type="DATETIME", | ||
time_type="TEXT", | ||
bigint_type="bigint", | ||
view_type="view", | ||
table_type="table", | ||
model_stats=no_stats(), | ||
seed_stats=no_stats(), | ||
view_summary_stats=no_stats(), | ||
#seed_stats=no_stats(), | ||
#view_summary_stats=no_stats(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters