mypy annotations for rows_from_file(), run mypy in CI

Refs #289, #279
This commit is contained in:
Simon Willison 2021-06-22 11:04:32 -07:00
commit 7b3fdf0fcd
4 changed files with 26 additions and 18 deletions

View file

@ -11,7 +11,7 @@ import json
import os
import pathlib
import re
from sqlite_fts4 import rank_bm25
from sqlite_fts4 import rank_bm25 # type: ignore
import sys
import textwrap
import uuid
@ -39,14 +39,14 @@ USING\s+(?P<using>\w+) # e.g. USING FTS5
)
try:
import pandas as pd
import pandas as pd # type: ignore
except ImportError:
pd = None
try:
import numpy as np
import numpy as np # type: ignore
except ImportError:
np = None
np = None # type: ignore
Column = namedtuple(
"Column", ("cid", "name", "type", "notnull", "default_value", "is_pk")