Skip to content

Commit 9fa6d04

Browse files
committed
fixed issue with horolog property types %Date,%Time
1 parent 152e57d commit 9fa6d04

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

requirements-iris.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.7.6/intersystems_iris-3.7.6-py3-none-any.whl
1+
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.7.7/intersystems_iris-3.7.7-py3-none-any.whl

sqlalchemy_iris/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def result_processor(self, dialect, coltype):
4646
def process(value):
4747
if value is None:
4848
return None
49+
if isinstance(value, datetime.date):
50+
return value
4951
if isinstance(value, str) and "-" in value[1:]:
5052
return datetime.datetime.strptime(value, "%Y-%m-%d").date()
5153
horolog = int(value) + HOROLOG_ORDINAL
@@ -91,6 +93,8 @@ def process(value):
9193

9294
def result_processor(self, dialect, coltype):
9395
def process(value):
96+
if isinstance(value, datetime.datetime):
97+
return value
9498
if isinstance(value, str):
9599
if "." not in value:
96100
value += ".0"
@@ -111,6 +115,8 @@ def process(value):
111115

112116
def result_processor(self, dialect, coltype):
113117
def process(value):
118+
if isinstance(value, datetime.time):
119+
return value
114120
if isinstance(value, str):
115121
if "." not in value:
116122
value += ".0"

0 commit comments

Comments
 (0)