-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add mypy ignore to column, connections and init * consolidate timestamp macros * add changie * Update Features-20220926-123609.yaml * add backcompat to test fixture * remove current_timestamp_in_utc * add expected_sql * remove backcompat from test_timestamps.py * update dev-requirements * Update change log body * lower case timestamps
- Loading branch information
1 parent
0cb9582
commit b65e4f3
Showing
4 changed files
with
28 additions
and
4 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-26T12:36:09.319981-07:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "483" | ||
PR: "480" |
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,3 @@ | ||
{% macro spark__current_timestamp() -%} | ||
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 TestCurrentTimestampSpark(BaseCurrentTimestamps): | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"get_current_timestamp.sql": "select {{ current_timestamp() }} as current_timestamp"} | ||
|
||
@pytest.fixture(scope="class") | ||
def expected_schema(self): | ||
return { | ||
"current_timestamp": "timestamp" | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def expected_sql(self): | ||
return """select current_timestamp() as current_timestamp""" |