diff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py index c902295..d53a77c 100644 --- a/sqlite_utils/cli.py +++ b/sqlite_utils/cli.py @@ -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( diff --git a/tests/test_cli.py b/tests/test_cli.py index 5526d4d..0e01814 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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"]