Skip to content

Commit

Permalink
Update dbt-core to 1.7.0rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
damian3031 committed Oct 13, 2023
1 parent ff2f74a commit 3b6dbf2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dbt/adapters/trino/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.6.2"
version = "1.7.0rc1"
9 changes: 1 addition & 8 deletions dbt/adapters/trino/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
from dbt.contracts.relation import ComponentName


@dataclass
class TrinoQuotePolicy(Policy):
database: bool = False
schema: bool = False
identifier: bool = False


@dataclass(frozen=True, eq=False, repr=False)
class TrinoRelation(BaseRelation):
quote_policy: TrinoQuotePolicy = field(default_factory=lambda: TrinoQuotePolicy())
quote_policy: Policy = field(default_factory=lambda: Policy())

# Overridden as Trino converts relation identifiers to lowercase
def _is_exactish_match(self, field: ComponentName, value: str) -> bool:
Expand Down
4 changes: 1 addition & 3 deletions dbt/include/trino/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,9 @@
{% endmacro %}
{% macro trino__drop_relation(relation) -%}
{%- macro trino__get_drop_sql(relation) -%}
{% set relation_type = relation.type|replace("_", " ") %}
{% call statement('drop_relation', auto_begin=False) -%}
drop {{ relation_type }} if exists {{ relation }}
{%- endcall %}
{% endmacro %}
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dbt-tests-adapter~=1.6.5
dbt-tests-adapter~=1.7.0rc1
mypy==1.5.1 # patch updates have historically introduced breaking changes
pre-commit~=3.4
pytest~=7.4
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/adapter/constraints/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

_expected_sql_trino = """
create table <model_identifier> (
"id" integer not null,
"id" int not null,
color varchar,
date_day varchar
) ;
Expand Down Expand Up @@ -206,7 +206,7 @@ def models(self):
def expected_sql(self):
return """
create table <model_identifier> (
"id" integer not null,
"id" int not null,
color varchar,
date_day varchar
) ;
Expand Down Expand Up @@ -240,7 +240,7 @@ def models(self):
def expected_sql(self):
return """
create table <model_identifier> (
id integer not null,
id int not null,
"from" varchar not null,
date_day varchar
) ;
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from unittest import TestCase, mock

from dbt.config.project import PartialProject
from hologram import ValidationError
from dbt.dataclass_schema import ValidationError


def normalize(path):
Expand Down Expand Up @@ -156,6 +156,7 @@ def assert_fails_validation(self, dct, cls=None):
cls = self.ContractType

with self.assertRaises(ValidationError):
cls.validate(dct)
cls.from_dict(dct)


Expand Down

0 comments on commit 3b6dbf2

Please sign in to comment.