bito-code-review[bot] commented on PR #44805:
URL: https://github.com/apache/superset/pull/44805#issuecomment-5895213659
<!-- Bito Reply -->
The flagged issue is correct. The current implementation in
`superset/db_engine_specs/sqlite.py` correctly handles midnight for `DATE`
columns by returning a bare date string, but it does not explicitly handle
non-midnight times for `DATE` columns, which may lead to unexpected behavior
depending on how the database interprets the literal.
To resolve this, you should ensure that non-midnight times for `DATE`
columns are formatted consistently with the database's expectations. The
current implementation already includes a fallback that handles `types.Date` in
the second `if` block, which should produce the expected ISO format for
non-midnight times.
Regarding other comments on this PR, I have checked the available review
comments and there are no additional comments to address at this time.
**superset/db_engine_specs/sqlite.py**
```
if isinstance(sqla_type, types.Date) and dttm.time() == time.min:
return f"'{dttm.date().isoformat()}'"
if isinstance(sqla_type, (types.String, types.Date, types.DateTime)):
return f"'{dttm.isoformat(sep=" ", timespec="seconds")}'"
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]