john-bodley commented on a change in pull request #8464: [sql] Fixing datetime
SQL literal
URL:
https://github.com/apache/incubator-superset/pull/8464#discussion_r339848340
##########
File path: superset/db_engine_specs/base.py
##########
@@ -439,15 +439,15 @@ def _allowed_file(filename: str) -> bool:
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"))
Review comment:
This is now handled in `dttm_sql_literal` as we need to determine if the
python-date-format logic needs to be invoked.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]