bito-code-review[bot] commented on code in PR #44805:
URL: https://github.com/apache/superset/pull/44805#discussion_r4136558705


##########
superset/db_engine_specs/sqlite.py:
##########
@@ -164,8 +164,19 @@ def get_temporal_column_shift_expr(
     def convert_dttm(
         cls, target_type: str, dttm: datetime, db_extra: dict[str, Any] | None 
= None
     ) -> str | None:
+        """
+        Write midnight as a bare date for DATE columns.
+
+        SQLite has no date type, so a DATE column usually holds text such as
+        ``2026-09-20`` and is compared as text. ``'2026-09-20 00:00:00'`` sorts
+        after the day it starts, so a time filter on a DATE column would be 
one day
+        off. Any other time keeps its time part, which sorts between two days, 
as a
+        comparison of dates should.
+        """
         sqla_type = cls.get_sqla_column_type(target_type)
-        if isinstance(sqla_type, (types.String, types.DateTime)):
+        if isinstance(sqla_type, types.Date) and dttm.time() == time.min:

Review Comment:
   <!-- Bito Reply -->
   The suggestion provided by Bito is not necessary in this context. As you 
noted, SQLAlchemy's `DateTime` and `TIMESTAMP` types do not subclass `Date`, so 
the existing check `isinstance(sqla_type, types.Date)` correctly excludes them. 
The current implementation already handles the midnight cases as expected by 
the tests.



-- 
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]

Reply via email to