Repository: dbt-labs/dbt-core

Issue:
BigQuery insert_overwrite incremental strategy fails for day partitioned tables
### Description
I have a config for a model (using BigQuery) like below (in the model file):
```
{{
  config(
    partition_by = {
        'field': 'ETL_CREATE_DTS',
        'data_type': 'timestamp',
        'granularity': 'day'
    },
    unique_key = "TRANSACTIONID",
    incremental_strategy = 'insert_overwrite'
  )
}}
```

ETL_CREATE_DTS is of the type TIMESTAMP

When running this model the first time (`dbt run`), it succeeds.  However the second time, when the query is referencing the target table to find out what partitions to overwrite, it fails with the error:
```
Database Error in model msa_premium_transaction_fact_clean (models/cleaning/msa/msa_premium_transaction_fact_clean.sql)
  Query error: Cannot coerce expression (
            select as struct
                array_agg(distinct timestamp_trunc(ETL_CREATE_DTS, day))
            from `gcp-ent-property-etl-dev`.`sample_dw`.`msa_premium_transaction_fact_clean__dbt_tmp`
        ) to type STRUCT<ARRAY<DATE>> at [106:46]
  compiled SQL at target/run/dbt_etl_poc/models/cleaning/msa/msa_premium_transaction_fact_clean.sql
```

Turns out the generated SQL for this insert_overwrite is incorrect:
```
-- generated script to merge partitions into `gcp-ent-property-etl-dev`.`sample_dw`.`msa_premium_transaction_fact_clean`
      declare dbt_partitions_for_replacement array<date>;
      declare _dbt_max_partition timestamp;

      set _dbt_max_partition = (
          select max(ETL_CREATE_DTS) from `gcp-ent-property-etl-dev`.`sample_dw`.`msa_premium_transaction_fact_clean`
      );

      -- 1. create a temp table

....
      
      -- 2. define partitions to update
      set (dbt_partitions_for_replacement) = (
          select as struct
              array_agg(distinct timestamp_trunc(ETL_CREATE_DTS, day))
          from `project-id`.`sample_dw`.`msa_premium_transaction_fact_clean__dbt_tmp`
      );

      
      -- 3. run the merge statement
...
```

Notice the variable `declare dbt_partitions_for_replacement array<date>;` will not match the output of (2) because `timestamp_trunc` returns a TIMESTAMP type.  

### Steps To Reproduce
In as much detail as possible, please provide steps to reproduce the issue. Sample data that triggers the issue, example model code, etc is all very helpful here.

### Expected behavior
I should be able to declare a BigQuery table partitioned by day on a timestamp field, and the insert_overwrite strategy work. 
 A quick fix in the code seems to be the declared variable needs to have the same datatype defined for the array as the data type of the partitioned field in the BigQuery table (see below)

