Skip to content

Instantly share code, notes, and snippets.

@simonw

simonw/ty.md Secret

Last active May 7, 2025 23:30
Show Gist options
  • Save simonw/a13e1720b03e23783ae668eca7f6f12a to your computer and use it in GitHub Desktop.
Save simonw/a13e1720b03e23783ae668eca7f6f12a to your computer and use it in GitHub Desktop.

ty against sqlite-utils

I ran this:

cd /tmp
git clone https://github.com/simonw/sqlite-utils
cd sqlite-utils

uvx ty check

Output:

error: lint:unresolved-import: Cannot resolve imported module `beanbag_docutils.sphinx.ext.github`
 --> docs/conf.py:5:6
  |
4 | from subprocess import Popen, PIPE
5 | from beanbag_docutils.sphinx.ext.github import github_linkcode_resolve
  |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 |
7 | # This file is execfile()d with the current directory set to its
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `read` on type `IO[Unknown] | None` is possibly unbound
  --> docs/conf.py:82:15
   |
80 | # The short X.Y version.
81 | pipe = Popen("git describe --tags --always", stdout=PIPE, shell=True)
82 | git_version = pipe.stdout.read().decode("utf8")
   |               ^^^^^^^^^^^^^^^^
83 |
84 | if git_version:
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
 --> docs/tutorial.ipynb:5:1
  |
3 | db = sqlite_utils.Database(memory=True)
4 | db
5 | db["creatures"].insert_all([{
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
6 |     "name": "Cleo",
7 |     "species": "dog",
  |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:33:1
   |
31 | table
32 | db.tables
33 | db["creatures"].insert_all([{
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
34 |     "id": 1,
35 |     "name": "Cleo",
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:50:1
   |
48 | }], pk="id")
49 | print(table.schema)
50 | table.insert_all([{
   | ^^^^^^^^^^^^^^^^
51 |     "id": 4,
52 |     "name": "Azi",
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:62:1
   |
60 | }], pk="id")
61 | list(table.rows)
62 | table.insert({"name": "Blue", "species": "chicken", "age": 0.9})
   | ^^^^^^^^^^^^
63 | table.last_pk
64 | list(table.rows)
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `last_pk` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:63:1
   |
61 | list(table.rows)
62 | table.insert({"name": "Blue", "species": "chicken", "age": 0.9})
63 | table.last_pk
   | ^^^^^^^^^^^^^
64 | list(table.rows)
65 | table.insert({"id": 6, "name": "Red", "species": "chicken", "age": 0.9})
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:65:1
   |
63 | table.last_pk
64 | list(table.rows)
65 | table.insert({"id": 6, "name": "Red", "species": "chicken", "age": 0.9})
   | ^^^^^^^^^^^^
66 | table.insert({"id": 6, "name": "Red", "species": "chicken", "age": 0.9}, replace=True)
67 | list(table.rows)
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:66:1
   |
64 | list(table.rows)
65 | table.insert({"id": 6, "name": "Red", "species": "chicken", "age": 0.9})
66 | table.insert({"id": 6, "name": "Red", "species": "chicken", "age": 0.9}, replace=True)
   | ^^^^^^^^^^^^
67 | list(table.rows)
68 | table.update(6, {"name": "Blue"})
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `update` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:68:1
   |
66 | table.insert({"id": 6, "name": "Red", "species": "chicken", "age": 0.9}, replace=True)
67 | list(table.rows)
68 | table.update(6, {"name": "Blue"})
   | ^^^^^^^^^^^^
69 | list(db.query("select * from creatures where id = ?", [6]))
70 | table.extract("species")
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `extract` on type `Table | View` is possibly unbound
  --> docs/tutorial.ipynb:70:1
   |
68 | table.update(6, {"name": "Blue"})
69 | list(db.query("select * from creatures where id = ?", [6]))
70 | table.extract("species")
   | ^^^^^^^^^^^^^
71 | db.tables
72 | print(db["creatures"].schema)
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `setuptools`
 --> setup.py:1:6
  |
1 | from setuptools import setup, find_packages
  |      ^^^^^^^^^^
2 | import io
3 | import os
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click`
 --> sqlite_utils/cli.py:2:8
  |
1 | import base64
2 | import click
  |        ^^^^^
3 | from click_default_group import DefaultGroup  # type: ignore
4 | from datetime import datetime
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `tabulate`
  --> sqlite_utils/cli.py:22:8
   |
20 | import sys
21 | import csv as csv_std
22 | import tabulate
   |        ^^^^^^^^
23 | from .utils import (
24 |     OperationalError,
   |
info: `lint:unresolved-import` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
  --> sqlite_utils/cli.py:39:20
   |
39 | CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 |
41 | VALID_COLUMN_TYPES = ("INTEGER", "TEXT", "FLOAT", "BLOB")
   |
info: `lint:no-matching-overload` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> sqlite_utils/cli.py:307:10
    |
305 |     if not tables:
306 |         tables = db.table_names(fts4=True) + db.table_names(fts5=True)
307 |     with db.conn:
    |          ^^^^^^^
308 |         for table in tables:
309 |             db[table].optimize()
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `optimize` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:309:13
    |
307 |     with db.conn:
308 |         for table in tables:
309 |             db[table].optimize()
    |             ^^^^^^^^^^^^^^^^^^
310 |     if not no_vacuum:
311 |         db.vacuum()
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> sqlite_utils/cli.py:334:10
    |
332 |     if not tables:
333 |         tables = db.table_names(fts4=True) + db.table_names(fts5=True)
334 |     with db.conn:
    |          ^^^^^^^
335 |         for table in tables:
336 |             db[table].rebuild_fts()
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `rebuild_fts` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:336:13
    |
334 |     with db.conn:
335 |         for table in tables:
336 |             db[table].rebuild_fts()
    |             ^^^^^^^^^^^^^^^^^^^^^
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `add_column` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:461:9
    |
459 |     _load_extensions(db, load_extension)
460 |     try:
461 |         db[table].add_column(
    |         ^^^^^^^^^^^^^^^^^^^^
462 |             col_name, col_type, fk=fk, fk_col=fk_col, not_null_default=not_null_default
463 |         )
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `add_foreign_key` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:498:9
    |
496 |     _load_extensions(db, load_extension)
497 |     try:
498 |         db[table].add_foreign_key(column, other_table, other_column, ignore=ignore)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
499 |     except AlterError as e:
500 |         raise click.ClickException(e)
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:605:5
    |
603 |             col = DescIndex(col[1:])
604 |         columns.append(col)
605 |     db[table].create_index(
    |     ^^^^^^^^^^^^^^^^^^^^^^
606 |         columns,
607 |         index_name=name,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `populate_fts` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:687:5
    |
685 |     db = sqlite_utils.Database(path)
686 |     _load_extensions(db, load_extension)
687 |     db[table].populate_fts(column)
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `disable_fts` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:708:5
    |
706 |     db = sqlite_utils.Database(path)
707 |     _load_extensions(db, load_extension)
708 |     db[table].disable_fts()
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `enable_counts` on type `Table | View` is possibly unbound
   --> sqlite_utils/cli.py:781:13
    |
779 |             raise click.ClickException("Invalid tables: {}".format(bad_tables))
780 |         for table in tables:
781 |             db[table].enable_counts()
    |             ^^^^^^^^^^^^^^^^^^^^^^^
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `peek` on type `None | BufferedReader` is possibly unbound
   --> sqlite_utils/cli.py:985:31
    |
983 |             if sniff:
984 |                 # Read first 2048 bytes and use that to detect
985 |                 first_bytes = sniff_buffer.peek(2048)
    |                               ^^^^^^^^^^^^^^^^^
986 |                 dialect = csv_std.Sniffer().sniff(
987 |                     first_bytes.decode(encoding, "ignore")
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-attribute: Type `<module 'json'>` has no attribute `decoder`
    --> sqlite_utils/cli.py:1025:20
     |
1023 |                     if isinstance(docs, dict):
1024 |                         docs = [docs]
1025 |             except json.decoder.JSONDecodeError as ex:
     |                    ^^^^^^^^^^^^
1026 |                 raise click.ClickException(
1027 |                     "Invalid JSON - use --csv for CSV or --tsv for TSV files\n\nJSON error: {}".format(
     |
info: `lint:unresolved-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> sqlite_utils/cli.py:1089:22
     |
1087 |                 doc_chunks = [docs]
1088 |             for doc_chunk in doc_chunks:
1089 |                 with db.conn:
     |                      ^^^^^^^
1090 |                     db.conn.cursor().executemany(bulk_sql, doc_chunk)
1091 |             return
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `cursor` on type `Unknown | Connection | (Unknown & ~str & ~Path) | None` is possibly unbound
    --> sqlite_utils/cli.py:1090:21
     |
1088 |             for doc_chunk in doc_chunks:
1089 |                 with db.conn:
1090 |                     db.conn.cursor().executemany(bulk_sql, doc_chunk)
     |                     ^^^^^^^^^^^^^^
1091 |             return
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:1094:13
     |
1093 |         try:
1094 |             db[table].insert_all(
     |             ^^^^^^^^^^^^^^^^^^^^
1095 |                 docs, pk=pk, batch_size=batch_size, alter=alter, **extra_kwargs
1096 |             )
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `transform` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:1119:13
     |
1117 |                 raise
1118 |         if tracker is not None:
1119 |             db[table].transform(types=tracker.types)
     |             ^^^^^^^^^^^^^^^^^^^
1120 |
1121 |         # Clean up open file-like objects
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:1573:5
     |
1571 |                 )
1572 |             )
1573 |     db[table].create(
     |     ^^^^^^^^^^^^^^^^
1574 |         coltypes,
1575 |         pk=pks[0] if len(pks) == 1 else pks,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `duplicate` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:1603:9
     |
1601 |     _load_extensions(db, load_extension)
1602 |     try:
1603 |         db[table].duplicate(new_table)
     |         ^^^^^^^^^^^^^^^^^^^
1604 |     except NoTable:
1605 |         if not ignore:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-argument-type: Argument to this function is incorrect
    --> sqlite_utils/cli.py:1943:44
     |
1941 |             stem_counts[stem] = stem_counts.get(stem, 1) + 1
1942 |             fp = file_path.open("rb")
1943 |         rows, format_used = rows_from_file(fp, format=format, encoding=encoding)
     |                                            ^^ Expected `BinaryIO`, found `BinaryIO | @Todo | TextIOWrapper[_WrappedBuffer]`
1944 |         tracker = None
1945 |         if format_used in (Format.CSV, Format.TSV) and not no_detect_types:
     |
info: Function defined here
   --> sqlite_utils/utils.py:236:5
    |
236 | def rows_from_file(
    |     ^^^^^^^^^^^^^^
237 |     fp: BinaryIO,
    |     ------------ Parameter declared here
238 |     format: Optional[Format] = None,
239 |     dialect: Optional[Type[csv.Dialect]] = None,
    |
info: `lint:invalid-argument-type` is enabled by default

error: lint:invalid-argument-type: Argument to this function is incorrect
    --> sqlite_utils/cli.py:1943:44
     |
1941 |             stem_counts[stem] = stem_counts.get(stem, 1) + 1
1942 |             fp = file_path.open("rb")
1943 |         rows, format_used = rows_from_file(fp, format=format, encoding=encoding)
     |                                            ^^ Expected `BinaryIO`, found `BinaryIO | @Todo | TextIOWrapper[_WrappedBuffer]`
1944 |         tracker = None
1945 |         if format_used in (Format.CSV, Format.TSV) and not no_detect_types:
     |
info: Function defined here
   --> sqlite_utils/utils.py:236:5
    |
236 | def rows_from_file(
    |     ^^^^^^^^^^^^^^
237 |     fp: BinaryIO,
    |     ------------ Parameter declared here
238 |     format: Optional[Format] = None,
239 |     dialect: Optional[Type[csv.Dialect]] = None,
    |
info: `lint:invalid-argument-type` is enabled by default

error: lint:invalid-argument-type: Argument to this function is incorrect
    --> sqlite_utils/cli.py:1943:44
     |
1941 |             stem_counts[stem] = stem_counts.get(stem, 1) + 1
1942 |             fp = file_path.open("rb")
1943 |         rows, format_used = rows_from_file(fp, format=format, encoding=encoding)
     |                                            ^^ Expected `BinaryIO`, found `BinaryIO | @Todo | TextIOWrapper[_WrappedBuffer]`
1944 |         tracker = None
1945 |         if format_used in (Format.CSV, Format.TSV) and not no_detect_types:
     |
info: Function defined here
   --> sqlite_utils/utils.py:236:5
    |
236 | def rows_from_file(
    |     ^^^^^^^^^^^^^^
237 |     fp: BinaryIO,
    |     ------------ Parameter declared here
238 |     format: Optional[Format] = None,
239 |     dialect: Optional[Type[csv.Dialect]] = None,
    |
info: `lint:invalid-argument-type` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:1951:9
     |
1949 |             rows = (_flatten(row) for row in rows)
1950 |
1951 |         db[file_table].insert_all(rows, alter=True)
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^
1952 |         if tracker is not None:
1953 |             db[file_table].transform(types=tracker.types)
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `transform` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:1953:13
     |
1951 |         db[file_table].insert_all(rows, alter=True)
1952 |         if tracker is not None:
1953 |             db[file_table].transform(types=tracker.types)
     |             ^^^^^^^^^^^^^^^^^^^^^^^^
1954 |         # Add convenient t / t1 / t2 views
1955 |         view_names = ["t{}".format(i + 1)]
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `fetchone` on type `Unknown | list` is possibly unbound
    --> sqlite_utils/cli.py:2039:20
     |
2037 |             headers = [c[0] for c in cursor.description]
2038 |         if raw:
2039 |             data = cursor.fetchone()[0]
     |                    ^^^^^^^^^^^^^^^
2040 |             if isinstance(data, bytes):
2041 |                 sys.stdout.buffer.write(data)
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:2122:12
     |
2120 |     if not table_obj.exists():
2121 |         raise click.ClickException("Table '{}' does not exist".format(dbtable))
2122 |     if not table_obj.detect_fts():
     |            ^^^^^^^^^^^^^^^^^^^^
2123 |         raise click.ClickException(
2124 |             "Table '{}' is not configured for full-text search".format(dbtable)
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `search_sql` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:2134:11
     |
2132 |                     "Table '{}' has no column '{}".format(dbtable, c)
2133 |                 )
2134 |     sql = table_obj.search_sql(columns=column, order_by=order, limit=limit)
     |           ^^^^^^^^^^^^^^^^^^^^
2135 |     if show_sql:
2136 |         click.echo(sql)
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `transform_sql` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:2523:21
     |
2522 |     if sql:
2523 |         for line in db[table].transform_sql(**kwargs):
     |                     ^^^^^^^^^^^^^^^^^^^^^^^
2524 |             click.echo(line)
2525 |     else:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `transform` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:2526:9
     |
2524 |             click.echo(line)
2525 |     else:
2526 |         db[table].transform(**kwargs)
     |         ^^^^^^^^^^^^^^^^^^^
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
    --> sqlite_utils/cli.py:2566:14
     |
2564 |       db = sqlite_utils.Database(path)
2565 |       _load_extensions(db, load_extension)
2566 |       kwargs = dict(
     |  ______________^
2567 | |         columns=columns,
2568 | |         table=other_table,
2569 | |         fk_column=fk_column,
2570 | |         rename=dict(rename),
2571 | |     )
     | |_____^
2572 |       db[table].extract(**kwargs)
     |
info: `lint:no-matching-overload` is enabled by default

error: lint:missing-argument: No argument provided for required parameter `columns` of bound method `extract`
    --> sqlite_utils/cli.py:2572:5
     |
2570 |         rename=dict(rename),
2571 |     )
2572 |     db[table].extract(**kwargs)
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
info: `lint:missing-argument` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `extract` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:2572:5
     |
2570 |         rename=dict(rename),
2571 |     )
2572 |     db[table].extract(**kwargs)
     |     ^^^^^^^^^^^^^^^^^
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
    --> sqlite_utils/cli.py:2674:27
     |
2672 |                         raise UnicodeDecodeErrorForPath(e, resolved)
2673 |
2674 |                 lookups = dict(FILE_COLUMNS, content_text=_content_text)
     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2675 |                 if path == "-":
2676 |                     stdin_data = sys.stdin.buffer.read()
     |
info: `lint:no-matching-overload` is enabled by default

warning: lint:possibly-unresolved-reference: Name `stdin_data` used when possibly not defined
    --> sqlite_utils/cli.py:2681:46
     |
2679 |                         "name": lambda p: name or "-",
2680 |                         "path": lambda p: name or "-",
2681 |                         "content": lambda p: stdin_data,
     |                                              ^^^^^^^^^^
2682 |                         "content_text": lambda p: stdin_data.decode(
2683 |                             encoding or "utf-8"
     |
info: `lint:possibly-unresolved-reference` is enabled by default

warning: lint:possibly-unresolved-reference: Name `stdin_data` used when possibly not defined
    --> sqlite_utils/cli.py:2682:51
     |
2680 |                         "path": lambda p: name or "-",
2681 |                         "content": lambda p: stdin_data,
2682 |                         "content_text": lambda p: stdin_data.decode(
     |                                                   ^^^^^^^^^^
2683 |                             encoding or "utf-8"
2684 |                         ),
     |
info: `lint:possibly-unresolved-reference` is enabled by default

warning: lint:possibly-unresolved-reference: Name `stdin_data` used when possibly not defined
    --> sqlite_utils/cli.py:2685:60
     |
2683 |                             encoding or "utf-8"
2684 |                         ),
2685 |                         "sha256": lambda p: hashlib.sha256(stdin_data).hexdigest(),
     |                                                            ^^^^^^^^^^
2686 |                         "md5": lambda p: hashlib.md5(stdin_data).hexdigest(),
2687 |                         "size": lambda p: len(stdin_data),
     |
info: `lint:possibly-unresolved-reference` is enabled by default

warning: lint:possibly-unresolved-reference: Name `stdin_data` used when possibly not defined
    --> sqlite_utils/cli.py:2686:54
     |
2684 |                         ),
2685 |                         "sha256": lambda p: hashlib.sha256(stdin_data).hexdigest(),
2686 |                         "md5": lambda p: hashlib.md5(stdin_data).hexdigest(),
     |                                                      ^^^^^^^^^^
2687 |                         "size": lambda p: len(stdin_data),
2688 |                     }
     |
info: `lint:possibly-unresolved-reference` is enabled by default

warning: lint:possibly-unresolved-reference: Name `stdin_data` used when possibly not defined
    --> sqlite_utils/cli.py:2687:47
     |
2685 |                         "sha256": lambda p: hashlib.sha256(stdin_data).hexdigest(),
2686 |                         "md5": lambda p: hashlib.md5(stdin_data).hexdigest(),
2687 |                         "size": lambda p: len(stdin_data),
     |                                               ^^^^^^^^^^
2688 |                     }
2689 |                 for coldef in column:
     |
