Skip to content

Commit

Permalink
Merge pull request #1191 from brianhartsock/archive_character_columns
Browse files Browse the repository at this point in the history
Ensure character columns are treated as string types.
  • Loading branch information
drewbanin authored Dec 21, 2018
2 parents d7610a7 + b263ba7 commit 6004bdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def data_type(self):
return self.dtype

def is_string(self):
return self.dtype.lower() in ['text', 'character varying']
return self.dtype.lower() in ['text', 'character varying', 'character']

def is_numeric(self):
return self.dtype.lower() in ['numeric', 'number']
Expand Down
11 changes: 11 additions & 0 deletions test/unit/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

import dbt.schema

class TestStringType(unittest.TestCase):

def test__character_type(self):
col = dbt.schema.Column(
'fieldname',
'character',
char_size=10
)

self.assertEqual(col.data_type, 'character varying(10)')


class TestNumericType(unittest.TestCase):

Expand Down

0 comments on commit 6004bdf

Please sign in to comment.