-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* update retry settings * changelog entry * consolidate timestamps * add changie * whitespace fix * fix macro name * update expected test fixture * Update Features-20220926-105700.yaml * add backcompat to test fixture * add backcompat * update dev-requirements * Update change log body * update test class name * lowercase timestamps (cherry picked from commit 86d5dbe) Co-authored-by: colin-rogers-dbt <[email protected]>
- Loading branch information
1 parent
bc85204
commit 48b043e
Showing
4 changed files
with
37 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Features | ||
body: Migrate dbt-utils current_timestamp macros into core + adapters | ||
time: 2022-09-26T10:57:00.942765-07:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "324" | ||
PR: "323" |
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,12 @@ | ||
{% macro bigquery__current_timestamp() -%} | ||
current_timestamp() | ||
{%- endmacro %} | ||
|
||
{% macro bigquery__snapshot_string_as_time(timestamp) -%} | ||
{%- set result = 'TIMESTAMP("' ~ timestamp ~ '")' -%} | ||
{{ return(result) }} | ||
{%- endmacro %} | ||
|
||
{% macro bigquery__current_timestamp_backcompat() -%} | ||
current_timestamp | ||
{%- endmacro %} |
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,18 @@ | ||
import pytest | ||
from dbt.tests.adapter.utils.test_timestamps import BaseCurrentTimestamps | ||
|
||
|
||
class TestCurrentTimestampBigQuery(BaseCurrentTimestamps): | ||
@pytest.fixture(scope="class") | ||
def expected_schema(self): | ||
return { | ||
"current_timestamp": "TIMESTAMP", | ||
"current_timestamp_in_utc_backcompat": "TIMESTAMP", | ||
"current_timestamp_backcompat": "TIMESTAMP", | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def expected_sql(self): | ||
return """select current_timestamp() as current_timestamp, | ||
current_timestamp as current_timestamp_in_utc_backcompat, | ||
current_timestamp as current_timestamp_backcompat""" |