Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 44cf693

Browse files
committed
Fixes for redshift and presto
1 parent cda5180 commit 44cf693

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

sqeleton/databases/presto.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def set_timezone_to_utc(self) -> str:
141141
def current_timestamp(self) -> str:
142142
return "current_timestamp"
143143

144+
def type_repr(self, t) -> str:
145+
if isinstance(t, TimestampTZ):
146+
return f"timestamp with time zone"
147+
return super().type_repr(t)
148+
144149

145150
class Presto(Database):
146151
dialect = Dialect()

sqeleton/databases/redshift.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import List, Dict
2-
from ..abcs.database_types import Float, TemporalType, FractionalType, DbPath
2+
from ..abcs.database_types import Float, TemporalType, FractionalType, DbPath, TimestampTZ
33
from ..abcs.mixins import AbstractMixin_MD5
44
from .postgresql import (
55
PostgreSQL,
@@ -57,6 +57,11 @@ def concat(self, items: List[str]) -> str:
5757
def is_distinct_from(self, a: str, b: str) -> str:
5858
return f"({a} IS NULL != {b} IS NULL) OR ({a}!={b})"
5959

60+
def type_repr(self, t) -> str:
61+
if isinstance(t, TimestampTZ):
62+
return f"timestamptz"
63+
return super().type_repr(t)
64+
6065

6166
class Redshift(PostgreSQL):
6267
dialect = Dialect()

0 commit comments

Comments
 (0)