mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[sql] Fixing datetime SQL literal (#8464)
This commit is contained in:
@@ -75,11 +75,10 @@ class SqliteEngineSpec(BaseEngineSpec):
|
||||
raise Exception(f"Unsupported datasource_type: {datasource_type}")
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type: str, dttm: datetime) -> str:
|
||||
iso = dttm.isoformat().replace("T", " ")
|
||||
if "." not in iso:
|
||||
iso += ".000000"
|
||||
return "'{}'".format(iso)
|
||||
def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
|
||||
if target_type.upper() == "TEXT":
|
||||
return f"""'{dttm.isoformat(sep=" ", timespec="microseconds")}'"""
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def get_table_names(
|
||||
|
||||
Reference in New Issue
Block a user