Skip to content

Commit

Permalink
fix: correctly handle unbound varchar case instead of defaulting to
Browse files Browse the repository at this point in the history
varchar(256)
  • Loading branch information
kalvinnchau committed Dec 9, 2022
1 parent 0aa3af4 commit 5be7fcc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dbt/adapters/trino/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ class TrinoColumn(Column):
"INTEGER": "INT",
}

@property
def data_type(self):
# when varchar has no defined size, default to unbound varchar
# the super().data_type defaults to varchar(256)
if self.dtype.lower() == "varchar" and self.char_size is None:
return self.dtype

return super().data_type

@classmethod
def string_type(cls, size: int) -> str:
return "varchar({})".format(size)
Expand Down

0 comments on commit 5be7fcc

Please sign in to comment.