-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly cast column types when inserting into seeds (#166)
* Explicitly cast column types when inserting into seeds * Add changelog entry
- Loading branch information
Showing
4 changed files
with
54 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ID,ORDERID,PAYMENTMETHOD,STATUS,AMOUNT,AMOUNT_USD,CREATED | ||
1,1,credit_card,success,1000,10.00,2018-01-01 | ||
2,2,credit_card,success,2000,20.00,2018-01-02 | ||
3,3,coupon,success,100,1.00,2018-01-04 | ||
4,4,coupon,success,2500,25.00,2018-01-05 | ||
5,5,bank_transfer,fail,1700,17.00,2018-01-05 | ||
6,5,bank_transfer,success,1700,17.00,2018-01-05 | ||
7,6,credit_card,success,600,6.00,2018-01-07 | ||
8,7,credit_card,success,1600,16.00,2018-01-09 | ||
9,8,credit_card,success,2300,23.00,2018-01-11 | ||
10,9,gift_card,success,2300,23.00,2018-01-12 |
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,36 @@ | ||
from cProfile import run | ||
from test.custom.base import DBTSparkIntegrationTest, use_profile | ||
import dbt.exceptions | ||
|
||
|
||
class TestSeedColumnTypeCast(DBTSparkIntegrationTest): | ||
@property | ||
def schema(self): | ||
return "seed_column_types" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'seeds': { | ||
'quote_columns': False, | ||
}, | ||
} | ||
|
||
# runs on Spark v2.0 | ||
@use_profile("apache_spark") | ||
def test_seed_column_types_apache_spark(self): | ||
self.run_dbt(["seed"]) | ||
|
||
# runs on Spark v3.0 | ||
@use_profile("databricks_cluster") | ||
def test_seed_column_types_databricks_cluster(self): | ||
self.run_dbt(["seed"]) | ||
|
||
# runs on Spark v3.0 | ||
@use_profile("databricks_sql_endpoint") | ||
def test_seed_column_types_databricks_sql_endpoint(self): | ||
self.run_dbt(["seed"]) |