Skip to content

Commit 07b64fe

Browse files
Aradhyadevelopmentforpeople
Aradhya
authored andcommitted
fix: converting datepart and timepart to strings for Combinedatetime
1 parent 227699e commit 07b64fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frappe/query_builder/functions.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import time
12
from enum import Enum
23

34
from pypika.functions import *
@@ -35,6 +36,9 @@ def __init__(self, term: str, time=None, alias=None):
3536

3637
class _PostgresTimestamp(ArithmeticExpression):
3738
def __init__(self, datepart, timepart, alias=None):
39+
"""Postgres would need both datepart and timepart to be a string for concatenation"""
40+
if isinstance(timepart, time) or isinstance(datepart, time):
41+
timepart, datepart = str(timepart), str(datepart)
3842
if isinstance(datepart, str):
3943
datepart = Cast(datepart, "date")
4044
if isinstance(timepart, str):

0 commit comments

Comments
 (0)