[sql] Fixing datetime SQL literal (#8464)

This commit is contained in:
John Bodley
2019-10-29 23:24:48 -07:00
committed by GitHub
parent 7afda6e4f5
commit 0a3b121244
33 changed files with 436 additions and 82 deletions

View File

@@ -439,15 +439,15 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
db.session.commit()
@classmethod
def convert_dttm(cls, target_type: str, dttm: datetime) -> str:
def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
"""
Convert DateTime object to sql expression
Convert Python datetime object to a SQL expression
:param target_type: Target type of expression
:param dttm: DateTime object
:return: SQL expression
:param target_type: The target type of expression
:param dttm: The datetime object
:return: The SQL expression
"""
return "'{}'".format(dttm.strftime("%Y-%m-%d %H:%M:%S"))
return None
@classmethod
def get_all_datasource_names(