-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix persist_docs for columns * Disable parquet model on endpoint * Rm parquet model, not worth the fuss * Update changelog [skip ci]
- Loading branch information
Showing
13 changed files
with
214 additions
and
20 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id,name | ||
1,Alice | ||
2,Bob |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 2 | ||
|
||
seeds: | ||
- name: seed | ||
description: | | ||
Seed model description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
columns: | ||
- name: id | ||
description: | | ||
id Column description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
- name: name | ||
description: | | ||
Some stuff here and then a call to | ||
{{ doc('my_fun_doc')}} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% docs my_fun_doc %} | ||
name Column description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
|
||
{% enddocs %} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
select 1 as id, 'Alice' as name |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
version: 2 | ||
|
||
models: | ||
|
||
- name: table_parquet_model | ||
description: | | ||
Table model description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
columns: | ||
- name: id | ||
description: | | ||
id Column description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
- name: name | ||
description: | | ||
Some stuff here and then a call to | ||
{{ doc('my_fun_doc')}} | ||
- name: table_delta_model | ||
description: | | ||
Table model description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
columns: | ||
- name: id | ||
description: | | ||
id Column description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
- name: name | ||
description: | | ||
Some stuff here and then a call to | ||
{{ doc('my_fun_doc')}} | ||
- name: view_model | ||
description: | | ||
View model description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting | ||
columns: | ||
- name: id | ||
description: | | ||
id Column description "with double quotes" | ||
and with 'single quotes' as welll as other; | ||
'''abc123''' | ||
reserved -- characters | ||
-- | ||
/* comment */ | ||
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ config(materialized='table', file_format='delta') }} | ||
select 1 as id, 'Joe' as name |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ config(materialized='view') }} | ||
select 2 as id, 'Bob' as name |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from cProfile import run | ||
from test.custom.base import DBTSparkIntegrationTest, use_profile | ||
import dbt.exceptions | ||
|
||
import json | ||
|
||
|
||
class TestPersistDocsDelta(DBTSparkIntegrationTest): | ||
@property | ||
def schema(self): | ||
return "persist_docs_columns" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'config-version': 2, | ||
'models': { | ||
'test': { | ||
'+persist_docs': { | ||
"relation": True, | ||
"columns": True, | ||
}, | ||
} | ||
}, | ||
'seeds': { | ||
'test': { | ||
'+persist_docs': { | ||
"relation": True, | ||
"columns": True, | ||
}, | ||
'+file_format': 'delta', | ||
'+quote_columns': True | ||
} | ||
}, | ||
} | ||
|
||
def test_delta_comments(self): | ||
self.run_dbt(['seed']) | ||
self.run_dbt(['run']) | ||
|
||
for table in ['table_delta_model', 'seed']: | ||
results = self.run_sql( | ||
'describe extended {schema}.{table}'.format(schema=self.unique_schema(), table=table), | ||
fetch='all' | ||
) | ||
|
||
for result in results: | ||
if result[0] == 'Comment': | ||
whatis = 'Seed' if table == 'seed' else 'Table' | ||
assert result[1].startswith(f'{whatis} model description') | ||
if result[0] == 'id': | ||
assert result[2].startswith('id Column description') | ||
if result[0] == 'name': | ||
assert result[2].startswith('Some stuff here and then a call to') | ||
|
||
# runs on Spark v3.0 | ||
@use_profile("databricks_cluster") | ||
def test_delta_comments_databricks_cluster(self): | ||
self.test_delta_comments() | ||
|
||
# runs on Spark v3.0 | ||
@use_profile("databricks_sql_endpoint") | ||
def test_delta_comments_databricks_sql_endpoint(self): | ||
self.test_delta_comments() |