Skip to content

Commit

Permalink
Merge branch 'main' into add_release_internal_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
VersusFacit authored Mar 26, 2024
2 parents 3cd85a4 + 955afbd commit a206d80
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240322-113720.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: remove `keyfile` from `_connection_keys`
time: 2024-03-22T11:37:20.989189-05:00
custom:
Author: McKnight-42
Issue: "1146"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240227-004659.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Add unit test for transaction semantics.
time: 2024-02-27T00:46:59.188231-08:00
custom:
Author: versusfacit
Issue: "1123"
1 change: 0 additions & 1 deletion dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ def _connection_keys(self):
"job_retries",
"job_creation_timeout_seconds",
"job_execution_timeout_seconds",
"keyfile",
"timeout_seconds",
"client_id",
"token_uri",
Expand Down
21 changes: 17 additions & 4 deletions dbt/adapters/bigquery/relation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import FrozenSet, Optional, TypeVar

from itertools import chain, islice
Expand All @@ -23,9 +23,22 @@
class BigQueryRelation(BaseRelation):
quote_character: str = "`"
location: Optional[str] = None
renameable_relations: FrozenSet[RelationType] = frozenset({RelationType.Table})
replaceable_relations: FrozenSet[RelationType] = frozenset(
{RelationType.Table, RelationType.View}

renameable_relations: FrozenSet[RelationType] = field(
default_factory=lambda: frozenset(
{
RelationType.Table,
}
)
)

replaceable_relations: FrozenSet[RelationType] = field(
default_factory=lambda: frozenset(
{
RelationType.View,
RelationType.Table,
}
)
)

def matches(
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_renamed_relations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from dbt.adapters.bigquery.relation import BigQueryRelation
from dbt.adapters.contracts.relation import RelationType


def test_renameable_relation():
relation = BigQueryRelation.create(
database="my_db",
schema="my_schema",
identifier="my_table",
type=RelationType.Table,
)
assert relation.renameable_relations == frozenset(
{
RelationType.Table,
}
)

0 comments on commit a206d80

Please sign in to comment.