-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
60 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
paths-ignore: | ||
- "**.MD" | ||
- "**.md" | ||
jobs: | ||
run-tox-tests-uc-cluster: | ||
runs-on: ubuntu-latest | ||
|
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 +1 @@ | ||
version: str = "1.6.3" | ||
version: str = "1.6.4" |
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
7 changes: 7 additions & 0 deletions
7
tests/integration/avoid_describe_extended/models/new_model.sql
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,7 @@ | ||
{{ config( | ||
materialized = 'table' | ||
) }} | ||
|
||
select cast(1 as bigint) as id, 'hello' as msg | ||
union all | ||
select cast(2 as bigint) as id, 'goodbye' as msg |
5 changes: 5 additions & 0 deletions
5
tests/integration/avoid_describe_extended/seeds/preexisting_data.csv
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,5 @@ | ||
id,msg | ||
1,hello | ||
2,goodbye | ||
2,yo | ||
3,anyway |
33 changes: 33 additions & 0 deletions
33
tests/integration/avoid_describe_extended/test_avoid_describe_extended.py
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,33 @@ | ||
from tests.integration.base import DBTIntegrationTest, use_profile | ||
|
||
|
||
class TestAvoidDescribeExtended(DBTIntegrationTest): | ||
"""Tests in this class exist to ensure we don't call describe extended unnecessarily. | ||
This became a problem due to needing to discern tables from streaming tables, which is not | ||
relevant on hive, but users on hive were having all of their tables describe extended-ed. | ||
We only need to call describe extended if we are using a UC catalog and we can't determine the | ||
type of the materialization.""" | ||
|
||
@property | ||
def schema(self): | ||
return "schema" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
def _test_avoid_describe_extended(self): | ||
# Add some existing data to ensure we don't try to 'describe extended' it. | ||
self.run_dbt(["seed"]) | ||
_, log_output = self.run_dbt_and_capture(["run"]) | ||
self.assertNotIn("describe extended", log_output) | ||
|
||
@use_profile("databricks_cluster") | ||
def test_avoid_describe_extended_databricks_cluster(self): | ||
"""When UC is not enabled, we can assumed that all tables are regular tables""" | ||
self._test_avoid_describe_extended() | ||
|
||
@use_profile("databricks_uc_sql_endpoint") | ||
def test_avoid_describe_extended_databricks_uc_sql_endpoint(self): | ||
"""When UC is enabled, regular tables are marked as such""" | ||
self._test_avoid_describe_extended() |