title: dbt partitions bigquery table on wrong field
body: <p>Trying to add data build tool to our ecosystem and faced with titled problem. We are currently using huge BigQuery tables so we want them to be partitioned and extended every day. IDK if that matters, but everything is running in docker container. Here's the way you can reproduce it:</p>
  <p><strong>bigquery sql query to create source table</strong>:</p>
  <pre><code>create table `***.dbt_nick_test.partition_test_20210304` (
      session_date DATE,
      user_id STRING
  );
  
  insert into `***.dbt_nick_test.partition_test_20210304` (session_date, user_id)
  values ('2021-03-04', '1234'), ('2021-03-04', NULL), ('2021-03-04', '1235');
  </code></pre>
  <p><strong>dbt_project.yml</strong> - models defenition part:</p>
  <pre><code>models:
          ***:
                  test:
                          +schema: test
  </code></pre>
  <p><strong>profiles.yml</strong> - just in case to be sure everything is configured ok:</p>
  <pre><code>***-bq:
      target: &quot;{{ env_var('DBT_TARGET', 'dev') }}&quot;
      outputs:
          dev:
              type: bigquery
              method: service-account
              project: ***
              dataset: dbt_nick_test
              threads: 4
              keyfile: /root/.dbt/bq-creds.json
              timeout_seconds: 300
              priority: interactive
              retries: 1
  </code></pre>
  <p>cat <strong>models/test/test.sql</strong>:</p>
  <pre><code>{{
  config(
      partition_by={
          &quot;field&quot;: &quot;session_date&quot;,
          &quot;data_type&quot;: &quot;date&quot;,
          &quot;granularity&quot;: &quot;day&quot;
      },
      partitions=dbt.partition_range(var('dates', default=yesterday())),
      verbose=True
  )
  }}
  
  SELECT
    session_date,
    user_id
  FROM `***`.`dbt_nick_test`.`{{ date_sharded_table('partition_test_') }}`
  </code></pre>
  <p>yesterday macro is default from dbt tutorial.</p>
  <p>After running <code>dbt -dS run -m test --vars 'dates: &quot;20210304, 20210304&quot;'</code> (everything is going OK) dbt reports that table is created successfully. Now, going to BigQuery I can see that the table is actually created, but it has bad &quot;partition by&quot; field -- _PARTITIONTIME instead of &quot;session_date&quot; <a href="https://i.stack.imgur.com/ayZWg.png" rel="nofollow noreferrer">screenshot</a>.</p>
  <p>If I manually create correctly partitioned table and then run <code>dbt run</code> -- it will work as expected, everything is perfect.</p>
  <p>Also, tables created from this table using dbt are also badly partitioned.</p>