mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-27 03:14:33 +02:00
flake8 fixes
This commit is contained in:
parent
da93cf115e
commit
93114feefb
3 changed files with 8 additions and 6 deletions
|
|
@ -19,11 +19,9 @@ import tabulate
|
|||
from .utils import (
|
||||
file_progress,
|
||||
find_spatialite,
|
||||
progressbar,
|
||||
sqlite3,
|
||||
decode_base64_values,
|
||||
rows_from_file,
|
||||
types_for_column_types,
|
||||
Format,
|
||||
TypeTracker,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ from .utils import (
|
|||
)
|
||||
from collections import namedtuple
|
||||
from collections.abc import Mapping
|
||||
import click
|
||||
import contextlib
|
||||
import datetime
|
||||
import decimal
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from sqlite_utils import recipes
|
||||
from sqlite_utils.utils import sqlite3
|
||||
import json
|
||||
import pytest
|
||||
|
||||
|
|
@ -73,7 +72,10 @@ def test_jsonsplit(fresh_db, delimiter):
|
|||
)
|
||||
fn = recipes.jsonsplit
|
||||
if delimiter is not None:
|
||||
fn = lambda value: recipes.jsonsplit(value, delimiter=delimiter)
|
||||
|
||||
def fn(value):
|
||||
return recipes.jsonsplit(value, delimiter=delimiter)
|
||||
|
||||
fresh_db["example"].convert("tags", fn)
|
||||
assert list(fresh_db["example"].rows) == [
|
||||
{"id": 1, "tags": '["foo", "bar"]'},
|
||||
|
|
@ -98,6 +100,9 @@ def test_jsonsplit_type(fresh_db, type, expected):
|
|||
)
|
||||
fn = recipes.jsonsplit
|
||||
if type is not None:
|
||||
fn = lambda value: recipes.jsonsplit(value, type=type)
|
||||
|
||||
def fn(value):
|
||||
return recipes.jsonsplit(value, type=type)
|
||||
|
||||
fresh_db["example"].convert("records", fn)
|
||||
assert json.loads(fresh_db["example"].get(1)["records"]) == expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue