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}" )