mirror of
https://github.com/apache/superset.git
synced 2026-05-21 15:55:10 +00:00
Applies the three suggestions from #34513 review: 1. Drop the dead `isinstance(v, (int, float))` branch. psycopg2 and psycopg3 always hand INTERVAL columns back as datetime.timedelta; the numeric branch was unreachable in practice and was creating false confidence in the tests covering it. 2. Move `_normalize_interval` from a `@staticmethod` on the class to a module-level function. The previous form required `INTERVAL: _normalize_interval.__func__ # type: ignore[attr-defined]` to extract the underlying function from the staticmethod descriptor inside the class body. Module-level lets `column_type_mutators` reference the function directly — no `__func__`, no suppress. 3. Add a `logger.warning(...)` to the defensive return-None path so a future driver surfacing something other than timedelta gets logged rather than silently dropped. Test updates: the numeric/bool assertions that exercised the removed branch now exercise the defensive return-None path instead (same expectations, but for the right reason).