Repository navigation
Conversation
enekoreto
left a comment
There was a problem hiding this comment.
Looks good to me. I checked out the branch (5d85cdf): the new cases fail on main (8bfd726, 5 sync and 5 async) and pass here, also on Python 3.10. The aiosqlite file also passes with BURR_CI_INTEGRATION_TESTS=true, the way the persisters job runs it, and CI's main test command passes.
I also ran a randomized check against a plain-Python reference (latest timestamp first, then the last row inserted at that timestamp): 300 random save histories with lots of timestamp ties, sync and async. On main, list_app_ids("pk")[0] disagreed with load("pk", None) in 54 of them. With this change the order matched the reference and the first app matched load in all 300.
Small thing, not blocking: the Postgres persisters still order by MAX(created_at) with no tie-break (b_psycopg2.py:160, b_asyncpg.py:295). With microsecond timestamps it should be much rarer there, so fine to leave out of this PR. I didn't run Postgres.
I ran this on Python 3.13 on macOS with SQLite 3.53.0, and the tests also on 3.10.
SQLite's default
CURRENT_TIMESTAMPhas second-level precision. After #942,list_app_ids()lists each app once and orders by its latest timestamp, but apps saved within the same second still have unspecified ordering. A caller such as the YouTube-to-social-media notebook, which resumeslist_app_ids("")[0], can therefore pick a different app fromload("", None), whose timestamp ties were fixed in #920.Changes
list_app_ids()deterministic: keep each app's maximumcreated_atas the primary key, then use the greatestrowidamong rows at that timestamp.None/""default-partition behavior. No schema migration or other backend changes.How I tested this
Environment: Windows, Python 3.11.2, SQLite 3.39.4, aiosqlite 0.22.1.
Before the implementation change, the 20 new cases produced 10 failures and 10 passes. Afterward:
Both commands used
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1. The four visualization tests were excluded because Graphviz'sdotexecutable is unavailable locally; these are not a full-repository or cross-version CI result.The applicable pre-commit checks passed for all four changed files (Black, isort, flake8, AST, whitespace/EOF, ASF header). The frontend-only hook was excluded; no frontend files changed.
git diff --checkpassed.Additional local checks: 12 diagnostic cases passed, plus 100 deterministic randomized datasets matched an independent timestamp/rowid reference ordering, including nullable timestamps and partition isolation.
Notes
load()tie-breaker. It does not promise row identity across externally rewritten databases.rowid; independentMAX(created_at), MAX(rowid)aggregates can describe different checkpoints.Checklist