You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a2a3d5
Browse filesBrowse the repository at this point in the historyBrowse files
Merge PR #26 (audriB backend hardening) into current main
PR #26 was opened against 361df8d, before #27 landed, and had gone
un-mergeable. Its SQLite/packaging fixes are still needed: run against
current main, 22 of its 24 new tests fail. Its lint work, however, is
superseded -- #27 solved the same problem the other way.
Kept (all of the hardening):
- LIKE/regexp metacharacter escaping in hasfield/isa and
contains_string/depends_on; get_docs IN-clause chunking.
- _do_add_doc atomicity (branch checked before any INSERT, rollback plus
fields-cache restore on every failure path) and OnDuplicate.
- binarydoc_matfid fails loudly instead of using an uninitialized Fileobj.
- example_schema JSON shipped in the wheel, with the wheel-smoke CI job.
- doc2sql class_name-first superclass resolution and list-of-dict expansion.
- isa diamond-parity fixtures; symmetry missing-artifact skips become failures.
Dropped (superseded by #27):
- The [tool.ruff.lint] select = ["E4","E7","E9","F"] narrowing. #27 fixed all
56 findings and pinned ruff==0.16.5/black==26.5.1 instead, which is the
better fix and is already on main. The dependency bounds and package-data
from the same commit are kept.
- The import-sort commit, subsumed by #27's repo-wide I001 pass.
- The Document()/Document('base') constructor fix: main already builds both
via the database_documents definition path. Only the narrow guard that
converts a descriptor-list 'base' to a defaults dict survives, on the legacy
database_schema fallback path, where base.schema.json still stores 'base' as
a list.
Conflict resolutions:
- database.add_docs takes both sides: main's validate=True/validate_docs pass
and the PR's OnDuplicate member check.
- sqlitedb._do_add_doc takes the PR's handler. Main's FOREIGN KEY -> ValueError
translation is subsumed by the up-front branch existence check, and its
swallowing of duplicate IntegrityErrors is exactly what OnDuplicate replaces.
- document.py keeps main's _reset_file_info and _merge_superclasses alongside
the PR's _utc_timestamp and _field_descriptors_to_defaults.
- base.datestamp is now ISO-8601 milliseconds + 'Z', per base.schema.json's own
default ('2018-12-05T18:36:47.241Z') and DID-matlab's UTCLeapSeconds output.
Main's _utcnow() in document.py was a DTZ003 lint rename that preserved the
space-separated, tz-less form; it is gone. file.py's unrelated _utcnow stays.
- test_add_docs_atomicity passes validate=False: it exercises _do_add_doc's
transaction handling with synthetic stub documents (class 'thing', short
non-UID ids) that main's new schema validation rejects before _do_add_doc is
reached.
Verified on the merged tree with the pinned toolchain: ruff 0.16.5 and
black 26.5.1 both clean over src/ and tests/; pytest 139 passed, 1 skipped,
1 xfailed; wheel built, installed into a clean venv, and Document('demoA') /
Document('base') constructed from outside the repo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4rNahWHpwiLTUZv3DskN8
0 commit comments