info: `lint:possibly-unresolved-reference` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> sqlite_utils/cli.py:2711:18
     |
2709 |         _load_extensions(db, load_extension)
2710 |         try:
2711 |             with db.conn:
     |                  ^^^^^^^
2712 |                 db[table].insert_all(
2713 |                     to_insert(),
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:2712:17
     |
2710 |         try:
2711 |             with db.conn:
2712 |                 db[table].insert_all(
     |                 ^^^^^^^^^^^^^^^^^^^^
2713 |                     to_insert(),
2714 |                     pk=pks[0] if len(pks) == 1 else pks,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_function` on type `Unknown | Connection | (Unknown & ~str & ~Path) | None` is possibly unbound
    --> sqlite_utils/cli.py:2995:9
     |
2993 |                 return fn(v) if v else v
2994 |
2995 |         db.conn.create_function("preview_transform", 1, preview)
     |         ^^^^^^^^^^^^^^^^^^^^^^^
2996 |         sql = """
2997 |             select
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `execute` on type `Unknown | Connection | (Unknown & ~str & ~Path) | None` is possibly unbound
    --> sqlite_utils/cli.py:3006:20
     |
3004 |             where=" where {}".format(where) if where is not None else "",
3005 |         )
3006 |         for row in db.conn.execute(sql, where_args).fetchall():
     |                    ^^^^^^^^^^^^^^^
3007 |             click.echo(str(row[0]))
3008 |             click.echo(" --- becomes:")
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unresolved-reference: Name `fn_` used when possibly not defined
    --> sqlite_utils/cli.py:3023:28
     |
3021 |             def wrapped_fn(value):
3022 |                 try:
3023 |                     return fn_(value)
     |                            ^^^
3024 |                 except Exception as ex:
3025 |                     print("\nException raised, dropping into pdb...:", ex)
     |
info: `lint:possibly-unresolved-reference` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `convert` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:3031:13
     |
3029 |             fn = wrapped_fn
3030 |         try:
3031 |             db[table].convert(
     |             ^^^^^^^^^^^^^^^^^
3032 |                 columns,
3033 |                 fn,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `add_geometry_column` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:3121:8
     |
3119 |     db.init_spatialite()
3120 |
3121 |     if db[table].add_geometry_column(
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3122 |         column_name, geometry_type, srid, coord_dimension, not_null
3123 |     ):
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_spatial_index` on type `Table | View` is possibly unbound
    --> sqlite_utils/cli.py:3158:5
     |
3156 |         )
3157 |
3158 |     db[table].create_spatial_index(column_name)
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unsupported-operator: Operator `in` is not supported for types `str` and `None`, in comparing `Literal[":"]` with `@Todo | str | None`
    --> sqlite_utils/cli.py:3266:16
     |
3264 |             if ext == "spatialite" and not os.path.exists(ext):
3265 |                 ext = find_spatialite()
3266 |             if ":" in ext:
     |                ^^^^^^^^^^
3267 |                 path, _, entrypoint = ext.partition(":")
3268 |                 db.conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])
     |
info: `lint:unsupported-operator` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `partition` on type `@Todo | str | None` is possibly unbound
    --> sqlite_utils/cli.py:3267:39
     |
3265 |                 ext = find_spatialite()
3266 |             if ":" in ext:
3267 |                 path, _, entrypoint = ext.partition(":")
     |                                       ^^^^^^^^^^^^^
3268 |                 db.conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])
3269 |             else:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `partition` on type `@Todo | str | None` is possibly unbound
    --> sqlite_utils/cli.py:3267:39
     |
3265 |                 ext = find_spatialite()
3266 |             if ":" in ext:
3267 |                 path, _, entrypoint = ext.partition(":")
     |                                       ^^^^^^^^^^^^^
3268 |                 db.conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])
3269 |             else:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `partition` on type `@Todo | str | None` is possibly unbound
    --> sqlite_utils/cli.py:3267:39
     |
3265 |                 ext = find_spatialite()
3266 |             if ":" in ext:
3267 |                 path, _, entrypoint = ext.partition(":")
     |                                       ^^^^^^^^^^^^^
3268 |                 db.conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])
3269 |             else:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `partition` on type `@Todo | str | None` is possibly unbound
    --> sqlite_utils/cli.py:3267:39
     |
3265 |                 ext = find_spatialite()
3266 |             if ":" in ext:
3267 |                 path, _, entrypoint = ext.partition(":")
     |                                       ^^^^^^^^^^^^^
3268 |                 db.conn.execute("SELECT load_extension(?, ?)", [path, entrypoint])
3269 |             else:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `sqlite_dump`
  --> sqlite_utils/db.py:43:10
   |
42 | try:
43 |     from sqlite_dump import iterdump
   |          ^^^^^^^^^^^
44 | except ImportError:
45 |     iterdump = None
   |
info: `lint:unresolved-import` is enabled by default

warning: lint:unused-ignore-comment
  --> sqlite_utils/db.py:75:16
   |
73 |     import pandas as pd  # type: ignore
74 | except ImportError:
75 |     pd = None  # type: ignore
   |                ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
76 |
77 | try:
   |

warning: lint:unused-ignore-comment
  --> sqlite_utils/db.py:80:16
   |
78 |     import numpy as np  # type: ignore
79 | except ImportError:
80 |     np = None  # type: ignore
   |                ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
81 |
82 | Column = namedtuple(
   |

warning: lint:unused-ignore-comment
   --> sqlite_utils/db.py:235:57
    |
233 | # If pandas is available, add more types
234 | if pd:
235 |     COLUMN_TYPE_MAPPING.update({pd.Timestamp: "TEXT"})  # type: ignore
    |                                                         ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
    |

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
   --> sqlite_utils/db.py:470:47
    |
468 |                 try:
469 |                     self.conn.create_function(
470 |                         fn_name, arity, fn, **dict(kwargs, deterministic=True)
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471 |                     )
472 |                     registered = True
    |
info: `lint:no-matching-overload` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `index` on type `list | None` is possibly unbound
   --> sqlite_utils/db.py:898:24
    |
897 |             def sort_key(p):
898 |                 return column_order.index(p[0]) if p[0] in column_order else 999
    |                        ^^^^^^^^^^^^^^^^^^
899 |
900 |             column_items.sort(key=sort_key)
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unsupported-operator: Operator `in` is not supported for types `Unknown` and `None`, in comparing `Unknown` with `list | None`
   --> sqlite_utils/db.py:898:52
    |
897 |             def sort_key(p):
898 |                 return column_order.index(p[0]) if p[0] in column_order else 999
    |                                                    ^^^^^^^^^^^^^^^^^^^^
899 |
900 |             column_items.sort(key=sort_key)
    |
info: `lint:unsupported-operator` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
    --> sqlite_utils/db.py:1480:26
     |
1478 |       ):
1479 |           super().__init__(db, name)
1480 |           self._defaults = dict(
     |  __________________________^
1481 | |             pk=pk,
1482 | |             foreign_keys=foreign_keys,
1483 | |             column_order=column_order,
1484 | |             not_null=not_null,
1485 | |             defaults=defaults,
1486 | |             batch_size=batch_size,
1487 | |             hash_id=hash_id,
1488 | |             hash_id_columns=hash_id_columns,
1489 | |             alter=alter,
1490 | |             ignore=ignore,
1491 | |             replace=replace,
1492 | |             extracts=extracts,
1493 | |             conversions=conversions or {},
1494 | |             columns=columns,
1495 | |             strict=strict,
1496 | |         )
     | |_________^
