-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 #2727 from fishtown-analytics/fix/2197-long-table-…
…names Check Postgres relation name lengths and throw error when over 63
- Loading branch information
Showing
10 changed files
with
76 additions
and
0 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
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,4 @@ | ||
col_A,col_B | ||
1,2 | ||
3,4 | ||
5,6 |
2 changes: 2 additions & 0 deletions
2
...lation_name_tests/models/long_table_name_with_enough_characters_to_fail_when_tmp_name.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,2 @@ | ||
|
||
select * from {{ this.schema }}.seed |
34 changes: 34 additions & 0 deletions
34
test/integration/063_relation_name_tests/test_relation_name.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,34 @@ | ||
from test.integration.base import DBTIntegrationTest, use_profile | ||
import dbt.exceptions | ||
|
||
class TestAdapterDDL(DBTIntegrationTest): | ||
|
||
def setUp(self): | ||
DBTIntegrationTest.setUp(self) | ||
self.run_dbt(['seed']) | ||
|
||
@property | ||
def schema(self): | ||
return "adapter_ddl_063" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'config-version': 2, | ||
'seeds': { | ||
'quote_columns': False, | ||
}, | ||
} | ||
|
||
@use_profile('postgres') | ||
def test_postgres_long_name_fails(self): | ||
self.run_dbt(['run'],expect_pass=False) | ||
|
||
@use_profile('redshift') | ||
def test_redshift_long_name_succeeds(self): | ||
self.run_dbt(['run'],expect_pass=True) | ||
|