Skip to content

Commit

Permalink
Merge branch 'main' into feature/materialized-views/ADAP-394
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare authored Oct 11, 2023
2 parents b5c19d9 + b06414f commit 9f57900
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230921-175106.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Support storing test failures as views
time: 2023-09-21T17:51:06.389529-04:00
custom:
Author: mikealfare
Issue: "6914"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230817-095527.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Avoid setting lifetime on impersonation tokens.
time: 2023-08-17T09:55:27.333914673-04:00
custom:
Author: cmc333333
Issue: "769"
1 change: 0 additions & 1 deletion dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ def get_impersonated_credentials(cls, profile_credentials):
source_credentials=source_credentials,
target_principal=profile_credentials.impersonate_service_account,
target_scopes=list(profile_credentials.scopes),
lifetime=(profile_credentials.job_execution_timeout_seconds or 300),
)

@classmethod
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pytest

from dbt.tests.adapter.store_test_failures_tests import basic
from dbt.tests.adapter.store_test_failures_tests.test_store_test_failures import (
StoreTestFailuresBase,
)
Expand All @@ -20,3 +22,27 @@ def teardown_method(self, project):
def test_store_and_assert(self, project):
self.run_tests_store_one_failure(project)
self.run_tests_store_failures_and_assert(project)


class TestStoreTestFailuresAsInteractions(basic.StoreTestFailuresAsInteractions):
pass


class TestStoreTestFailuresAsProjectLevelOff(basic.StoreTestFailuresAsProjectLevelOff):
pass


class TestStoreTestFailuresAsProjectLevelView(basic.StoreTestFailuresAsProjectLevelView):
pass


class TestStoreTestFailuresAsGeneric(basic.StoreTestFailuresAsGeneric):
pass


class TestStoreTestFailuresAsProjectLevelEphemeral(basic.StoreTestFailuresAsProjectLevelEphemeral):
pass


class TestStoreTestFailuresAsExceptions(basic.StoreTestFailuresAsExceptions):
pass
16 changes: 16 additions & 0 deletions tests/functional/adapter/utils/fixture_get_intervals_between.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
models__bq_test_get_intervals_between_sql = """
SELECT
{{ get_intervals_between("'2023-09-01'", "'2023-09-12'", "day") }} as intervals,
11 as expected
"""

models___bq_test_get_intervals_between_yml = """
version: 2
models:
- name: test_get_intervals_between
tests:
- assert_equal:
actual: intervals
expected: expected
"""
31 changes: 31 additions & 0 deletions tests/functional/adapter/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
from dbt.tests.adapter.utils.test_current_timestamp import BaseCurrentTimestampAware
from dbt.tests.adapter.utils.test_dateadd import BaseDateAdd
from dbt.tests.adapter.utils.test_datediff import BaseDateDiff
from dbt.tests.adapter.utils.test_date_spine import BaseDateSpine
from dbt.tests.adapter.utils.test_date_trunc import BaseDateTrunc
from dbt.tests.adapter.utils.test_escape_single_quotes import BaseEscapeSingleQuotesBackslash
from dbt.tests.adapter.utils.test_except import BaseExcept
from dbt.tests.adapter.utils.test_generate_series import BaseGenerateSeries
from dbt.tests.adapter.utils.test_get_intervals_between import BaseGetIntervalsBetween
from dbt.tests.adapter.utils.test_get_powers_of_two import BaseGetPowersOfTwo
from dbt.tests.adapter.utils.test_hash import BaseHash
from dbt.tests.adapter.utils.test_intersect import BaseIntersect
from dbt.tests.adapter.utils.test_last_day import BaseLastDay
Expand All @@ -41,6 +45,10 @@
models__array_construct_expected_sql,
macros__array_to_string_sql,
)
from tests.functional.adapter.utils.fixture_get_intervals_between import (
models__bq_test_get_intervals_between_sql,
models___bq_test_get_intervals_between_yml,
)


class TestAnyValue(BaseAnyValue):
Expand Down Expand Up @@ -117,6 +125,10 @@ class TestDateDiff(BaseDateDiff):
pass


class TestDateSpine(BaseDateSpine):
pass


class TestDateTrunc(BaseDateTrunc):
pass

Expand All @@ -129,6 +141,25 @@ class TestExcept(BaseExcept):
pass


class TestGenerateSeries(BaseGenerateSeries):
pass


class TestGetIntervalsBetween(BaseGetIntervalsBetween):
@pytest.fixture(scope="class")
def models(self):
return {
"test_get_intervals_between.yml": models___bq_test_get_intervals_between_yml,
"test_get_intervals_between.sql": self.interpolate_macro_namespace(
models__bq_test_get_intervals_between_sql, "get_intervals_between"
),
}


class TestGetPowersOfTwo(BaseGetPowersOfTwo):
pass


class TestHash(BaseHash):
pass

Expand Down

0 comments on commit 9f57900

Please sign in to comment.