mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-29 13:24:12 +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 (
|
from .utils import (
|
||||||
file_progress,
|
file_progress,
|
||||||
find_spatialite,
|
find_spatialite,
|
||||||
progressbar,
|
|
||||||
sqlite3,
|
sqlite3,
|
||||||
decode_base64_values,
|
decode_base64_values,
|
||||||
rows_from_file,
|
rows_from_file,
|
||||||
types_for_column_types,
|
|
||||||
Format,
|
Format,
|
||||||
TypeTracker,
|
TypeTracker,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ from .utils import (
|
||||||
)
|
)
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
import click
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
from sqlite_utils import recipes
|
from sqlite_utils import recipes
|
||||||
from sqlite_utils.utils import sqlite3
|
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
@ -73,7 +72,10 @@ def test_jsonsplit(fresh_db, delimiter):
|
||||||
)
|
)
|
||||||
fn = recipes.jsonsplit
|
fn = recipes.jsonsplit
|
||||||
if delimiter is not None:
|
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)
|
fresh_db["example"].convert("tags", fn)
|
||||||
assert list(fresh_db["example"].rows) == [
|
assert list(fresh_db["example"].rows) == [
|
||||||
{"id": 1, "tags": '["foo", "bar"]'},
|
{"id": 1, "tags": '["foo", "bar"]'},
|
||||||
|
|
@ -98,6 +100,9 @@ def test_jsonsplit_type(fresh_db, type, expected):
|
||||||
)
|
)
|
||||||
fn = recipes.jsonsplit
|
fn = recipes.jsonsplit
|
||||||
if type is not None:
|
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)
|
fresh_db["example"].convert("records", fn)
|
||||||
assert json.loads(fresh_db["example"].get(1)["records"]) == expected
|
assert json.loads(fresh_db["example"].get(1)["records"]) == expected
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue