Skip to content

Commit 5c15db9

Browse files
simonwclaude
andcommitted
Fix remaining type errors in cli.py
- Add typing import and type annotations for dict kwargs - Use db.table() instead of db[] for extract command - Fix missing str() conversion for exception 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 29842be commit 5c15db9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sqlite_utils/cli.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import base64
2+
from typing import Any
23
import click
34
from click_default_group import DefaultGroup # type: ignore
45
from datetime import datetime, timezone
@@ -705,7 +706,7 @@ def enable_fts(
705706
replace=replace,
706707
)
707708
except OperationalError as ex:
708-
raise click.ClickException(ex)
709+
raise click.ClickException(str(ex))
709710

710711

711712
@cli.command(name="populate-fts")
@@ -1042,7 +1043,7 @@ def insert_upsert_implementation(
10421043
)
10431044
else:
10441045
dialect = "excel-tab" if tsv else "excel"
1045-
csv_reader_args = {"dialect": dialect}
1046+
csv_reader_args: dict[str, Any] = {"dialect": dialect}
10461047
if delimiter:
10471048
csv_reader_args["delimiter"] = delimiter
10481049
if quotechar:
@@ -2656,13 +2657,13 @@ def extract(
26562657
db = sqlite_utils.Database(path)
26572658
_register_db_for_cleanup(db)
26582659
_load_extensions(db, load_extension)
2659-
kwargs = dict(
2660+
kwargs: dict[str, Any] = dict(
26602661
columns=columns,
26612662
table=other_table,
26622663
fk_column=fk_column,
26632664
rename=dict(rename),
26642665
)
2665-
db[table].extract(**kwargs)
2666+
db.table(table).extract(**kwargs)
26662667

26672668

26682669
@cli.command(name="insert-files")

0 commit comments

Comments
 (0)