1497 |
1498 |       def __repr__(self) -> str:
     |
info: `lint:no-matching-overload` is enabled by default

error: lint:invalid-return-type: Return type does not match returned value
    --> sqlite_utils/db.py:1581:38
     |
1580 |     @property
1581 |     def virtual_table_using(self) -> Optional[str]:
     |                                      ------------- Expected `str | None` because of return type
1582 |         "Type of virtual table, or ``None`` if this is not a virtual table."
1583 |         match = _virtual_table_using_re.match(self.schema)
1584 |         if match is None:
1585 |             return None
1586 |         return match.groupdict()["using"].upper()
     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `str | None`, found `@Todo | str | bytes`
1587 |
1588 |     @property
     |
info: `lint:invalid-return-type` is enabled by default

error: lint:unresolved-attribute: Type `(...) -> Unknown` has no attribute `__name__`
    --> sqlite_utils/db.py:2888:23
     |
2886 |                 return jsonify_if_needed(fn(v))
2887 |
2888 |             fn_name = fn.__name__
     |                       ^^^^^^^^^^^
2889 |             if fn_name == "<lambda>":
2890 |                 fn_name = f"lambda_{abs(hash(fn))}"
     |
info: `lint:unresolved-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `lastrowid` on type `None | Unknown` is possibly unbound
    --> sqlite_utils/db.py:3154:35
     |
3152 |                         raise
3153 |             if num_records_processed == 1 and not upsert:
3154 |                 self.last_rowid = result.lastrowid
     |                                   ^^^^^^^^^^^^^^^^
3155 |                 self.last_pk = self.last_rowid
3156 |                 # self.last_rowid will be 0 if a "INSERT OR IGNORE" happened
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pluggy`
 --> sqlite_utils/hookspecs.py:1:6
  |
1 | from pluggy import HookimplMarker
  |      ^^^^^^
2 | from pluggy import HookspecMarker
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pluggy`
 --> sqlite_utils/hookspecs.py:2:6
  |
1 | from pluggy import HookimplMarker
2 | from pluggy import HookspecMarker
  |      ^^^^^^
3 |
4 | hookspec = HookspecMarker("sqlite_utils")
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pluggy`
 --> sqlite_utils/plugins.py:1:8
  |
1 | import pluggy
  |        ^^^^^^
2 | import sys
3 | from . import hookspecs
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `dateutil`
 --> sqlite_utils/recipes.py:1:6
  |
1 | from dateutil import parser
  |      ^^^^^^^^
2 | import json
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click`
  --> sqlite_utils/utils.py:14:8
   |
12 | from typing import Dict, cast, BinaryIO, Iterable, Optional, Tuple, Type
13 |
14 | import click
   |        ^^^^^
15 |
16 | try:
   |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pysqlite3`
  --> sqlite_utils/utils.py:17:12
   |
16 | try:
17 |     import pysqlite3 as sqlite3  # noqa: F401
   |            ^^^^^^^^^^^^^^^^^^^^
18 |     from pysqlite3 import dbapi2  # noqa: F401
   |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pysqlite3`
  --> sqlite_utils/utils.py:18:10
   |
16 | try:
17 |     import pysqlite3 as sqlite3  # noqa: F401
18 |     from pysqlite3 import dbapi2  # noqa: F401
   |          ^^^^^^^^^
19 |
20 |     OperationalError = dbapi2.OperationalError
   |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `sqlean`
  --> sqlite_utils/utils.py:23:16
   |
21 | except ImportError:
22 |     try:
23 |         import sqlean as sqlite3  # noqa: F401
   |                ^^^^^^^^^^^^^^^^^
24 |         from sqlean import dbapi2  # noqa: F401
   |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `sqlean`
  --> sqlite_utils/utils.py:24:14
   |
22 |     try:
23 |         import sqlean as sqlite3  # noqa: F401
24 |         from sqlean import dbapi2  # noqa: F401
   |              ^^^^^^
25 |
26 |         OperationalError = dbapi2.OperationalError
   |
info: `lint:unresolved-import` is enabled by default

warning: lint:unused-ignore-comment
   --> sqlite_utils/utils.py:224:28
    |
222 |             # ignoring row.pop(none) because of this issue:
223 |             # https://github.com/simonw/sqlite-utils/issues/440#issuecomment-1155358637
224 |             row.pop(None)  # type: ignore
    |                            ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
225 |             yield row
226 |         elif not extras_key:
    |

warning: lint:unused-ignore-comment
   --> sqlite_utils/utils.py:227:37
    |
225 |             yield row
226 |         elif not extras_key:
227 |             extras = row.pop(None)  # type: ignore
    |                                     ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
228 |             raise RowError(
229 |                 "Row {} contained these extra values: {}".format(row, extras)
    |

warning: lint:unused-ignore-comment
   --> sqlite_utils/utils.py:232:46
    |
230 |             )
231 |         else:
232 |             row[extras_key] = row.pop(None)  # type: ignore
    |                                              ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
233 |             yield row
    |

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
   --> sqlite_utils/utils.py:299:22
    |
297 |         decoded_fp = io.TextIOWrapper(fp, encoding=use_encoding)
298 |         if dialect is not None:
299 |             reader = csv.DictReader(decoded_fp, dialect=dialect)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
300 |         else:
301 |             reader = csv.DictReader(decoded_fp)
    |
info: `lint:no-matching-overload` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
   --> sqlite_utils/utils.py:301:22
    |
299 |             reader = csv.DictReader(decoded_fp, dialect=dialect)
300 |         else:
301 |             reader = csv.DictReader(decoded_fp)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
302 |         return _extra_key_strategy(reader, ignore_extras, extras_key), Format.CSV
303 |     elif format == Format.TSV:
    |
info: `lint:no-matching-overload` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/conftest.py:3:8
  |
1 | from sqlite_utils import Database
2 | from sqlite_utils.utils import sqlite3
3 | import pytest
  |        ^^^^^^
4 |
5 | CREATE_TABLES = """
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-attribute: Unresolved attribute `_called_from_test` on type `<module 'sys'>`.
  --> tests/conftest.py:14:5
   |
12 |     import sys
13 |
14 |     sys._called_from_test = True
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
info: `lint:unresolved-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_analyze.py:1:8
  |
1 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_analyze_tables.py:3:6
  |
1 | from sqlite_utils.db import Database, ColumnDetails
2 | from sqlite_utils import cli
3 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
4 | import pytest
5 | import sqlite3
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_analyze_tables.py:4:8
  |
2 | from sqlite_utils import cli
3 | from click.testing import CliRunner
4 | import pytest
  |        ^^^^^^
5 | import sqlite3
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
  --> tests/test_analyze_tables.py:46:5
   |
44 |                 }
45 |             )
46 |     db["stuff"].insert_all(to_insert)
   |     ^^^^^^^^^^^^^^^^^^^^^^
47 |     return path
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_analyze_tables.py:302:5
    |
