Skip to content

Commit

Permalink
Remove import of FieldEncoder from hologram (#592)
Browse files Browse the repository at this point in the history
* Remove import of FieldEncoder from hologram

* Update Fixes-20230830-164611.yaml

---------

Co-authored-by: colin-rogers-dbt <[email protected]>
(cherry picked from commit e95685f)
  • Loading branch information
gshank authored and github-actions[bot] committed Sep 14, 2023
1 parent 8d31620 commit 7bc071d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20230830-164611.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix to support removal of hologram, remove unused IAMDuration encoder
time: 2023-08-30T16:46:11.83975-04:00
custom:
Author: gshank
Issue: "591"
16 changes: 2 additions & 14 deletions dbt/adapters/redshift/connections.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
from multiprocessing import Lock
from contextlib import contextmanager
from typing import NewType, Tuple, Union, Optional, List
from typing import Tuple, Union, Optional, List
from dataclasses import dataclass, field

import agate
Expand All @@ -12,7 +12,7 @@
from dbt.adapters.sql import SQLConnectionManager
from dbt.contracts.connection import AdapterResponse, Connection, Credentials
from dbt.contracts.util import Replaceable
from dbt.dataclass_schema import FieldEncoder, dbtClassMixin, StrEnum, ValidationError
from dbt.dataclass_schema import dbtClassMixin, StrEnum, ValidationError
from dbt.events import AdapterLogger
from dbt.exceptions import DbtRuntimeError, CompilationError
import dbt.flags
Expand All @@ -36,18 +36,6 @@ def get_message(self) -> str:
drop_lock: Lock = dbt.flags.MP_CONTEXT.Lock() # type: ignore


IAMDuration = NewType("IAMDuration", int)


class IAMDurationEncoder(FieldEncoder):
@property
def json_schema(self):
return {"type": "integer", "minimum": 0, "maximum": 65535}


dbtClassMixin.register_field_encoders({IAMDuration: IAMDurationEncoder()})


class RedshiftConnectionMethod(StrEnum):
DATABASE = "database"
IAM = "iam"
Expand Down

0 comments on commit 7bc071d

Please sign in to comment.