Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/cli-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,13 @@ See :ref:`cli_convert`.

The following common operations are available as recipe functions:

r.jsonsplit(value, delimiter=',', type=<class 'str'>)
r.jsonsplit(value: 'str', delimiter: 'str' = ',', type: 'Callable[[str],
object]' = <class 'str'>) -> 'str'

Convert a string like a,b,c into a JSON array ["a", "b", "c"]

r.parsedate(value, dayfirst=False, yearfirst=False, errors=None)
r.parsedate(value: 'str', dayfirst: 'bool' = False, yearfirst: 'bool' = False,
errors: 'Optional[object]' = None) -> 'Optional[str]'

Parse a date and convert it to ISO date format: yyyy-mm-dd

Expand All @@ -628,7 +630,8 @@ See :ref:`cli_convert`.
- errors=r.IGNORE to ignore values that cannot be parsed
- errors=r.SET_NULL to set values that cannot be parsed to null

r.parsedatetime(value, dayfirst=False, yearfirst=False, errors=None)
r.parsedatetime(value: 'str', dayfirst: 'bool' = False, yearfirst: 'bool' =
False, errors: 'Optional[object]' = None) -> 'Optional[str]'

Parse a datetime and convert it to ISO datetime format: yyyy-mm-ddTHH:MM:SS

Expand Down
35 changes: 33 additions & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
[mypy]
python_version = 3.10
warn_return_any = False
warn_unused_configs = True
warn_redundant_casts = False
warn_unused_ignores = False
check_untyped_defs = True
disallow_untyped_defs = False
disallow_incomplete_defs = False
no_implicit_optional = True
strict_equality = True

[mypy-pysqlite3,sqlean,sqlite_dump]
ignore_missing_imports = True
[mypy-sqlite_utils.cli]
ignore_errors = True

[mypy-pysqlite3.*]
ignore_missing_imports = True

[mypy-sqlean.*]
ignore_missing_imports = True

[mypy-sqlite_dump.*]
ignore_missing_imports = True

[mypy-sqlite_fts4.*]
ignore_missing_imports = True

[mypy-pandas.*]
ignore_missing_imports = True

[mypy-numpy.*]
ignore_missing_imports = True

[mypy-tests.*]
ignore_errors = True
4 changes: 2 additions & 2 deletions sqlite_utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ def insert_upsert_implementation(
csv_reader_args["delimiter"] = delimiter
if quotechar:
csv_reader_args["quotechar"] = quotechar
reader = csv_std.reader(decoded, **csv_reader_args)
reader = csv_std.reader(decoded, **csv_reader_args) # type: ignore
first_row = next(reader)
if no_headers:
headers = ["untitled_{}".format(i + 1) for i in range(len(first_row))]
Expand Down Expand Up @@ -2988,7 +2988,7 @@ def _generate_convert_help():
n
for n in dir(recipes)
if not n.startswith("_")
and n not in ("json", "parser")
and n not in ("json", "parser", "Callable", "Optional")
and callable(getattr(recipes, n))
]
for name in recipe_names:
Expand Down
Loading
Loading