300 |     path = str(tmpdir / "test_validate_columns.db")
301 |     db = Database(path)
302 |     db["one"].insert(
    |     ^^^^^^^^^^^^^^^^
303 |         {
304 |             "id": 1,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_analyze_tables.py:308:5
    |
306 |         }
307 |     )
308 |     db["two"].insert(
    |     ^^^^^^^^^^^^^^^^
309 |         {
310 |             "id": 1,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
  --> tests/test_attach.py:8:10
   |
 6 |     bar_path = str(tmpdir / "bar.db")
 7 |     db = Database(foo_path)
 8 |     with db.conn:
   |          ^^^^^^^
 9 |         db["foo"].insert({"id": 1, "text": "foo"})
10 |     db2 = Database(bar_path)
   |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_attach.py:9:9
   |
 7 |     db = Database(foo_path)
 8 |     with db.conn:
 9 |         db["foo"].insert({"id": 1, "text": "foo"})
   |         ^^^^^^^^^^^^^^^^
10 |     db2 = Database(bar_path)
11 |     with db2.conn:
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
  --> tests/test_attach.py:11:10
   |
 9 |         db["foo"].insert({"id": 1, "text": "foo"})
10 |     db2 = Database(bar_path)
11 |     with db2.conn:
   |          ^^^^^^^^
12 |         db2["bar"].insert({"id": 1, "text": "bar"})
13 |     db.attach("bar", bar_path)
   |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_attach.py:12:9
   |
10 |     db2 = Database(bar_path)
11 |     with db2.conn:
12 |         db2["bar"].insert({"id": 1, "text": "bar"})
   |         ^^^^^^^^^^^^^^^^^
13 |     db.attach("bar", bar_path)
14 |     assert db.execute(
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_cli.py:3:6
  |
1 | from sqlite_utils import cli, Database
2 | from sqlite_utils.db import Index, ForeignKey
3 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
4 | from pathlib import Path
5 | import subprocess
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
  --> tests/test_cli.py:10:8
   |
 8 | import json
 9 | import os
10 | import pytest
   |        ^^^^^^
11 | import textwrap
   |
info: `lint:unresolved-import` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
  --> tests/test_cli.py:84:10
   |
82 | def test_tables_counts_and_columns(db_path):
83 |     db = Database(db_path)
84 |     with db.conn:
   |          ^^^^^^^
85 |         db["lots"].insert_all([{"id": i, "age": i + 1} for i in range(30)])
86 |     result = CliRunner().invoke(cli.cli, ["tables", "--counts", "--columns", db_path])
   |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
  --> tests/test_cli.py:85:9
   |
83 |     db = Database(db_path)
84 |     with db.conn:
85 |         db["lots"].insert_all([{"id": i, "age": i + 1} for i in range(30)])
   |         ^^^^^^^^^^^^^^^^^^^^^
86 |     result = CliRunner().invoke(cli.cli, ["tables", "--counts", "--columns", db_path])
87 |     assert (
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:119:10
    |
117 | def test_tables_counts_and_columns_csv(db_path, format, expected):
118 |     db = Database(db_path)
119 |     with db.conn:
    |          ^^^^^^^
120 |         db["lots"].insert_all([{"id": i, "age": i + 1} for i in range(30)])
121 |     result = CliRunner().invoke(
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:120:9
    |
118 |     db = Database(db_path)
119 |     with db.conn:
120 |         db["lots"].insert_all([{"id": i, "age": i + 1} for i in range(30)])
    |         ^^^^^^^^^^^^^^^^^^^^^
121 |     result = CliRunner().invoke(
122 |         cli.cli, ["tables", "--counts", "--columns", format, db_path]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:129:10
    |
127 | def test_tables_schema(db_path):
128 |     db = Database(db_path)
129 |     with db.conn:
    |          ^^^^^^^
130 |         db["lots"].insert_all([{"id": i, "age": i + 1} for i in range(30)])
131 |     result = CliRunner().invoke(cli.cli, ["tables", "--schema", db_path])
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:130:9
    |
128 |     db = Database(db_path)
129 |     with db.conn:
130 |         db["lots"].insert_all([{"id": i, "age": i + 1} for i in range(30)])
    |         ^^^^^^^^^^^^^^^^^^^^^
131 |     result = CliRunner().invoke(cli.cli, ["tables", "--schema", db_path])
132 |     assert (
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:181:10
    |
179 | def test_output_table(db_path, options, expected):
180 |     db = Database(db_path)
181 |     with db.conn:
    |          ^^^^^^^
182 |         db["rows"].insert_all(
183 |             [
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:182:9
    |
180 |     db = Database(db_path)
181 |     with db.conn:
182 |         db["rows"].insert_all(
    |         ^^^^^^^^^^^^^^^^^^^^^
183 |             [
184 |                 {
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:199:18
    |
197 | def test_create_index(db_path):
198 |     db = Database(db_path)
199 |     assert [] == db["Gosh"].indexes
    |                  ^^^^^^^^^^^^^^^^^^
200 |     result = CliRunner().invoke(cli.cli, ["create-index", db_path, "Gosh", "c1"])
201 |     assert result.exit_code == 0
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:206:10
    |
204 |             seq=0, name="idx_Gosh_c1", unique=0, origin="c", partial=0, columns=["c1"]
205 |         )
206 |     ] == db["Gosh"].indexes
    |          ^^^^^^^^^^^^^^^^^^
207 |     # Try with a custom name
208 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:217:10
    |
215 |             seq=1, name="idx_Gosh_c1", unique=0, origin="c", partial=0, columns=["c1"]
216 |         ),
217 |     ] == db["Gosh"].indexes
    |          ^^^^^^^^^^^^^^^^^^
218 |     # Try a two-column unique index
219 |     create_index_unique_args = [
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:238:10
    |
236 |             columns=["c1", "c2"],
237 |         )
238 |     ] == db["Gosh2"].indexes
    |          ^^^^^^^^^^^^^^^^^^^
239 |     # Trying to create the same index should fail
240 |     assert CliRunner().invoke(cli.cli, create_index_unique_args).exit_code != 0
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:252:18
    |
250 |     db = Database(db_path)
251 |     assert "sqlite_stat1" not in db.table_names()
252 |     assert [] == db["Gosh"].indexes
    |                  ^^^^^^^^^^^^^^^^^^
253 |     result = CliRunner().invoke(
254 |         cli.cli, ["create-index", db_path, "Gosh", "c1", "--analyze"]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:262:18
    |
260 | def test_create_index_desc(db_path):
261 |     db = Database(db_path)
262 |     assert [] == db["Gosh"].indexes
    |                  ^^^^^^^^^^^^^^^^^^
263 |     result = CliRunner().invoke(cli.cli, ["create-index", db_path, "Gosh", "--", "-c1"])
264 |     assert result.exit_code == 0
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:352:5
    |
350 | def test_add_foreign_key(db_path, args, assert_message):
351 |     db = Database(db_path)
352 |     db["authors"].insert_all(
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
353 |         [{"id": 1, "name": "Sally"}, {"id": 2, "name": "Asheesh"}], pk="id"
354 |     )
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:355:5
    |
353 |         [{"id": 1, "name": "Sally"}, {"id": 2, "name": "Asheesh"}], pk="id"
354 |     )
355 |     db["books"].insert_all(
    |     ^^^^^^^^^^^^^^^^^^^^^^
356 |         [
357 |             {"title": "Hedgehogs of the world", "author_id": 1},
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `foreign_keys` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:368:10
    |
366 |             table="books", column="author_id", other_table="authors", other_column="id"
367 |         )
368 |     ] == db["books"].foreign_keys
    |          ^^^^^^^^^^^^^^^^^^^^^^^^
369 |
370 |     # Error if we try to add it twice:
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:397:5
    |
395 | def test_add_column_foreign_key(db_path):
396 |     db = Database(db_path)
397 |     db["authors"].insert({"id": 1, "name": "Sally"}, pk="id")
    |     ^^^^^^^^^^^^^^^^^^^^
398 |     db["books"].insert({"title": "Hedgehogs of the world"})
399 |     # Add an author_id foreign key column to the books table
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:398:5
    |
396 |     db = Database(db_path)
397 |     db["authors"].insert({"id": 1, "name": "Sally"}, pk="id")
398 |     db["books"].insert({"title": "Hedgehogs of the world"})
    |     ^^^^^^^^^^^^^^^^^^
399 |     # Add an author_id foreign key column to the books table
400 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:442:5
    |
440 | def test_suggest_alter_if_column_missing(db_path):
441 |     db = Database(db_path)
442 |     db["authors"].insert({"id": 1, "name": "Sally"}, pk="id")
    |     ^^^^^^^^^^^^^^^^^^^^
443 |     result = CliRunner().invoke(
444 |         cli.cli,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:458:18
    |
456 |     test_add_column_foreign_key(db_path)
457 |     db = Database(db_path)
458 |     assert [] == db["books"].indexes
    |                  ^^^^^^^^^^^^^^^^^^^
459 |     result = CliRunner().invoke(cli.cli, ["index-foreign-keys", db_path])
460 |     assert result.exit_code == 0
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:462:28
    |
460 |     assert result.exit_code == 0
461 |     assert [["author_id"], ["author_name_ref"]] == [
462 |         i.columns for i in db["books"].indexes
    |                            ^^^^^^^^^^^^^^^^^^^
463 |     ]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:468:12
    |
466 | def test_enable_fts(db_path):
467 |     db = Database(db_path)
468 |     assert db["Gosh"].detect_fts() is None
    |            ^^^^^^^^^^^^^^^^^^^^^
469 |     result = CliRunner().invoke(
470 |         cli.cli, ["enable-fts", db_path, "Gosh", "c1", "--fts4"]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:473:26
    |
471 |     )
472 |     assert result.exit_code == 0
473 |     assert "Gosh_fts" == db["Gosh"].detect_fts()
    |                          ^^^^^^^^^^^^^^^^^^^^^
474 |
475 |     # Table names with restricted chars are handled correctly.
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:477:5
    |
475 |     # Table names with restricted chars are handled correctly.
476 |     # colons and dots are restricted characters for table names.
477 |     db["http://example.com"].create({"c1": str, "c2": str, "c3": str})
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
478 |     assert db["http://example.com"].detect_fts() is None
479 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:478:12
    |
476 |     # colons and dots are restricted characters for table names.
477 |     db["http://example.com"].create({"c1": str, "c2": str, "c3": str})
478 |     assert db["http://example.com"].detect_fts() is None
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
479 |     result = CliRunner().invoke(
480 |         cli.cli,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:492:40
    |
490 |     )
491 |     assert result.exit_code == 0
492 |     assert "http://example.com_fts" == db["http://example.com"].detect_fts()
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
493 |     # Check tokenize was set to porter
494 |     assert (
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:506:12
    |
504 | def test_enable_fts_replace(db_path):
505 |     db = Database(db_path)
506 |     assert db["Gosh"].detect_fts() is None
    |            ^^^^^^^^^^^^^^^^^^^^^
507 |     result = CliRunner().invoke(
508 |         cli.cli, ["enable-fts", db_path, "Gosh", "c1", "--fts4"]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `detect_fts` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:511:26
    |
509 |     )
510 |     assert result.exit_code == 0
511 |     assert "Gosh_fts" == db["Gosh"].detect_fts()
    |                          ^^^^^^^^^^^^^^^^^^^^^
512 |     assert db["Gosh_fts"].columns_dict == {"c1": str}
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:530:5
    |
529 | def test_enable_fts_with_triggers(db_path):
530 |     Database(db_path)["Gosh"].insert_all([{"c1": "baz"}])
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
531 |     exit_code = (
532 |         CliRunner()
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:549:5
    |
548 |     assert [("baz",)] == search("baz")
549 |     Database(db_path)["Gosh"].insert_all([{"c1": "martha"}])
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
550 |     assert [("martha",)] == search("martha")
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:554:5
    |
553 | def test_populate_fts(db_path):
554 |     Database(db_path)["Gosh"].insert_all([{"c1": "baz"}])
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
555 |     exit_code = (
556 |         CliRunner()
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:570:5
    |
569 |     assert [("baz",)] == search("baz")
570 |     Database(db_path)["Gosh"].insert_all([{"c1": "martha"}])
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
571 |     assert [] == search("martha")
572 |     exit_code = (
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:612:10
    |
610 | def test_optimize(db_path, tables):
611 |     db = Database(db_path)
612 |     with db.conn:
    |          ^^^^^^^
613 |         for table in ("Gosh", "Gosh2"):
614 |             db[table].insert_all(
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:614:13
    |
612 |     with db.conn:
613 |         for table in ("Gosh", "Gosh2"):
614 |             db[table].insert_all(
    |             ^^^^^^^^^^^^^^^^^^^^
615 |                 [
616 |                     {
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:649:10
    |
647 |         for i in range(10000)
648 |     ]
649 |     with db.conn:
    |          ^^^^^^^
650 |         db["fts5_table"].insert_all(records, pk="c1")
651 |         db["fts5_table"].enable_fts(
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:650:9
    |
648 |     ]
649 |     with db.conn:
650 |         db["fts5_table"].insert_all(records, pk="c1")
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
651 |         db["fts5_table"].enable_fts(
652 |             ["c1", "c2", "c3"], fts_version="FTS5", create_triggers=True
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `search` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:655:17
    |
653 |         )
654 |     # Search should work
655 |     assert list(db["fts5_table"].search("verb1"))
    |                 ^^^^^^^^^^^^^^^^^^^^^^^
656 |     # Replicate docsize error from this issue for FTS5
657 |     # https://github.com/simonw/sqlite-utils/issues/149
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:659:5
    |
657 |     # https://github.com/simonw/sqlite-utils/issues/149
658 |     assert db["fts5_table_fts_docsize"].count == 10000
659 |     db["fts5_table"].insert_all(records, replace=True)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
660 |     assert db["fts5_table"].count == 10000
661 |     assert db["fts5_table_fts_docsize"].count == 20000
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:677:10
    |
675 | def test_query_csv(db_path, format, expected):
676 |     db = Database(db_path)
677 |     with db.conn:
    |          ^^^^^^^
678 |         db["dogs"].insert_all(
679 |             [
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:678:9
    |
676 |     db = Database(db_path)
677 |     with db.conn:
678 |         db["dogs"].insert_all(
    |         ^^^^^^^^^^^^^^^^^^^^^
679 |             [
680 |                 {"id": 1, "age": 4, "name": "Cleo"},
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:729:10
    |
727 | def test_query_json(db_path, sql, args, expected):
728 |     db = Database(db_path)
729 |     with db.conn:
    |          ^^^^^^^
730 |         db["dogs"].insert_all(
731 |             [
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:730:9
    |
728 |     db = Database(db_path)
729 |     with db.conn:
730 |         db["dogs"].insert_all(
    |         ^^^^^^^^^^^^^^^^^^^^^
731 |             [
732 |                 {"id": 1, "age": 4, "name": "Cleo"},
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:830:10
    |
828 | def test_query_json_binary(db_path):
829 |     db = Database(db_path)
830 |     with db.conn:
    |          ^^^^^^^
831 |         db["files"].insert(
832 |             {
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:831:9
    |
829 |     db = Database(db_path)
830 |     with db.conn:
831 |         db["files"].insert(
    |         ^^^^^^^^^^^^^^^^^^
832 |             {
833 |                 "name": "lorem.txt",
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
   --> tests/test_cli.py:887:10
    |
885 | def test_query_json_with_json_cols(db_path):
886 |     db = Database(db_path)
887 |     with db.conn:
    |          ^^^^^^^
888 |         db["dogs"].insert(
889 |             {
    |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:888:9
    |
886 |     db = Database(db_path)
887 |     with db.conn:
888 |         db["dogs"].insert(
    |         ^^^^^^^^^^^^^^^^^
889 |             {
890 |                 "id": 1,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:922:5
    |
920 | )
921 | def test_query_raw(db_path, content, is_binary):
922 |     Database(db_path)["files"].insert({"content": content})
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
923 |     result = CliRunner().invoke(
924 |         cli.cli, [db_path, "select content from files", "--raw"]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli.py:937:5
    |
935 | )
936 | def test_query_raw_lines(db_path, content, is_binary):
937 |     Database(db_path)["files"].insert_all({"content": content} for _ in range(3))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
938 |     result = CliRunner().invoke(
939 |         cli.cli, [db_path, "select content from files", "--raw-lines"]
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:1013:10
     |
1011 | def test_rows(db_path, args, expected):
1012 |     db = Database(db_path)
1013 |     with db.conn:
     |          ^^^^^^^
1014 |         db["dogs"].insert_all(
1015 |             [
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1014:9
     |
1012 |     db = Database(db_path)
1013 |     with db.conn:
1014 |         db["dogs"].insert_all(
     |         ^^^^^^^^^^^^^^^^^^^^^
1015 |             [
1016 |                 {"id": 1, "age": 4, "name": "Cleo"},
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1076:5
     |
1074 | def test_upsert_analyze(db_path, tmpdir):
1075 |     db = Database(db_path)
1076 |     db["rows"].insert({"id": 1, "foo": "x", "n": 3}, pk="id")
     |     ^^^^^^^^^^^^^^^^^
1077 |     db["rows"].create_index(["n"])
1078 |     assert "sqlite_stat1" not in db.table_names()
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1077:5
     |
1075 |     db = Database(db_path)
1076 |     db["rows"].insert({"id": 1, "foo": "x", "n": 3}, pk="id")
1077 |     db["rows"].create_index(["n"])
     |     ^^^^^^^^^^^^^^^^^^^^^^^
1078 |     assert "sqlite_stat1" not in db.table_names()
1079 |     result = CliRunner().invoke(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1091:5
     |
1089 |     db_path = str(tmpdir / "flat.db")
1090 |     db = Database(db_path)
1091 |     db["upsert_me"].insert({"id": 1, "name": "Example"}, pk="id")
     |     ^^^^^^^^^^^^^^^^^^^^^^
1092 |     result = CliRunner().invoke(
1093 |         cli.cli,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1257:9
     |
1255 |     with runner.isolated_filesystem():
1256 |         db = Database("test.db")
1257 |         db["dogs"].insert({"name": "Cleo"})
     |         ^^^^^^^^^^^^^^^^^
1258 |         result = runner.invoke(
1259 |             cli.cli, ["create-table", "test.db", "dogs", "id", "integer"]
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1272:9
     |
1270 |     with runner.isolated_filesystem():
1271 |         db = Database("test.db")
1272 |         db["dogs"].insert({"name": "Cleo"})
     |         ^^^^^^^^^^^^^^^^^
1273 |         result = runner.invoke(
1274 |             cli.cli, ["create-table", "test.db", "dogs", "id", "integer", "--ignore"]
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1284:9
     |
1282 |     with runner.isolated_filesystem():
1283 |         db = Database("test.db")
1284 |         db["dogs"].insert({"name": "Cleo"})
     |         ^^^^^^^^^^^^^^^^^
1285 |         result = runner.invoke(
1286 |             cli.cli, ["create-table", "test.db", "dogs", "id", "integer", "--replace"]
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1362:9
     |
1360 |     with runner.isolated_filesystem():
1361 |         db = Database("test.db")
1362 |         db["t"].create({"pk": int}, pk="pk")
     |         ^^^^^^^^^^^^^^
1363 |         assert "t" in db.table_names()
1364 |         result = runner.invoke(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1380:9
     |
1378 |     with runner.isolated_filesystem():
1379 |         db = Database("test.db")
1380 |         db["t"].create({"pk": int}, pk="pk")
     |         ^^^^^^^^^^^^^^
1381 |         result = runner.invoke(
1382 |             cli.cli,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1421:9
     |
1419 |     with runner.isolated_filesystem():
1420 |         db = Database("test.db")
1421 |         db["t"].create({"pk": int}, pk="pk")
     |         ^^^^^^^^^^^^^^
1422 |         result = runner.invoke(
1423 |             cli.cli,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1446:13
     |
1444 |         for dbname in dbs:
1445 |             db = Database(dbname)
1446 |             db["t"].create({"pk": int}, pk="pk")
     |             ^^^^^^^^^^^^^^
1447 |             assert db.journal_mode == "delete"
1448 |         result = runner.invoke(cli.cli, ["enable-wal"] + dbs, catch_exceptions=False)
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1461:13
     |
1459 |         for dbname in dbs:
1460 |             db = Database(dbname)
1461 |             db["t"].create({"pk": int}, pk="pk")
     |             ^^^^^^^^^^^^^^
1462 |             db.enable_wal()
1463 |             assert db.journal_mode == "wal"
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:1483:10
     |
1481 | def test_query_update(db_path, args, expected):
1482 |     db = Database(db_path)
1483 |     with db.conn:
     |          ^^^^^^^
1484 |         db["dogs"].insert_all(
1485 |             [
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1484:9
     |
1482 |     db = Database(db_path)
1483 |     with db.conn:
1484 |         db["dogs"].insert_all(
     |         ^^^^^^^^^^^^^^^^^^^^^
1485 |             [
1486 |                 {"id": 1, "age": 4, "name": "Cleo"},
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1500:5
     |
1498 | def test_add_foreign_keys(db_path):
1499 |     db = Database(db_path)
1500 |     db["countries"].insert({"id": 7, "name": "Panama"}, pk="id")
     |     ^^^^^^^^^^^^^^^^^^^^^^
1501 |     db["authors"].insert({"id": 3, "name": "Matilda", "country_id": 7}, pk="id")
1502 |     db["books"].insert({"id": 2, "title": "Wolf anatomy", "author_id": 3}, pk="id")
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1501:5
     |
1499 |     db = Database(db_path)
1500 |     db["countries"].insert({"id": 7, "name": "Panama"}, pk="id")
1501 |     db["authors"].insert({"id": 3, "name": "Matilda", "country_id": 7}, pk="id")
     |     ^^^^^^^^^^^^^^^^^^^^
1502 |     db["books"].insert({"id": 2, "title": "Wolf anatomy", "author_id": 3}, pk="id")
1503 |     assert db["authors"].foreign_keys == []
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1502:5
     |
1500 |     db["countries"].insert({"id": 7, "name": "Panama"}, pk="id")
1501 |     db["authors"].insert({"id": 3, "name": "Matilda", "country_id": 7}, pk="id")
1502 |     db["books"].insert({"id": 2, "title": "Wolf anatomy", "author_id": 3}, pk="id")
     |     ^^^^^^^^^^^^^^^^^^
1503 |     assert db["authors"].foreign_keys == []
1504 |     assert db["books"].foreign_keys == []
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `foreign_keys` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1503:12
     |
1501 |     db["authors"].insert({"id": 3, "name": "Matilda", "country_id": 7}, pk="id")
1502 |     db["books"].insert({"id": 2, "title": "Wolf anatomy", "author_id": 3}, pk="id")
1503 |     assert db["authors"].foreign_keys == []
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
1504 |     assert db["books"].foreign_keys == []
1505 |     result = CliRunner().invoke(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `foreign_keys` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1504:12
     |
1502 |     db["books"].insert({"id": 2, "title": "Wolf anatomy", "author_id": 3}, pk="id")
1503 |     assert db["authors"].foreign_keys == []
1504 |     assert db["books"].foreign_keys == []
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
1505 |     result = CliRunner().invoke(
1506 |         cli.cli,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `foreign_keys` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1521:12
     |
1519 |     )
1520 |     assert result.exit_code == 0
1521 |     assert db["authors"].foreign_keys == [
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
1522 |         ForeignKey(
1523 |             table="authors",
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `foreign_keys` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1529:12
     |
1527 |         )
1528 |     ]
1529 |     assert db["books"].foreign_keys == [
     |            ^^^^^^^^^^^^^^^^^^^^^^^^
1530 |         ForeignKey(
1531 |             table="books", column="author_id", other_table="authors", other_column="id"
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:1652:10
     |
1650 | def test_transform(db_path, args, expected_schema):
1651 |     db = Database(db_path)
1652 |     with db.conn:
     |          ^^^^^^^
1653 |         db["dogs"].insert(
1654 |             {"id": 1, "age": 4, "name": "Cleo"},
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1653:9
     |
1651 |     db = Database(db_path)
1652 |     with db.conn:
1653 |         db["dogs"].insert(
     |         ^^^^^^^^^^^^^^^^^
1654 |             {"id": 1, "age": 4, "name": "Cleo"},
1655 |             not_null={"age"},
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:1709:10
     |
1707 | def test_transform_add_or_drop_foreign_key(db_path, extra_args, expected_schema):
1708 |     db = Database(db_path)
1709 |     with db.conn:
     |          ^^^^^^^
1710 |         # Create table with three foreign keys so we can drop two of them
1711 |         db["continent"].insert({"id": 1, "name": "Europe"}, pk="id")
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1711:9
     |
1709 |     with db.conn:
1710 |         # Create table with three foreign keys so we can drop two of them
1711 |         db["continent"].insert({"id": 1, "name": "Europe"}, pk="id")
     |         ^^^^^^^^^^^^^^^^^^^^^^
1712 |         db["country"].insert({"id": 1, "name": "France"}, pk="id")
1713 |         db["city"].insert({"id": 24, "name": "Paris"}, pk="id")
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1712:9
     |
1710 |         # Create table with three foreign keys so we can drop two of them
1711 |         db["continent"].insert({"id": 1, "name": "Europe"}, pk="id")
1712 |         db["country"].insert({"id": 1, "name": "France"}, pk="id")
     |         ^^^^^^^^^^^^^^^^^^^^
1713 |         db["city"].insert({"id": 24, "name": "Paris"}, pk="id")
1714 |         db["places"].insert(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1713:9
     |
1711 |         db["continent"].insert({"id": 1, "name": "Europe"}, pk="id")
1712 |         db["country"].insert({"id": 1, "name": "France"}, pk="id")
1713 |         db["city"].insert({"id": 24, "name": "Paris"}, pk="id")
     |         ^^^^^^^^^^^^^^^^^
1714 |         db["places"].insert(
1715 |             {
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1714:9
     |
1712 |         db["country"].insert({"id": 1, "name": "France"}, pk="id")
1713 |         db["city"].insert({"id": 24, "name": "Paris"}, pk="id")
1714 |         db["places"].insert(
     |         ^^^^^^^^^^^^^^^^^^^
1715 |             {
1716 |                 "id": 32,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:1793:10
     |
1791 | def test_extract(db_path, args, expected_table_schema, expected_other_schema):
1792 |     db = Database(db_path)
1793 |     with db.conn:
     |          ^^^^^^^
1794 |         db["trees"].insert(
1795 |             {"id": 1, "address": "4 Park Ave", "species": "Palm"},
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1794:9
     |
1792 |     db = Database(db_path)
1793 |     with db.conn:
1794 |         db["trees"].insert(
     |         ^^^^^^^^^^^^^^^^^^
1795 |             {"id": 1, "address": "4 Park Ave", "species": "Palm"},
1796 |             pk="id",
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1878:5
     |
1876 |     db_path = str(tmpdir / "test.db")
1877 |     db = Database(db_path)
1878 |     db["articles"].insert_all(
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^
1879 |         [
1880 |             {"id": 1, "title": "Title the first"},
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:1899:5
     |
1897 |     db_path = str(tmpdir / "test.db")
1898 |     db = Database(db_path)
1899 |     db["creatures"].insert({"name": "dog."}).enable_fts(["name"])
     |     ^^^^^^^^^^^^^^^^^^^^^^
1900 |     # Without --quote should return an error
1901 |     error_result = CliRunner().invoke(cli.cli, ["search", db_path, "creatures", 'dog"'])
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `executescript` on type `Unknown | Connection | (Unknown & ~str & ~Path) | None` is possibly unbound
    --> tests/test_cli.py:1918:5
     |
1916 |     db_path = str(tmpdir / "test.db")
1917 |     db = Database(db_path)
1918 |     db.conn.executescript(
     |     ^^^^^^^^^^^^^^^^^^^^^
1919 |         """
1920 |         create table Gosh (c1 text, c2 text, c3 text);
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2009:5
     |
2007 |     db_path = str(tmpdir / "test.db")
2008 |     db = Database(db_path)
2009 |     db["articles"].insert(
     |     ^^^^^^^^^^^^^^^^^^^^^
2010 |         {"id": 1, "title": "Title the first"},
2011 |         pk="id",
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2013:5
     |
2011 |         pk="id",
2012 |     )
2013 |     db["counter"].insert({"count": 1})
     |     ^^^^^^^^^^^^^^^^^^^^
2014 |     db.conn.execute(
2015 |         textwrap.dedent(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `execute` on type `Unknown | Connection | (Unknown & ~str & ~Path) | None` is possibly unbound
    --> tests/test_cli.py:2014:5
     |
2012 |     )
2013 |     db["counter"].insert({"count": 1})
2014 |     db.conn.execute(
     |     ^^^^^^^^^^^^^^^
2015 |         textwrap.dedent(
2016 |             """
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2078:5
     |
2076 |     db_path = str(tmpdir / "test.db")
2077 |     db = Database(db_path)
2078 |     db["dogs"].create({"id": int, "name": str})
     |     ^^^^^^^^^^^^^^^^^
2079 |     db["chickens"].create({"id": int, "name": str, "breed": str})
2080 |     db["chickens"].create_index(["breed"])
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2079:5
     |
2077 |     db = Database(db_path)
2078 |     db["dogs"].create({"id": int, "name": str})
2079 |     db["chickens"].create({"id": int, "name": str, "breed": str})
     |     ^^^^^^^^^^^^^^^^^^^^^
2080 |     db["chickens"].create_index(["breed"])
2081 |     result = CliRunner().invoke(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2080:5
     |
2078 |     db["dogs"].create({"id": int, "name": str})
2079 |     db["chickens"].create({"id": int, "name": str, "breed": str})
2080 |     db["chickens"].create_index(["breed"])
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2081 |     result = CliRunner().invoke(
2082 |         cli.cli,
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:2150:10
     |
2148 |     bar_path = str(tmpdir / "bar.db")
2149 |     db = Database(foo_path)
2150 |     with db.conn:
     |          ^^^^^^^
2151 |         db["foo"].insert({"id": 1, "text": "foo"})
2152 |     db2 = Database(bar_path)
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2151:9
     |
2149 |     db = Database(foo_path)
2150 |     with db.conn:
2151 |         db["foo"].insert({"id": 1, "text": "foo"})
     |         ^^^^^^^^^^^^^^^^
2152 |     db2 = Database(bar_path)
2153 |     with db2.conn:
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:invalid-context-manager: Object of type `Unknown | Connection | (Unknown & ~str & ~Path) | None` cannot be used with `with` because the methods `__enter__` and `__exit__` are possibly unbound
    --> tests/test_cli.py:2153:10
     |
2151 |         db["foo"].insert({"id": 1, "text": "foo"})
2152 |     db2 = Database(bar_path)
2153 |     with db2.conn:
     |          ^^^^^^^^
2154 |         db2["bar"].insert({"id": 1, "text": "bar"})
2155 |     db.attach("bar", bar_path)
     |
info: `lint:invalid-context-manager` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2154:9
     |
2152 |     db2 = Database(bar_path)
2153 |     with db2.conn:
2154 |         db2["bar"].insert({"id": 1, "text": "bar"})
     |         ^^^^^^^^^^^^^^^^^
2155 |     db.attach("bar", bar_path)
2156 |     sql = "select * from foo union all select * from bar.bar"
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2311:5
     |
2309 |     db_path = str(tmpdir / "test.db")
2310 |     db = Database(db_path)
2311 |     db["one_index"].insert({"id": 1, "name": "Cleo"}, pk="id")
     |     ^^^^^^^^^^^^^^^^^^^^^^
2312 |     db["one_index"].create_index(["name"])
2313 |     db["two_indexes"].insert({"id": 1, "name": "Cleo", "species": "dog"}, pk="id")
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2312:5
     |
2310 |     db = Database(db_path)
2311 |     db["one_index"].insert({"id": 1, "name": "Cleo"}, pk="id")
2312 |     db["one_index"].create_index(["name"])
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2313 |     db["two_indexes"].insert({"id": 1, "name": "Cleo", "species": "dog"}, pk="id")
2314 |     db["two_indexes"].create_index(["name"])
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2313:5
     |
2311 |     db["one_index"].insert({"id": 1, "name": "Cleo"}, pk="id")
2312 |     db["one_index"].create_index(["name"])
2313 |     db["two_indexes"].insert({"id": 1, "name": "Cleo", "species": "dog"}, pk="id")
     |     ^^^^^^^^^^^^^^^^^^^^^^^^
2314 |     db["two_indexes"].create_index(["name"])
2315 |     db["two_indexes"].create_index(["species"])
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2314:5
     |
2312 |     db["one_index"].create_index(["name"])
2313 |     db["two_indexes"].insert({"id": 1, "name": "Cleo", "species": "dog"}, pk="id")
2314 |     db["two_indexes"].create_index(["name"])
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2315 |     db["two_indexes"].create_index(["species"])
2316 |     result = CliRunner().invoke(cli.cli, ["analyze", db_path] + options)
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2315:5
     |
2313 |     db["two_indexes"].insert({"id": 1, "name": "Cleo", "species": "dog"}, pk="id")
2314 |     db["two_indexes"].create_index(["name"])
2315 |     db["two_indexes"].create_index(["species"])
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2316 |     result = CliRunner().invoke(cli.cli, ["analyze", db_path] + options)
2317 |     assert result.exit_code == 0
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2324:5
     |
2322 |     db_path = str(tmpdir / "test.db")
2323 |     db = Database(db_path)
2324 |     db["one"].insert({"id": 1, "name": "Cleo"}, pk="id")
     |     ^^^^^^^^^^^^^^^^
2325 |     # First try a non-existent table
2326 |     result_error = CliRunner().invoke(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2356:5
     |
2354 |     db_path = str(tmpdir / "test.db")
2355 |     db = Database(db_path)
2356 |     db["one"].insert({"id": 1, "name": "Cleo"}, pk="id")
     |     ^^^^^^^^^^^^^^^^
2357 |     # First try a non-existent table
2358 |     result_error = CliRunner().invoke(
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `strict` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2423:16
     |
2421 |         )
2422 |         assert result.exit_code == 0
2423 |         assert db["items"].strict == strict or not db.supports_strict
     |                ^^^^^^^^^^^^^^^^^^
2424 |         # Should have a floating point column
2425 |         assert db["items"].columns_dict == {"id": int, "w": float}
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `strict` on type `Table | View` is possibly unbound
    --> tests/test_cli.py:2440:12
     |
2438 |     assert result.exit_code == 0
2439 |     db = Database(db_path)
2440 |     assert db["items"].strict == strict or not db.supports_strict
     |            ^^^^^^^^^^^^^^^^^^
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_cli_bulk.py:1:6
  |
1 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
2 | from sqlite_utils import cli, Database
3 | import pathlib
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_cli_bulk.py:4:8
  |
2 | from sqlite_utils import cli, Database
3 | import pathlib
4 | import pytest
  |        ^^^^^^
5 | import subprocess
6 | import sys
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
  --> tests/test_cli_bulk.py:14:5
   |
12 |     db_path = str(pathlib.Path(tmpdir) / "data.db")
13 |     db = Database(db_path)
14 |     db["example"].insert_all(
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
15 |         [
16 |             {"id": 1, "name": "One"},
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `write` on type `IO[Unknown] | None` is possibly unbound
  --> tests/test_cli_bulk.py:67:5
   |
65 |     )
66 |     # Writing one record should not commit
67 |     proc.stdin.write(b'{"id": 3, "name": "Three"}\n\n')
   |     ^^^^^^^^^^^^^^^^
68 |     proc.stdin.flush()
69 |     time.sleep(1)
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `flush` on type `IO[Unknown] | None` is possibly unbound
  --> tests/test_cli_bulk.py:68:5
   |
66 |     # Writing one record should not commit
67 |     proc.stdin.write(b'{"id": 3, "name": "Three"}\n\n')
68 |     proc.stdin.flush()
   |     ^^^^^^^^^^^^^^^^
69 |     time.sleep(1)
70 |     assert db["example"].count == 2
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `write` on type `IO[Unknown] | None` is possibly unbound
  --> tests/test_cli_bulk.py:73:5
   |
72 |     # Writing another should trigger a commit:
73 |     proc.stdin.write(b'{"id": 4, "name": "Four"}\n\n')
   |     ^^^^^^^^^^^^^^^^
74 |     proc.stdin.flush()
75 |     time.sleep(1)
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `flush` on type `IO[Unknown] | None` is possibly unbound
  --> tests/test_cli_bulk.py:74:5
   |
72 |     # Writing another should trigger a commit:
73 |     proc.stdin.write(b'{"id": 4, "name": "Four"}\n\n')
74 |     proc.stdin.flush()
   |     ^^^^^^^^^^^^^^^^
75 |     time.sleep(1)
76 |     assert db["example"].count == 4
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `close` on type `IO[Unknown] | None` is possibly unbound
  --> tests/test_cli_bulk.py:78:5
   |
76 |     assert db["example"].count == 4
77 |
78 |     proc.stdin.close()
   |     ^^^^^^^^^^^^^^^^
79 |     proc.wait()
80 |     assert proc.returncode == 0
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_cli_convert.py:1:6
  |
1 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
2 | from sqlite_utils import cli
3 | import sqlite_utils
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_cli_convert.py:7:8
  |
5 | import textwrap
6 | import pathlib
7 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_cli_convert.py:419:5
    |
417 |     db_path = str(pathlib.Path(tmpdir) / "data.db")
418 |     db = sqlite_utils.Database(db_path)
419 |     db["example"].insert_all(
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
420 |         [
421 |             {"id": 1, "tags": (delimiter or ",").join(["foo", "bar"])},
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_cli_insert.py:2:6
  |
1 | from sqlite_utils import cli, Database
2 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
3 | import json
4 | import pytest
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_cli_insert.py:4:8
  |
2 | from click.testing import CliRunner
3 | import json
4 | import pytest
  |        ^^^^^^
5 | import subprocess
6 | import sys
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `indexes` on type `Table | View` is possibly unbound
  --> tests/test_cli_insert.py:22:18
   |
20 |     db = Database(db_path)
21 |     assert ["dogs"] == db.table_names()
22 |     assert [] == db["dogs"].indexes
   |                  ^^^^^^^^^^^^^^^^^^
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `pks` on type `Table | View` is possibly unbound
  --> tests/test_cli_insert.py:97:12
   |
95 |     )
96 |     db = Database(db_path)
97 |     assert db["dogs"].pks == expected_pks
   |            ^^^^^^^^^^^^^^
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `pks` on type `Table | View` is possibly unbound
   --> tests/test_cli_insert.py:111:22
    |
109 |     db = Database(db_path)
110 |     assert dogs == list(db.query("select * from dogs order by id"))
111 |     assert ["id"] == db["dogs"].pks
    |                      ^^^^^^^^^^^^^^
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `pks` on type `Table | View` is possibly unbound
   --> tests/test_cli_insert.py:128:35
    |
126 |     db = Database(db_path)
127 |     assert dogs == list(db.query("select * from dogs order by breed, id"))
128 |     assert {"breed", "id"} == set(db["dogs"].pks)
    |                                   ^^^^^^^^^^^^^^
129 |     assert (
130 |         "CREATE TABLE [dogs] (\n"
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli_insert.py:193:5
    |
191 | def test_insert_ignore(db_path, tmpdir):
192 |     db = Database(db_path)
193 |     db["dogs"].insert({"id": 1, "name": "Cleo"}, pk="id")
    |     ^^^^^^^^^^^^^^^^^
194 |     json_path = str(tmpdir / "dogs.json")
195 |     with open(json_path, "w") as fp:
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_cli_insert.py:389:5
    |
387 | def test_insert_analyze(db_path):
388 |     db = Database(db_path)
389 |     db["rows"].insert({"foo": "x", "n": 3})
    |     ^^^^^^^^^^^^^^^^^
390 |     db["rows"].create_index(["n"])
391 |     assert "sqlite_stat1" not in db.table_names()
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create_index` on type `Table | View` is possibly unbound
   --> tests/test_cli_insert.py:390:5
    |
388 |     db = Database(db_path)
389 |     db["rows"].insert({"foo": "x", "n": 3})
390 |     db["rows"].create_index(["n"])
    |     ^^^^^^^^^^^^^^^^^^^^^^^
391 |     assert "sqlite_stat1" not in db.table_names()
392 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `write` on type `IO[Unknown] | None` is possibly unbound
   --> tests/test_cli_insert.py:579:5
    |
577 |         stdout=sys.stdout,
578 |     )
579 |     proc.stdin.write(b'{"name": "Azi"}\n')
    |     ^^^^^^^^^^^^^^^^
580 |     proc.stdin.flush()
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `flush` on type `IO[Unknown] | None` is possibly unbound
   --> tests/test_cli_insert.py:580:5
    |
578 |     )
579 |     proc.stdin.write(b'{"name": "Azi"}\n')
580 |     proc.stdin.flush()
    |     ^^^^^^^^^^^^^^^^
581 |
582 |     def try_until(expected):
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `write` on type `IO[Unknown] | None` is possibly unbound
   --> tests/test_cli_insert.py:594:5
    |
593 |     try_until([{"name": "Azi"}])
594 |     proc.stdin.write(b'{"name": "Suna"}\n')
    |     ^^^^^^^^^^^^^^^^
595 |     proc.stdin.flush()
596 |     try_until([{"name": "Azi"}, {"name": "Suna"}])
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `flush` on type `IO[Unknown] | None` is possibly unbound
   --> tests/test_cli_insert.py:595:5
    |
593 |     try_until([{"name": "Azi"}])
594 |     proc.stdin.write(b'{"name": "Suna"}\n')
595 |     proc.stdin.flush()
    |     ^^^^^^^^^^^^^^^^
596 |     try_until([{"name": "Azi"}, {"name": "Suna"}])
597 |     proc.stdin.close()
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `close` on type `IO[Unknown] | None` is possibly unbound
   --> tests/test_cli_insert.py:597:5
    |
595 |     proc.stdin.flush()
596 |     try_until([{"name": "Azi"}, {"name": "Suna"}])
597 |     proc.stdin.close()
    |     ^^^^^^^^^^^^^^^^
598 |     proc.wait()
599 |     assert proc.returncode == 0
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click`
 --> tests/test_cli_memory.py:1:8
  |
1 | import click
  |        ^^^^^
2 | import json
3 | import pytest
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_cli_memory.py:3:8
  |
1 | import click
2 | import json
3 | import pytest
  |        ^^^^^^
4 | from click.testing import CliRunner
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_cli_memory.py:4:6
  |
2 | import json
3 | import pytest
4 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
5 |
6 | from sqlite_utils import Database, cli
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_column_affinity.py:1:8
  |
1 | import pytest
  |        ^^^^^^
2 | from sqlite_utils.utils import column_affinity
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_constructor.py:3:8
  |
1 | from sqlite_utils import Database
2 | from sqlite_utils.utils import sqlite3
3 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_constructor.py:19:5
   |
17 |     db1 = Database(memory_name="shared")
18 |     db2 = Database(memory_name="shared")
19 |     db1["dogs"].insert({"name": "Cleo"})
   |     ^^^^^^^^^^^^^^^^^^
20 |     assert list(db2["dogs"].rows) == [{"name": "Cleo"}]
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_convert.py:2:8
  |
1 | from sqlite_utils.db import BadMultiValues
2 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
  --> tests/test_create.py:18:8
   |
16 | import json
17 | import pathlib
18 | import pytest
   |        ^^^^^^
19 | import uuid
   |
info: `lint:unresolved-import` is enabled by default

warning: lint:unused-ignore-comment
  --> tests/test_create.py:25:16
   |
23 |     import pandas as pd  # type: ignore
24 | except ImportError:
25 |     pd = None  # type: ignore
   |                ^^^^^^^^^^^^^^ Unused blanket `type: ignore` directive
   |

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
   --> tests/test_create.py:953:25
    |
951 |     else:
952 |         dogs = fresh_db["dogs"]
953 |         insert_kwargs = dict(hash_id_columns=("name", "twitter"))
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
954 |
955 |     id = dogs.insert(
    |
info: `lint:no-matching-overload` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_create.py:980:5
    |
978 |     path = pathlib.Path(tmpdir / "test.db")
979 |     db = Database(path)
980 |     db["demo"].insert_all([{"foo": 1}])
    |     ^^^^^^^^^^^^^^^^^^^^^
981 |     assert db["demo"].count == 1
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `DataFrame` on type `Unknown | None` is possibly unbound
   --> tests/test_create.py:986:10
    |
984 | @pytest.mark.skipif(pd is None, reason="pandas and numpy are not installed")
985 | def test_create_table_numpy(fresh_db):
986 |     df = pd.DataFrame({"col 1": range(3), "col 2": range(3)})
    |          ^^^^^^^^^^^^
987 |     fresh_db["pandas"].insert_all(df.to_dict(orient="records"))
988 |     assert [
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `DataFrame` on type `Unknown | None` is possibly unbound
   --> tests/test_create.py:994:10
    |
992 |     ] == list(fresh_db["pandas"].rows)
993 |     # Now try all the different types
994 |     df = pd.DataFrame(
    |          ^^^^^^^^^^^^
995 |         {
996 |             "np.int8": [-8],
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_create.py:1325:5
     |
1323 |     db = Database(memory=True, strict=strict)
1324 |     table = db.table("t", columns={"id": int})
1325 |     table.insert({"id": 1})
     |     ^^^^^^^^^^^^
1326 |     assert table.strict == strict or not db.supports_strict
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `strict` on type `Table | View` is possibly unbound
    --> tests/test_create.py:1326:12
     |
1324 |     table = db.table("t", columns={"id": int})
1325 |     table.insert({"id": 1})
1326 |     assert table.strict == strict or not db.supports_strict
     |            ^^^^^^^^^^^^
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
    --> tests/test_create.py:1333:5
     |
1331 |     db = Database(memory=True, strict=strict)
1332 |     table = db.table("t", columns={"id": int}, strict=not strict)
1333 |     table.insert({"id": 1})
     |     ^^^^^^^^^^^^
1334 |     assert table.strict != strict or not db.supports_strict
     |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `strict` on type `Table | View` is possibly unbound
    --> tests/test_create.py:1334:12
     |
1332 |     table = db.table("t", columns={"id": int}, strict=not strict)
1333 |     table.insert({"id": 1})
1334 |     assert table.strict != strict or not db.supports_strict
     |            ^^^^^^^^^^^^
     |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_create_view.py:1:8
  |
1 | import pytest
  |        ^^^^^^
2 | from sqlite_utils.utils import OperationalError
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_default_value.py:1:8
  |
1 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_docs.py:1:6
  |
1 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
2 | from sqlite_utils import cli, recipes
3 | from pathlib import Path
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_docs.py:4:8
  |
2 | from sqlite_utils import cli, recipes
3 | from pathlib import Path
4 | import pytest
  |        ^^^^^^
5 | import re
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_duplicate.py:3:8
  |
1 | from sqlite_utils.db import NoTable
2 | import datetime
3 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_enable_counts.py:3:6
  |
1 | from sqlite_utils import Database
2 | from sqlite_utils import cli
3 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
4 | import pytest
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_enable_counts.py:4:8
  |
2 | from sqlite_utils import cli
3 | from click.testing import CliRunner
4 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_enable_counts.py:90:5
   |
88 |     path = str(tmpdir / "test.db")
89 |     db = Database(path)
90 |     db["foo"].insert({"name": "bar"})
   |     ^^^^^^^^^^^^^^^^
91 |     db["bar"].insert({"name": "bar"})
92 |     db["bar"].insert({"name": "bar"})
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_enable_counts.py:91:5
   |
89 |     db = Database(path)
90 |     db["foo"].insert({"name": "bar"})
91 |     db["bar"].insert({"name": "bar"})
   |     ^^^^^^^^^^^^^^^^
92 |     db["bar"].insert({"name": "bar"})
93 |     db["baz"].insert({"name": "bar"})
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_enable_counts.py:92:5
   |
90 |     db["foo"].insert({"name": "bar"})
91 |     db["bar"].insert({"name": "bar"})
92 |     db["bar"].insert({"name": "bar"})
   |     ^^^^^^^^^^^^^^^^
93 |     db["baz"].insert({"name": "bar"})
94 |     return path
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_enable_counts.py:93:5
   |
91 |     db["bar"].insert({"name": "bar"})
92 |     db["bar"].insert({"name": "bar"})
93 |     db["baz"].insert({"name": "bar"})
   |     ^^^^^^^^^^^^^^^^
94 |     return path
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `enable_counts` on type `Table | View` is possibly unbound
   --> tests/test_enable_counts.py:166:5
    |
164 | def test_reset_counts(counts_db_path):
165 |     db = Database(counts_db_path)
166 |     db["foo"].enable_counts()
    |     ^^^^^^^^^^^^^^^^^^^^^^^
167 |     db["bar"].enable_counts()
168 |     assert db.cached_counts() == {"foo": 1, "bar": 2}
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `enable_counts` on type `Table | View` is possibly unbound
   --> tests/test_enable_counts.py:167:5
    |
165 |     db = Database(counts_db_path)
166 |     db["foo"].enable_counts()
167 |     db["bar"].enable_counts()
    |     ^^^^^^^^^^^^^^^^^^^^^^^
168 |     assert db.cached_counts() == {"foo": 1, "bar": 2}
169 |     # Corrupt the value
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `update` on type `Table | View` is possibly unbound
   --> tests/test_enable_counts.py:170:5
    |
168 |     assert db.cached_counts() == {"foo": 1, "bar": 2}
169 |     # Corrupt the value
170 |     db["_counts"].update("foo", {"count": 3})
    |     ^^^^^^^^^^^^^^^^^^^^
171 |     assert db.cached_counts() == {"foo": 3, "bar": 2}
172 |     assert db["foo"].count == 3
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `enable_counts` on type `Table | View` is possibly unbound
   --> tests/test_enable_counts.py:181:5
    |
179 | def test_reset_counts_cli(counts_db_path):
180 |     db = Database(counts_db_path)
181 |     db["foo"].enable_counts()
    |     ^^^^^^^^^^^^^^^^^^^^^^^
182 |     db["bar"].enable_counts()
183 |     assert db.cached_counts() == {"foo": 1, "bar": 2}
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `enable_counts` on type `Table | View` is possibly unbound
   --> tests/test_enable_counts.py:182:5
    |
180 |     db = Database(counts_db_path)
181 |     db["foo"].enable_counts()
182 |     db["bar"].enable_counts()
    |     ^^^^^^^^^^^^^^^^^^^^^^^
183 |     assert db.cached_counts() == {"foo": 1, "bar": 2}
184 |     db["_counts"].update("foo", {"count": 3})
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `update` on type `Table | View` is possibly unbound
   --> tests/test_enable_counts.py:184:5
    |
182 |     db["bar"].enable_counts()
183 |     assert db.cached_counts() == {"foo": 1, "bar": 2}
184 |     db["_counts"].update("foo", {"count": 3})
    |     ^^^^^^^^^^^^^^^^^^^^
185 |     result = CliRunner().invoke(cli.cli, ["reset-counts", counts_db_path])
186 |     assert result.exit_code == 0
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_extract.py:3:8
  |
1 | from sqlite_utils.db import InvalidColumns
2 | import itertools
3 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_extracts.py:2:8
  |
1 | from sqlite_utils.db import Index
2 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
  --> tests/test_extracts.py:8:10
   |
 6 |     "kwargs,expected_table",
 7 |     [
 8 |         (dict(extracts={"species_id": "Species"}), "Species"),
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 9 |         (dict(extracts=["species_id"]), "species_id"),
10 |         (dict(extracts=("species_id",)), "species_id"),
   |
info: `lint:no-matching-overload` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
  --> tests/test_extracts.py:9:10
   |
 7 |     [
 8 |         (dict(extracts={"species_id": "Species"}), "Species"),
 9 |         (dict(extracts=["species_id"]), "species_id"),
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 |         (dict(extracts=("species_id",)), "species_id"),
11 |     ],
   |
info: `lint:no-matching-overload` is enabled by default

error: lint:no-matching-overload: No overload of bound method `__init__` matches arguments
  --> tests/test_extracts.py:10:10
   |
 8 |         (dict(extracts={"species_id": "Species"}), "Species"),
 9 |         (dict(extracts=["species_id"]), "species_id"),
10 |         (dict(extracts=("species_id",)), "species_id"),
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 |     ],
12 | )
   |
info: `lint:no-matching-overload` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_fts.py:1:8
  |
1 | import pytest
  |        ^^^^^^
2 | from sqlite_utils import Database
3 | from sqlite_utils.utils import sqlite3
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:353:5
    |
351 |     db = Database(str(path), recursive_triggers=False)
352 |     licenses = [{"key": "apache2", "name": "Apache 2"}, {"key": "bsd", "name": "BSD"}]
353 |     db["licenses"].insert_all(licenses, pk="key", replace=True)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
354 |     db["licenses"].enable_fts(["name"], create_triggers=True, fts_version=fts_version)
355 |     assert db["licenses_fts_docsize"].count == 2
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert_all` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:357:5
    |
355 |     assert db["licenses_fts_docsize"].count == 2
356 |     # Bug: insert with replace increases the number of rows in _docsize:
357 |     db["licenses"].insert_all(licenses, pk="key", replace=True)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
358 |     assert db["licenses_fts_docsize"].count == 4
359 |     # rebuild should fix this:
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `rebuild_fts` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:360:5
    |
358 |     assert db["licenses_fts_docsize"].count == 4
359 |     # rebuild should fix this:
360 |     db["licenses_fts"].rebuild_fts()
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361 |     assert db["licenses_fts_docsize"].count == 2
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:375:5
    |
373 | def test_enable_fts_replace(kwargs):
374 |     db = Database(memory=True)
375 |     db["books"].insert(
    |     ^^^^^^^^^^^^^^^^^^
376 |         {
377 |             "id": 1,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `triggers` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:384:16
    |
382 |     )
383 |     db["books"].enable_fts(["title", "author"])
384 |     assert not db["books"].triggers
    |                ^^^^^^^^^^^^^^^^^^^^
385 |     assert db["books_fts"].columns_dict.keys() == {"title", "author"}
386 |     assert "FTS5" in db["books_fts"].schema
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:missing-argument: No argument provided for required parameter `columns` of bound method `enable_fts`
   --> tests/test_fts.py:392:5
    |
390 |     if "columns" not in kwargs:
391 |         kwargs["columns"] = ["title", "author"]
392 |     db["books"].enable_fts(**kwargs, replace=True)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
393 |     # Check that the new configuration is correct
394 |     if should_have_changed_columns:
    |
info: `lint:missing-argument` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `triggers` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:397:16
    |
395 |         assert db["books_fts"].columns_dict.keys() == set(["title"])
396 |     if "create_triggers" in kwargs:
397 |         assert db["books"].triggers
    |                ^^^^^^^^^^^^^^^^^^^^
398 |     if "fts_version" in kwargs:
399 |         assert "FTS4" in db["books_fts"].schema
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:407:5
    |
405 |     queries = []
406 |     db = Database(memory=True, tracer=lambda sql, params: queries.append((sql, params)))
407 |     db["books"].insert(
    |     ^^^^^^^^^^^^^^^^^^
408 |         {
409 |             "id": 1,
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:missing-argument: No argument provided for required parameter `columns` of bound method `enable_fts`
   --> tests/test_fts.py:427:9
    |
425 |     db.create_view("hello", "select 1 + 1")
426 |     with pytest.raises(NotImplementedError) as e:
427 |         db["hello"].enable_fts()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
428 |         assert e.value.args[0] == "enable_fts() is supported on tables but not on views"
    |
info: `lint:missing-argument` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:634:5
    |
632 | def test_search_sql(kwargs, fts, expected):
633 |     db = Database(memory=True)
634 |     db["books"].insert(
    |     ^^^^^^^^^^^^^^^^^^
635 |         {
636 |             "title": "Habits of Australian Marsupials",
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `search_sql` on type `Table | View` is possibly unbound
   --> tests/test_fts.py:641:11
    |
639 |     )
640 |     db["books"].enable_fts(["title", "author"], fts_version=fts)
641 |     sql = db["books"].search_sql(**kwargs)
    |           ^^^^^^^^^^^^^^^^^^^^^^
642 |     assert sql == expected
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_get.py:1:8
  |
1 | import pytest
  |        ^^^^^^
2 | from sqlite_utils.db import NotFoundError
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_gis.py:2:8
  |
1 | import json
2 | import pytest
  |        ^^^^^^
3 |
4 | from click.testing import CliRunner
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_gis.py:4:6
  |
2 | import pytest
3 |
4 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
5 | from sqlite_utils.cli import cli
6 | from sqlite_utils.db import Database
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `sqlean`
  --> tests/test_gis.py:10:12
   |
 9 | try:
10 |     import sqlean
   |            ^^^^^^
11 | except ImportError:
12 |     sqlean = None
   |
info: `lint:unresolved-import` is enabled by default

error: lint:invalid-argument-type: Argument to this function is incorrect
  --> tests/test_gis.py:53:9
   |
51 |         geometry_type="Point",
52 |         srid=4326,
53 |         coord_dimension=2,
   |         ^^^^^^^^^^^^^^^^^ Expected `str`, found `Literal[2]`
54 |     )
   |
info: Function defined here
    --> sqlite_utils/db.py:3725:9
     |
3723 |         )
3724 |
3725 |     def add_geometry_column(
     |         ^^^^^^^^^^^^^^^^^^^
3726 |         self,
3727 |         column_name: str,
3728 |         geometry_type: str,
3729 |         srid: int = 4326,
3730 |         coord_dimension: str = "XY",
     |         --------------------------- Parameter declared here
3731 |         not_null: bool = False,
3732 |     ) -> bool:
     |
info: `lint:invalid-argument-type` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `get` on type `Table | View` is possibly unbound
  --> tests/test_gis.py:56:12
   |
54 |     )
55 |
56 |     assert db["geometry_columns"].get(["locations", "geometry"]) == {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
57 |         "f_table_name": "locations",
58 |         "f_geometry_column": "geometry",
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
   --> tests/test_gis.py:144:13
    |
142 |     db.init_spatialite()
143 |
144 |     table = db["locations"].create({"name": str})
    |             ^^^^^^^^^^^^^^^^^^^^^^
145 |
146 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `get` on type `Table | View` is possibly unbound
   --> tests/test_gis.py:160:12
    |
158 |     assert result.exit_code == 0
159 |
160 |     assert db["geometry_columns"].get(["locations", "geometry"]) == {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
161 |         "f_table_name": "locations",
162 |         "f_geometry_column": "geometry",
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
   --> tests/test_gis.py:175:13
    |
173 |     db = Database(str(db_path))
174 |     db.init_spatialite()
175 |     table = db["locations"].create({"name": str})
    |             ^^^^^^^^^^^^^^^^^^^^^^
176 |
177 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `get` on type `Table | View` is possibly unbound
   --> tests/test_gis.py:194:12
    |
192 |     assert result.exit_code == 0
193 |
194 |     assert db["geometry_columns"].get(["locations", "geometry"]) == {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
195 |         "f_table_name": "locations",
196 |         "f_geometry_column": "geometry",
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
   --> tests/test_gis.py:213:13
    |
211 |     db.init_spatialite()
212 |
213 |     table = db["locations"].create({"name": str})
    |             ^^^^^^^^^^^^^^^^^^^^^^
214 |
215 |     result = CliRunner().invoke(
    |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `create` on type `Table | View` is possibly unbound
   --> tests/test_gis.py:236:13
    |
234 |     db.init_spatialite()
235 |
236 |     table = db["locations"].create({"name": str})
    |             ^^^^^^^^^^^^^^^^^^^^^^
237 |     table.add_geometry_column("geometry", "POINT")
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `hypothesis`
 --> tests/test_hypothesis.py:1:6
  |
1 | from hypothesis import given
  |      ^^^^^^^^^^
2 | import hypothesis.strategies as st
3 | import sqlite_utils
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `hypothesis.strategies`
 --> tests/test_hypothesis.py:2:8
  |
1 | from hypothesis import given
2 | import hypothesis.strategies as st
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | import sqlite_utils
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_hypothesis.py:13:5
   |
11 |         "integer": integer,
12 |     }
13 |     db["test"].insert(row)
   |     ^^^^^^^^^^^^^^^^^
14 |     assert list(db["test"].rows) == [row]
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_hypothesis.py:23:5
   |
21 |         "text": text,
22 |     }
23 |     db["test"].insert(row)
   |     ^^^^^^^^^^^^^^^^^
24 |     assert list(db["test"].rows) == [row]
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_hypothesis.py:33:5
   |
31 |         "binary": binary,
32 |     }
33 |     db["test"].insert(row)
   |     ^^^^^^^^^^^^^^^^^
34 |     assert list(db["test"].rows) == [row]
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_hypothesis.py:43:5
   |
41 |         "floats": floats,
42 |     }
43 |     db["test"].insert(row)
   |     ^^^^^^^^^^^^^^^^^
44 |     assert list(db["test"].rows) == [row]
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_insert_files.py:2:6
  |
1 | from sqlite_utils import cli, Database
2 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
3 | import os
4 | import pathlib
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_insert_files.py:5:8
  |
3 | import os
4 | import pathlib
5 | import pytest
  |        ^^^^^^
6 | import sys
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `pks` on type `Table | View` is possibly unbound
   --> tests/test_insert_files.py:115:20
    |
113 |             for row in (one, two, three):
114 |                 assert isinstance(row[colname], expected_type)
115 |         assert set(db["files"].pks) == set(expected_pks)
    |                    ^^^^^^^^^^^^^^^
    |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_introspect.py:2:8
  |
1 | from sqlite_utils.db import Index, View, Database, XIndex, XIndexColumn
2 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_lookup.py:2:8
  |
1 | from sqlite_utils.db import Index
2 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_m2m.py:2:8
  |
1 | from sqlite_utils.db import ForeignKey, NoObviousTable
2 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_plugins.py:1:6
  |
1 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
2 | import click
3 | import importlib
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click`
 --> tests/test_plugins.py:2:8
  |
1 | from click.testing import CliRunner
2 | import click
  |        ^^^^^
3 | import importlib
4 | from sqlite_utils import cli, Database, hookimpl, plugins
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_recipes.py:4:8
  |
2 | from sqlite_utils.utils import sqlite3
3 | import json
4 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_recreate.py:4:8
  |
2 | import sqlite3
3 | import pathlib
4 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_recreate.py:31:9
   |
29 |     if create_file_first:
30 |         db = Database(filepath)
31 |         db["t1"].insert({"foo": "bar"})
   |         ^^^^^^^^^^^^^^^
32 |         assert ["t1"] == db.table_names()
33 |         db.close()
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_recreate.py:34:5
   |
32 |         assert ["t1"] == db.table_names()
33 |         db.close()
34 |     Database(filepath, recreate=True)["t2"].insert({"foo": "bar"})
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 |     assert ["t2"] == Database(filepath).table_names()
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_register_function.py:2:8
  |
1 | # flake8: noqa
2 | import pytest
  |        ^^^^^^
3 | import sys
4 | from unittest.mock import MagicMock, call
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:unresolved-reference: Name `first` used when not defined
  --> tests/test_register_function.py:61:12
   |
59 |         # Raise exception only first time this is called
60 |         nonlocal first
61 |         if first:
   |            ^^^^^
62 |             first = False
63 |             raise sqlite3.NotSupportedError()
   |
info: `lint:unresolved-reference` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_rows.py:1:8
  |
1 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_rows_from_file.py:3:8
  |
1 | from sqlite_utils.utils import rows_from_file, Format, RowError
2 | from io import BytesIO, StringIO
3 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:invalid-argument-type: Argument to this function is incorrect
  --> tests/test_rows_from_file.py:51:24
   |
49 | def test_rows_from_file_error_on_string_io():
50 |     with pytest.raises(TypeError) as ex:
51 |         rows_from_file(StringIO("id,name\r\n1,Cleo"))
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `BinaryIO`, found `StringIO`
52 |     assert ex.value.args == (
53 |         "rows_from_file() requires a file-like object that supports peek(), such as io.BytesIO",
   |
info: Function defined here
   --> sqlite_utils/utils.py:236:5
    |
236 | def rows_from_file(
    |     ^^^^^^^^^^^^^^
237 |     fp: BinaryIO,
    |     ------------ Parameter declared here
238 |     format: Optional[Format] = None,
239 |     dialect: Optional[Type[csv.Dialect]] = None,
    |
info: `lint:invalid-argument-type` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `click.testing`
 --> tests/test_sniff.py:2:6
  |
1 | from sqlite_utils import cli, Database
2 | from click.testing import CliRunner
  |      ^^^^^^^^^^^^^
3 | import pathlib
4 | import pytest
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_sniff.py:4:8
  |
2 | from click.testing import CliRunner
3 | import pathlib
4 | import pytest
  |        ^^^^^^
5 |
6 | sniff_dir = pathlib.Path(__file__).parent / "sniff"
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_suggest_column_types.py:1:8
  |
1 | import pytest
  |        ^^^^^^
2 | from collections import OrderedDict
3 | from sqlite_utils.utils import suggest_column_types
  |
info: `lint:unresolved-import` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_tracer.py:9:5
   |
 7 |         memory=True, tracer=lambda sql, params: collected.append((sql, params))
 8 |     )
 9 |     db["dogs"].insert({"name": "Cleopaws"})
   |     ^^^^^^^^^^^^^^^^^
10 |     db["dogs"].enable_fts(["name"])
11 |     db["dogs"].search("Cleopaws")
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `search` on type `Table | View` is possibly unbound
  --> tests/test_tracer.py:11:5
   |
 9 |     db["dogs"].insert({"name": "Cleopaws"})
10 |     db["dogs"].enable_fts(["name"])
11 |     db["dogs"].search("Cleopaws")
   |     ^^^^^^^^^^^^^^^^^
12 |     assert collected == [
13 |         ("PRAGMA recursive_triggers=on;", None),
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_tracer.py:43:5
   |
41 |     db = Database(memory=True)
42 |
43 |     db["dogs"].insert({"name": "Cleopaws"})
   |     ^^^^^^^^^^^^^^^^^
44 |     db["dogs"].enable_fts(["name"])
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `search` on type `Table | View` is possibly unbound
  --> tests/test_tracer.py:49:14
   |
48 |     with db.tracer(tracer):
49 |         list(db["dogs"].search("Cleopaws"))
   |              ^^^^^^^^^^^^^^^^^
50 |
51 |     assert len(collected) == 5
   |
info: `lint:possibly-unbound-attribute` is enabled by default

warning: lint:possibly-unbound-attribute: Attribute `insert` on type `Table | View` is possibly unbound
  --> tests/test_tracer.py:98:5
   |
97 |     # Outside the with block collected should not be appended to
98 |     db["dogs"].insert({"name": "Cleopaws"})
   |     ^^^^^^^^^^^^^^^^^
99 |     assert len(collected) == 5
   |
info: `lint:possibly-unbound-attribute` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_transform.py:3:8
  |
1 | from sqlite_utils.db import ForeignKey, TransformError
2 | from sqlite_utils.utils import OperationalError
3 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_update.py:4:8
  |
2 | import json
3 |
4 | import pytest
  |        ^^^^^^
5 |
6 | from sqlite_utils.db import NotFoundError
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_upsert.py:2:8
  |
1 | from sqlite_utils.db import PrimaryKeyRequired
2 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_utils.py:4:8
  |
2 | import csv
3 | import io
4 | import pytest
  |        ^^^^^^
  |
info: `lint:unresolved-import` is enabled by default

error: lint:no-matching-overload: No overload of function `__new__` matches arguments
  --> tests/test_utils.py:38:19
   |
36 | def test_chunks(size, expected):
37 |     input = ["a", "b", "c", "d"]
38 |     chunks = list(map(list, utils.chunks(input, size)))
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 |     assert chunks == expected
   |
info: `lint:no-matching-overload` is enabled by default

error: lint:unresolved-import: Cannot resolve imported module `pytest`
 --> tests/test_wal.py:1:8
  |
1 | import pytest
  |        ^^^^^^
2 | from sqlite_utils import Database
  |
info: `lint:unresolved-import` is enabled by default

Found 331 diagnostics
@simonw
Copy link
Author

simonw commented May 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment