Applied Black

This commit is contained in:
Simon Willison 2019-07-14 21:04:43 -07:00
commit 71a3bc26c9
2 changed files with 7 additions and 2 deletions

View file

@ -302,7 +302,9 @@ def insert_upsert_options(fn):
),
click.argument("table"),
click.argument("json_file", type=click.File(), required=True),
click.option("--pk", help="Columns to use as the primary key, e.g. id", multiple=True),
click.option(
"--pk", help="Columns to use as the primary key, e.g. id", multiple=True
),
click.option("--nl", is_flag=True, help="Expect newline-delimited JSON"),
click.option("-c", "--csv", is_flag=True, help="Expect CSV"),
click.option(

View file

@ -429,7 +429,10 @@ def test_insert_multiple_with_primary_key(db_path, tmpdir):
def test_insert_multiple_with_compound_primary_key(db_path, tmpdir):
json_path = str(tmpdir / "dogs.json")
dogs = [{"breed": "mixed", "id": i, "name": "Cleo {}".format(i), "age": i + 3} for i in range(1, 21)]
dogs = [
{"breed": "mixed", "id": i, "name": "Cleo {}".format(i), "age": i + 3}
for i in range(1, 21)
]
open(json_path, "w").write(json.dumps(dogs))
result = CliRunner().invoke(
cli.cli, ["insert", db_path, "dogs", json_path, "--pk", "id", "--pk", "breed"]