Skip to content

Commit f8a557f

Browse files
committed
fixed default for column
1 parent d9257fb commit f8a557f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sqlalchemy_iris/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,9 @@ def get_column_specification(self, column, **kwargs):
477477
)
478478
)
479479

480-
if column.computed is not None:
481-
colspec.append(self.process(column.computed))
482-
default = self.get_column_default_string(column)
483-
if default is not None:
484-
colspec.append("DEFAULT " + default)
480+
default = self.get_column_default_string(column)
481+
if default is not None:
482+
colspec.append("DEFAULT " + default)
485483

486484
if not column.nullable:
487485
colspec.append("NOT NULL")
@@ -569,6 +567,8 @@ def result_processor(self, dialect, coltype):
569567
def process(value):
570568
if value is None:
571569
return None
570+
if isinstance(value, str) and '-' in value:
571+
return datetime.datetime.strptime(value, '%Y-%m-%d').date()
572572
horolog = int(value) + HOROLOG_ORDINAL
573573
return datetime.date.fromordinal(horolog)
574574

0 commit comments

Comments
 (0)