fix(sql-lab): address minor type-hint nits from codeant review

Add explicit type annotations for the `blocks` list in sql_lab.py and
the mock/cursor test variables, and replace an untyped lambda mutator
with a typed helper to keep MUTATE_AFTER_SPLIT type-hint coverage
consistent with the rest of the PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Evan
2026-07-14 08:44:34 -07:00
parent bf85efdbb7
commit ed510633ce
3 changed files with 19 additions and 6 deletions

View File

@@ -77,6 +77,11 @@ def mock_query() -> MagicMock:
return query
def _passthrough_mutate_sql_based_on_config(sql: str, **kwargs: Any) -> str:
"""Mirror the real `Database.mutate_sql_based_on_config` no-op default."""
return sql
@pytest.fixture
def mock_database() -> MagicMock:
"""Create a mock Database."""
@@ -97,7 +102,9 @@ def mock_database() -> MagicMock:
# Mirrors the real `Database.mutate_sql_based_on_config` default (no-op
# when no `SQL_QUERY_MUTATOR` is configured), so SQL parsed from its
# return value stays valid instead of an un-parseable `MagicMock`.
database.mutate_sql_based_on_config = MagicMock(side_effect=lambda sql, **kw: sql)
database.mutate_sql_based_on_config = MagicMock(
side_effect=_passthrough_mutate_sql_based_on_config
)
return database