1515from dbt .tests .adapter .basic .test_snapshot_check_cols import BaseSnapshotCheckCols
1616from dbt .tests .adapter .basic .test_snapshot_timestamp import BaseSnapshotTimestamp
1717from dbt .tests .adapter .basic .test_adapter_methods import BaseAdapterMethod
18- from dbt .tests .adapter .basic .test_docs_generate import BaseDocsGenerate , BaseDocsGenReferences
18+ from dbt .tests .adapter .basic .test_docs_generate import BaseDocsGenerate , BaseDocsGenReferences , models__schema_yml , models__readme_md
1919
2020
2121class TestSimpleMaterializationsSqlite (BaseSimpleMaterializations ):
@@ -58,101 +58,11 @@ class TestBaseAdapterMethodSqlite(BaseAdapterMethod):
5858 pass
5959
6060
61- @pytest .mark .skip ("TODO: fix data type problems" )
6261class TestDocsGenerateSqlite (BaseDocsGenerate ):
6362 """
6463 Change underlying test to avoid having views referencing views in other schemas, which is a no-no in sqlite.
6564 """
6665
67- models__schema_yml = """
68- version: 2
69-
70- models:
71- - name: model
72- description: "The test model"
73- docs:
74- show: false
75- columns:
76- - name: id
77- description: The user ID number
78- tests:
79- - unique
80- - not_null
81- - name: first_name
82- description: The user's first name
83- - name: email
84- description: The user's email
85- - name: ip_address
86- description: The user's IP address
87- - name: updated_at
88- description: The last time this user's email was updated
89- tests:
90- - test.nothing
91-
92- - name: second_model
93- description: "The second test model"
94- docs:
95- show: false
96- columns:
97- - name: id
98- description: The user ID number
99- - name: first_name
100- description: The user's first name
101- - name: email
102- description: The user's email
103- - name: ip_address
104- description: The user's IP address
105- - name: updated_at
106- description: The last time this user's email was updated
107-
108-
109- sources:
110- - name: my_source
111- description: "My source"
112- loader: a_loader
113- schema: "{{ var('test_schema') }}"
114- tables:
115- - name: my_table
116- description: "My table"
117- identifier: seed
118- quoting:
119- identifier: True
120- columns:
121- - name: id
122- description: "An ID field"
123-
124-
125- exposures:
126- - name: simple_exposure
127- type: dashboard
128- depends_on:
129- - ref('model')
130- - source('my_source', 'my_table')
131- owner:
132- email: something@example.com
133- - name: notebook_exposure
134- type: notebook
135- depends_on:
136- - ref('model')
137- - ref('second_model')
138- owner:
139- email: something@example.com
140- name: Some name
141- description: >
142- A description of the complex exposure
143- maturity: medium
144- meta:
145- tool: 'my_tool'
146- languages:
147- - python
148- tags: ['my_department']
149- url: http://example.com/notebook/1
150- """
151-
152- models__readme_md = """
153- This is a readme.md file with {{ invalid-ish jinja }} in it
154- """
155-
15666 models__model_sql = """
15767{{
15868 config(
@@ -178,9 +88,9 @@ class TestDocsGenerateSqlite(BaseDocsGenerate):
17888 def models (self ):
17989 # replace models with
18090 return {
181- "schema.yml" : self . models__schema_yml ,
91+ "schema.yml" : models__schema_yml ,
18292 "second_model.sql" : self .models__second_model_sql ,
183- "readme.md" : self . models__readme_md ,
93+ "readme.md" : models__readme_md ,
18494 "model.sql" : self .models__model_sql ,
18595 }
18696
@@ -191,7 +101,7 @@ def expected_catalog(self, project):
191101 role = None ,
192102 id_type = "INT" ,
193103 text_type = "TEXT" ,
194- time_type = "DATETIME " ,
104+ time_type = "TEXT " ,
195105 view_type = "view" ,
196106 table_type = "table" ,
197107 model_stats = no_stats (),
@@ -205,20 +115,21 @@ def expected_catalog(self, project):
205115 return expected_catalog
206116
207117
208- @pytest .mark .skip ("TODO: fix data type problems " )
118+ @pytest .mark .skip ("TODO: not sure why 'index' values are off by 1 " )
209119class TestDocsGenReferencesSqlite (BaseDocsGenReferences ):
120+
210121 @pytest .fixture (scope = "class" )
211122 def expected_catalog (self , project ):
212123 return expected_references_catalog (
213124 project ,
214125 role = None ,
215126 id_type = "INT" ,
216127 text_type = "TEXT" ,
217- time_type = "DATETIME " ,
128+ time_type = "TEXT " ,
218129 bigint_type = "bigint" ,
219130 view_type = "view" ,
220131 table_type = "table" ,
221132 model_stats = no_stats (),
222- seed_stats = no_stats (),
223- view_summary_stats = no_stats (),
133+ # seed_stats=no_stats(),
134+ # view_summary_stats=no_stats(),
224135 )
0 commit comments