Selaa lähdekoodia

fix: converting datepart and timepart to strings for Combinedatetime

version-14
Aradhya 2 vuotta sitten
vanhempi
commit
1ebda943a6
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. +4
    -0
      frappe/query_builder/functions.py

+ 4
- 0
frappe/query_builder/functions.py Näytä tiedosto

@@ -1,3 +1,4 @@
from datetime import time
from enum import Enum

from pypika.functions import *
@@ -35,6 +36,9 @@ Match = ImportMapper({db_type_is.MARIADB: MATCH, db_type_is.POSTGRES: TO_TSVECTO

class _PostgresTimestamp(ArithmeticExpression):
def __init__(self, datepart, timepart, alias=None):
"""Postgres would need both datepart and timepart to be a string for concatenation"""
if isinstance(timepart, time) or isinstance(datepart, time):
timepart, datepart = str(timepart), str(datepart)
if isinstance(datepart, str):
datepart = Cast(datepart, "date")
if isinstance(timepart, str):


Ladataan…
Peruuta
Tallenna