Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20230301-113553.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Implemented data_type_code_to_name for redshift
time: 2023-03-01T11:35:53.98885-05:00
custom:
Author: peterallenwebb
Issue: "319"
5 changes: 5 additions & 0 deletions dbt/adapters/redshift/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from dbt.helper_types import Port
from redshift_connector import OperationalError, DatabaseError, DataError
from redshift_connector.utils.oids import get_datatype_name

logger = AdapterLogger("Redshift")

Expand Down Expand Up @@ -279,3 +280,7 @@ def add_query(self, sql, auto_begin=True, bindings=None, abridge_sql_log=False):
@classmethod
def get_credentials(cls, credentials):
return credentials

@classmethod
def data_type_code_to_name(cls, type_code: int) -> str:
return get_datatype_name(type_code)
6 changes: 3 additions & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# install latest changes in dbt-core + dbt-postgres
# TODO: how to switch from HEAD to x.y.latest branches after minor releases?
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-postgres&subdirectory=plugins/postgres
git+https://github.com/dbt-labs/dbt-core.git@e8399cd39561b648d460d4fc227e7e0a6eb8c612#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git@e8399cd39561b648d460d4fc227e7e0a6eb8c612#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-core.git@e8399cd39561b648d460d4fc227e7e0a6eb8c612#egg=dbt-postgres&subdirectory=plugins/postgres

black~=22.8.0
click~=8.1.3
Expand Down
7 changes: 6 additions & 1 deletion tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
"""

class TestRedshiftConstraintsColumnsEqual(BaseConstraintsColumnsEqual):
pass
@pytest.fixture
def int_array_type(self):
return "INTEGER_ARRAY"

@pytest.fixture
def string_array_type(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixture and the int_array_type one shouldn't be necessary anymore! BaseConstraintsColumnsEqual doesn't do anything with them.

return "TEXT_ARRAY"

class TestRedshiftConstraintsRuntimeEnforcement(BaseConstraintsRuntimeEnforcement):
@pytest.fixture(scope="class")
Expand Down