Apply black formatting

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E7af8SxFZqiCerJB6MqKnY
This commit is contained in:
Claude 2026-07-07 15:03:27 +00:00
commit f9554d36e4
No known key found for this signature in database
2 changed files with 5 additions and 9 deletions

View file

@ -4532,9 +4532,7 @@ class Table(Queryable):
else:
first_record_dict = cast(Dict[str, Any], first_record)
if hash_id:
self.last_pk = hash_record(
first_record_dict, hash_id_columns
)
self.last_pk = hash_record(first_record_dict, hash_id_columns)
elif isinstance(pk, str):
self.last_pk = first_record_dict[
resolve_casing(pk, first_record_dict)
@ -4587,9 +4585,7 @@ class Table(Queryable):
self.last_rowid = result.lastrowid
# A rowid-alias pk resolves directly to the rowid, so there
# is no separate pk column to look up
rowid_pk = (
isinstance(pk, str) and pk.lower() in ROWID_ALIASES
)
rowid_pk = isinstance(pk, str) and pk.lower() in ROWID_ALIASES
if (hash_id or (pk and not rowid_pk)) and self.last_rowid:
# Set self.last_pk to the pk(s) for that rowid
row = list(self.rows_where("rowid = ?", [self.last_rowid]))[0]

View file

@ -998,9 +998,9 @@ def test_insert_ignore_reports_existing_row(fresh_db):
table = fresh_db["docs"].insert({"id": 1, "title": "One"}, ignore=True)
assert table.last_rowid == 1
assert table.last_pk == 1
assert list(
fresh_db["docs"].rows_where("rowid = ?", [table.last_rowid])
) == [{"id": 1, "title": "Exists"}]
assert list(fresh_db["docs"].rows_where("rowid = ?", [table.last_rowid])) == [
{"id": 1, "title": "Exists"}
]
@pytest.mark.parametrize("rowid_alias", ("rowid", "_rowid_", "oid"))