From a3cc2e7b24ca1ddddf0168fce1e718123744924f Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 12 Jul 2026 20:09:22 -0700 Subject: [PATCH] fix: annotate remaining new locals per type-hint rule Co-Authored-By: Claude Opus 4.8 --- superset/models/helpers.py | 2 +- tests/unit_tests/models/helpers_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/models/helpers.py b/superset/models/helpers.py index f869d0e0cee..e9c1ecce9fd 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -3886,7 +3886,7 @@ class ExploreMixin: # pylint: disable=too-many-public-methods }: # Native UUID columns report GenericDataType.STRING but # reject LIKE/ILIKE without a cast (see issue #41795) - needs_string_cast_for_like = ( + needs_string_cast_for_like: bool = ( target_generic_type != GenericDataType.STRING or is_uuid_native_type(col_type) ) diff --git a/tests/unit_tests/models/helpers_test.py b/tests/unit_tests/models/helpers_test.py index 0094475b50d..e340ff8e8a9 100644 --- a/tests/unit_tests/models/helpers_test.py +++ b/tests/unit_tests/models/helpers_test.py @@ -3761,7 +3761,7 @@ def test_like_filter_on_uuid_column_casts_to_string( is_timeseries=False, orderby=[], ) - whereclause = result.sqla_query.whereclause + whereclause: ColumnElement = result.sqla_query.whereclause assert any(isinstance(node, Cast) for node in iterate(whereclause)), ( f"Expected a Cast node in the filter expression: {whereclause}" )