It looks as if this line (https://github.com/fishtown-analytics/dbt/blob/2b48152da66dbd7f07272983bbc261f1b6924f20/plugins/bigquery/dbt/include/bigquery/macros/materializations/incremental.sql#L20) could be removed to allow the the variable definition (https://github.com/fishtown-analytics/dbt/blob/2b48152da66dbd7f07272983bbc261f1b6924f20/plugins/bigquery/dbt/include/bigquery/macros/materializations/incremental.sql#L52) to reflect the exact data type.

### System information
**Which database are you using dbt with?**
- [ ] postgres
- [ ] redshift
- [X] bigquery
- [ ] snowflake
- [ ] other (specify: ____________)


**The output of `dbt --version`:**
```
installed version: 0.19.0
   latest version: 0.19.0

Up to date!

Plugins:
  - bigquery: 0.19.0
  - snowflake: 0.19.0
  - redshift: 0.19.0
  - postgres: 0.19.0
```

**The operating system you're using:**
macOS Catalina

**The output of `python --version`:**
Python 2.7.16



Discussion:
We've experienced this same behavior. I'd note that this isn't a problem in 0.18.1., where the query used to create the struct returned dates rather than timestamps.
Thanks for the report @osusam28 @noahbruegmann!

This is a regression in v0.19.0, an unintended side-effect of the addition of `granularity`. As you noted, the fix here should be quite straightforward: BigQuery now supports `timestamp`-type partitions, so there's no need to cast to `date` as before. This may require a one-time full-refresh for folks who have _current_ incremental models partitioned by a `date` type (`date(timestamp_col)`) who will now be partitioning by a `timestamp` type (`timestamp_trunc(timestamp_col, day)`).

In any case, we'll get this fixed for v0.19.1. We also need better test coverage for the matrix of potential partition data types and incremental strategies, to avoid regressions like this one (or #3063) from happening in the future.
Great news: BigQuery considers a table to be partitioned by `Day`, regardless of whether that's `date_col`, `date(timestamp_col)`, or `timestamp_trunc(timestamp_col, day)`. That's a pleasant surprise, and it means that both incremental updates and full refreshes (via `create or replace`, without need for hard drop-and-recreate) will work just fine when upgrading from v0.18.1 &rarr; v0.19.1.

I'll work on a PR for this now.

Resolving patch:
diff --git a/plugins/bigquery/dbt/adapters/bigquery/impl.py b/plugins/bigquery/dbt/adapters/bigquery/impl.py
--- a/plugins/bigquery/dbt/adapters/bigquery/impl.py
+++ b/plugins/bigquery/dbt/adapters/bigquery/impl.py
@@ -58,8 +58,10 @@ def render(self, alias: Optional[str] = None):
         if alias:
             column = f'{alias}.{self.field}'
 
-        if self.data_type.lower() == 'date' and \
-                self.granularity.lower() == 'day':
+        if self.data_type.lower() == 'int64' or (
+            self.data_type.lower() == 'date' and
+            self.granularity.lower() == 'day'
+        ):
             return column
         else:
             return f'{self.data_type}_trunc({column}, {self.granularity})'
@@ -551,10 +553,10 @@ def _partitions_match(
         if not is_partitioned and not conf_partition:
             return True
         elif conf_partition and table.time_partitioning is not None:
-            table_field = table.time_partitioning.field
-            table_granularity = table.partitioning_type
-            return table_field == conf_partition.field \
-                and table_granularity == conf_partition.granularity
+            table_field = table.time_partitioning.field.lower()
+            table_granularity = table.partitioning_type.lower()
+            return table_field == conf_partition.field.lower() \
+                and table_granularity == conf_partition.granularity.lower()
         elif conf_partition and table.range_partitioning is not None:
             dest_part = table.range_partitioning
             conf_part = conf_partition.range or {}


Test patch:
diff --git a/test/integration/022_bigquery_test/data/incremental_overwrite_expected.csv b/test/integration/022_bigquery_test/data/incremental_overwrite_date_expected.csv
similarity index 100%
rename from test/integration/022_bigquery_test/data/incremental_overwrite_expected.csv
rename to test/integration/022_bigquery_test/data/incremental_overwrite_date_expected.csv
diff --git a/test/integration/022_bigquery_test/data/incremental_overwrite_day_expected.csv b/test/integration/022_bigquery_test/data/incremental_overwrite_day_expected.csv
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/data/incremental_overwrite_day_expected.csv
@@ -0,0 +1,5 @@
+id,date_time
+10,2020-01-01 00:00:00
+20,2020-01-01 00:00:00
+30,2020-01-02 00:00:00
+40,2020-01-02 00:00:00
diff --git a/test/integration/022_bigquery_test/data/incremental_overwrite_range_expected.csv b/test/integration/022_bigquery_test/data/incremental_overwrite_range_expected.csv
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/data/incremental_overwrite_range_expected.csv
@@ -0,0 +1,5 @@
+id,date_int
+10,20200101
+20,20200101
+30,20200102
+40,20200102
diff --git a/test/integration/022_bigquery_test/data/incremental_overwrite_time_expected.csv b/test/integration/022_bigquery_test/data/incremental_overwrite_time_expected.csv
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/data/incremental_overwrite_time_expected.csv
@@ -0,0 +1,5 @@
+id,date_hour
+10,2020-01-01 01:00:00
+20,2020-01-01 01:00:00
+30,2020-01-01 02:00:00
+40,2020-01-01 02:00:00
diff --git a/test/integration/022_bigquery_test/data/merge_expected.csv b/test/integration/022_bigquery_test/data/merge_expected.csv
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/data/merge_expected.csv
@@ -0,0 +1,7 @@
+id,date_time
+1,2020-01-01 00:00:00
+2,2020-01-01 00:00:00
+3,2020-01-01 00:00:00
+4,2020-01-02 00:00:00
+5,2020-01-02 00:00:00
+6,2020-01-02 00:00:00
\ No newline at end of file
diff --git a/test/integration/022_bigquery_test/incremental-strategy-models/incremental_merge_range.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_merge_range.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_merge_range.sql
@@ -0,0 +1,46 @@
+
+{{
+    config(
+        materialized="incremental",
+        unique_key="id",
+        cluster_by="id",
+        partition_by={
+            "field": "id",
+            "data_type": "int64",
+            "range": {
+                "start": 1,
+                "end": 10,
+                "interval": 1
+            }
+        }
+    )
+}}
+
+
+with data as (
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 2 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 3 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 4 as id, cast('2020-01-01' as datetime) as date_time
+    
+    {% else %}
+    
+        select 1 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 2 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 3 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 4 as id, cast('2020-01-02' as datetime) as date_time union all
+        select 5 as id, cast('2020-01-02' as datetime) as date_time union all
+        select 6 as id, cast('2020-01-02' as datetime) as date_time
+    
+    {% endif %}
+
+)
+
+select * from data
+
+{% if is_incremental() %}
+where id >= (select max(id) from {{ this }})
+{% endif %}
diff --git a/test/integration/022_bigquery_test/incremental-strategy-models/incremental_merge_time.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_merge_time.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_merge_time.sql
@@ -0,0 +1,42 @@
+
+{{
+    config(
+        materialized="incremental",
+        unique_key="id",
+        cluster_by="id",
+        partition_by={
+            "field": "date_time",
+            "data_type": "datetime"
+        }
+    )
+}}
+
+
+
+with data as (
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 2 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 3 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 4 as id, cast('2020-01-01' as datetime) as date_time
+    
+    {% else %}
+    
+        select 1 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 2 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 3 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 4 as id, cast('2020-01-02' as datetime) as date_time union all
+        select 5 as id, cast('2020-01-02' as datetime) as date_time union all
+        select 6 as id, cast('2020-01-02' as datetime) as date_time
+    
+    {% endif %}
+
+)
+
+select * from data
+
+{% if is_incremental() %}
+where date_time > (select max(date_time) from {{ this }})
+{% endif %}
diff --git a/test/integration/022_bigquery_test/scripting-models/incremental_overwrite.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_date.sql
similarity index 64%
rename from test/integration/022_bigquery_test/scripting-models/incremental_overwrite.sql
rename to test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_date.sql
--- a/test/integration/022_bigquery_test/scripting-models/incremental_overwrite.sql
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_date.sql
@@ -13,24 +13,29 @@
 
 
 with data as (
-    select 1 as id, cast('2020-01-01' as date) as date_day union all
-    select 2 as id, cast('2020-01-01' as date) as date_day union all
-    select 3 as id, cast('2020-01-01' as date) as date_day union all
-    select 4 as id, cast('2020-01-01' as date) as date_day
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, cast('2020-01-01' as date) as date_day union all
+        select 2 as id, cast('2020-01-01' as date) as date_day union all
+        select 3 as id, cast('2020-01-01' as date) as date_day union all
+        select 4 as id, cast('2020-01-01' as date) as date_day
 
-    {% if is_incremental() %}
-        union all
+    {% else %}
+    
         -- we want to overwrite the 4 records in the 2020-01-01 partition
-        -- with the 2 records below, but add two more in the 2020-01-01 partition
+        -- with the 2 records below, but add two more in the 2020-01-02 partition
         select 10 as id, cast('2020-01-01' as date) as date_day union all
         select 20 as id, cast('2020-01-01' as date) as date_day union all
         select 30 as id, cast('2020-01-02' as date) as date_day union all
         select 40 as id, cast('2020-01-02' as date) as date_day
+    
     {% endif %}
+
 )
 
 select * from data
 
 {% if is_incremental() %}
-where ts >= _dbt_max_partition
+where date_day >= _dbt_max_partition
 {% endif %}
diff --git a/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_day.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_day.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_day.sql
@@ -0,0 +1,41 @@
+
+{{
+    config(
+        materialized="incremental",
+        incremental_strategy='insert_overwrite',
+        cluster_by="id",
+        partition_by={
+            "field": "date_time",
+            "data_type": "datetime"
+        }
+    )
+}}
+
+
+with data as (
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 2 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 3 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 4 as id, cast('2020-01-01' as datetime) as date_time
+
+    {% else %}
+        
+        -- we want to overwrite the 4 records in the 2020-01-01 partition
+        -- with the 2 records below, but add two more in the 2020-01-02 partition
+        select 10 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 20 as id, cast('2020-01-01' as datetime) as date_time union all
+        select 30 as id, cast('2020-01-02' as datetime) as date_time union all
+        select 40 as id, cast('2020-01-02' as datetime) as date_time
+    
+    {% endif %}
+
+)
+
+select * from data
+
+{% if is_incremental() %}
+where date_time >= _dbt_max_partition
+{% endif %}
diff --git a/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_partitions.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_partitions.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_partitions.sql
@@ -0,0 +1,42 @@
+
+{{
+    config(
+        materialized="incremental",
+        incremental_strategy='insert_overwrite',
+        cluster_by="id",
+        partitions=["'2020-01-01'","'2020-01-02'"],
+        partition_by={
+            "field": "date_day",
+            "data_type": "date"
+        }
+    )
+}}
+
+
+with data as (
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, cast('2020-01-01' as date) as date_day union all
+        select 2 as id, cast('2020-01-01' as date) as date_day union all
+        select 3 as id, cast('2020-01-01' as date) as date_day union all
+        select 4 as id, cast('2020-01-01' as date) as date_day
+
+    {% else %}
+        
+        -- we want to overwrite the 4 records in the 2020-01-01 partition
+        -- with the 2 records below, but add two more in the 2020-01-02 partition
+        select 10 as id, cast('2020-01-01' as date) as date_day union all
+        select 20 as id, cast('2020-01-01' as date) as date_day union all
+        select 30 as id, cast('2020-01-02' as date) as date_day union all
+        select 40 as id, cast('2020-01-02' as date) as date_day
+    
+    {% endif %}
+
+)
+
+select * from data
+
+{% if is_incremental() %}
+where date_day in ({{ config.get("partitions") | join(",") }})
+{% endif %}
diff --git a/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_range.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_range.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_range.sql
@@ -0,0 +1,46 @@
+
+{{
+    config(
+        materialized="incremental",
+        incremental_strategy='insert_overwrite',
+        cluster_by="id",
+        partition_by={
+            "field": "date_int",
+            "data_type": "int64",
+            "range": {
+                "start": 20200101,
+                "end": 20200110,
+                "interval": 1
+            }
+        }
+    )
+}}
+
+
+with data as (
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, 20200101 as date_int union all
+        select 2 as id, 20200101 as date_int union all
+        select 3 as id, 20200101 as date_int union all
+        select 4 as id, 20200101 as date_int
+
+    {% else %}
+        
+        -- we want to overwrite the 4 records in the 20200101 partition
+        -- with the 2 records below, but add two more in the 20200102 partition
+        select 10 as id, 20200101 as date_int union all
+        select 20 as id, 20200101 as date_int union all
+        select 30 as id, 20200102 as date_int union all
+        select 40 as id, 20200102 as date_int
+    
+    {% endif %}
+
+)
+
+select * from data
+
+{% if is_incremental() %}
+where date_int >= _dbt_max_partition
+{% endif %}
diff --git a/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_time.sql b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_time.sql
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/incremental-strategy-models/incremental_overwrite_time.sql
@@ -0,0 +1,42 @@
+
+{{
+    config(
+        materialized="incremental",
+        incremental_strategy='insert_overwrite',
+        cluster_by="id",
+        partition_by={
+            "field": "date_hour",
+            "data_type": "datetime",
+            "granularity": "hour"
+        }
+    )
+}}
+
+
+with data as (
+    
+    {% if not is_incremental() %}
+    
+        select 1 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all
+        select 2 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all
+        select 3 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all
+        select 4 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour
+
+    {% else %}
+    
+        -- we want to overwrite the 4 records in the 2020-01-01 01:00:00 partition
+        -- with the 2 records below, but add two more in the 2020-01-00 02:00:00 partition
+        select 10 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all
+        select 20 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all
+        select 30 as id, cast('2020-01-01 02:00:00' as datetime) as date_hour union all
+        select 40 as id, cast('2020-01-01 02:00:00' as datetime) as date_hour
+    
+    {% endif %}
+
+)
+
+select * from data
+
+{% if is_incremental() %}
+where date_hour >= _dbt_max_partition
+{% endif %}
diff --git a/test/integration/022_bigquery_test/scripting-models/incremental_range.sql b/test/integration/022_bigquery_test/scripting-models/incremental_range.sql
deleted file mode 100644
--- a/test/integration/022_bigquery_test/scripting-models/incremental_range.sql
+++ /dev/null
@@ -1,39 +0,0 @@
-
-{{
-    config(
-        materialized="incremental",
-        unique_key="id",
-        cluster_by="id",
-        partition_by={
-            "field": "id",
-            "data_type": "int64",
-            "range": {
-                "start": 1,
-                "end": 10,
-                "interval": 1
-            }
-        }
-    )
-}}
-
-
-with data as (
-    select 1 as id, current_date() as ts union all
-    select 2 as id, current_date() as ts union all
-    select 3 as id, current_date() as ts union all
-    select 4 as id, current_date() as ts
-
-    {% if is_incremental() %}
-        union all
-        select 5 as id, current_date() as ts union all
-        select 6 as id, current_date() as ts union all
-        select 7 as id, current_date() as ts union all
-        select 8 as id, current_date() as ts
-    {% endif %}
-)
-
-select * from data
-
-{% if is_incremental() %}
-where id > _dbt_max_partition
-{% endif %}
diff --git a/test/integration/022_bigquery_test/scripting-models/incremental_time.sql b/test/integration/022_bigquery_test/scripting-models/incremental_time.sql
deleted file mode 100644
--- a/test/integration/022_bigquery_test/scripting-models/incremental_time.sql
+++ /dev/null
@@ -1,34 +0,0 @@
-
-{{
-    config(
-        materialized="incremental",
-        unique_key="id",
-        cluster_by="id",
-        partition_by={
-            "field": "ts",
-            "data_type": "timestamp"
-        }
-    )
-}}
-
-
-with data as (
-    select 1 as id, current_timestamp() as ts union all
-    select 2 as id, current_timestamp() as ts union all
-    select 3 as id, current_timestamp() as ts union all
-    select 4 as id, current_timestamp() as ts
-
-    {% if is_incremental() %}
-        union all
-        select 5 as id, current_timestamp() as ts union all
-        select 6 as id, current_timestamp() as ts union all
-        select 7 as id, current_timestamp() as ts union all
-        select 8 as id, current_timestamp() as ts
-    {% endif %}
-)
-
-select * from data
-
-{% if is_incremental() %}
-where ts > _dbt_max_partition
-{% endif %}
diff --git a/test/integration/022_bigquery_test/test_incremental_strategies.py b/test/integration/022_bigquery_test/test_incremental_strategies.py
new file mode 100644
--- /dev/null
+++ b/test/integration/022_bigquery_test/test_incremental_strategies.py
@@ -0,0 +1,29 @@
+from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile
+
+class TestBigQueryScripting(DBTIntegrationTest):
+
+    @property
+    def schema(self):
+        return "bigquery_test_022"
+
+    @property
+    def models(self):
+        return "incremental-strategy-models"
+
+    @use_profile('bigquery')
+    def test__bigquery_assert_incrementals(self):
+        results = self.run_dbt()
+        self.assertEqual(len(results), 7)
+
+        results = self.run_dbt()
+        self.assertEqual(len(results), 7)
+
+        results = self.run_dbt(['seed'])
+
+        self.assertTablesEqual('incremental_merge_range', 'merge_expected')
+        self.assertTablesEqual('incremental_merge_time', 'merge_expected')
+        self.assertTablesEqual('incremental_overwrite_time', 'incremental_overwrite_time_expected')
+        self.assertTablesEqual('incremental_overwrite_date', 'incremental_overwrite_date_expected')
+        self.assertTablesEqual('incremental_overwrite_partitions', 'incremental_overwrite_date_expected')
+        self.assertTablesEqual('incremental_overwrite_day', 'incremental_overwrite_day_expected')
+        self.assertTablesEqual('incremental_overwrite_range', 'incremental_overwrite_range_expected')
diff --git a/test/integration/022_bigquery_test/test_scripting.py b/test/integration/022_bigquery_test/test_scripting.py
deleted file mode 100644
--- a/test/integration/022_bigquery_test/test_scripting.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile
-
-class TestBigQueryScripting(DBTIntegrationTest):
-
-    @property
-    def schema(self):
-        return "bigquery_test_022"
-
-    @property
-    def models(self):
-        return "scripting-models"
-
-    @property
-    def profile_config(self):
-        return self.bigquery_profile()
-
-    def assert_incrementals(self):
-        results = self.run_dbt()
-        self.assertEqual(len(results), 3)
-
-        self.run_dbt()
-        self.assertEqual(len(results), 3)
-
-        results = self.run_dbt(['seed'])
-
-        self.assertTablesEqual('incremental_overwrite', 'incremental_overwrite_expected')