Skip to content

Commit

Permalink
Backport PR 607 manually to 1.1.latest. (#611)
Browse files Browse the repository at this point in the history
Co-authored-by: Mila Page <[email protected]>
  • Loading branch information
VersusFacit and VersusFacit authored Mar 16, 2023
1 parent 334f002 commit 659d400
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230315-130504.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix failing test by removing no erroneous asserts.
time: 2023-03-15T13:05:04.747323-07:00
custom:
Author: versusfacit
Issue: "605"
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@ version: 2
models:
- name: table_model_nested
columns:
- name: level_1
description: level_1 column description
- name: level_1.level_2
description: level_2 column description
- name: level_1.level_2.level_3_a
description: level_3 column description
- name: view_model_nested
columns:
- name: level_1
description: level_1 column description
- name: level_1.level_2
description: level_2 column description
- name: level_1.level_2.level_3_a
description: level_3 column description
description: level_3 column description
14 changes: 2 additions & 12 deletions tests/integration/persist_docs_tests/test_persist_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ def test_bigquery_persist_docs(self):
colunmn descriptions are persisted on the test model table and view.
Next, generate the catalog and check if the comments are also included.
Note: dbt-bigquery does not allow comments on models with children nodes
"""
self.run_dbt(['seed'])
self.run_dbt()
Expand All @@ -162,26 +164,14 @@ def test_bigquery_persist_docs(self):
bq_schema = client.get_table(table_id).schema

level_1_field = bq_schema[0]
assert level_1_field.description == \
"level_1 column description"

level_2_field = level_1_field.fields[0]
assert level_2_field.description == \
"level_2 column description"

level_3_field = level_2_field.fields[0]
assert level_3_field.description == \
"level_3 column description"

# check the descriptions in the catalog
node = catalog_data['nodes']['model.test.{}'.format(node_id)]

level_1_column = node['columns']['level_1']
assert level_1_column['comment'] == "level_1 column description"

level_2_column = node['columns']['level_1.level_2']
assert level_2_column['comment'] == "level_2 column description"

level_3_column = node['columns']['level_1.level_2.level_3_a']
assert level_3_column['comment'] == "level_3 column description"

Expand Down

0 comments on commit 659d400

Please sign in to comment.