Fix type errors caught by ty check

- Add type: ignore comments for external library type stub limitations
  (csv.reader, click.progressbar, IOBase.name, Callable.__name__)
- Change Iterable to Sequence for SQL where_args parameters
- Use db.table() instead of db[name] for proper Table return type
- Fix rebuild_fts return type from None to Table
- Update test_tracer to expect fewer queries (optimization side effect)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Simon Willison 2025-12-16 21:38:54 -08:00
commit 9b1daa346a
4 changed files with 19 additions and 20 deletions

View file

@ -50,7 +50,7 @@ def test_with_tracer():
with db.tracer(tracer):
list(dogs.search("Cleopaws"))
assert len(collected) == 5
assert len(collected) == 4
assert collected == [
(
"SELECT name FROM sqlite_master\n"
@ -70,7 +70,6 @@ def test_with_tracer():
},
),
("select name from sqlite_master where type = 'view'", None),
("select name from sqlite_master where type = 'view'", None),
("select sql from sqlite_master where name = ?", ("dogs_fts",)),
(
'with "original" as (\n'
@ -94,4 +93,4 @@ def test_with_tracer():
# Outside the with block collected should not be appended to
dogs.insert({"name": "Cleopaws"})
assert len(collected) == 5
assert len(collected) == 4