• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

msiemens / tinydb / 26256609337
98%

Build:
DEFAULT BRANCH: master
Ran 21 May 2026 10:23PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
26256609337

push

github

web-flow
fix: skip missing doc_ids in Table.update and Table.remove (#616)

`Table.get(doc_id=N)` and `Table.get(doc_ids=[N])` already return
silently when the requested document does not exist, but
`Table.update(doc_ids=[N])` and `Table.remove(doc_ids=[N])` raise
`KeyError`. The four code paths are documented and named symmetrically,
so the asymmetric behaviour is surprising and was raised as a bug in
issue #591.

Worse, when a mix of existing and missing IDs is passed to `update`,
the first existing documents are mutated in place before the
`KeyError` is raised. The storage write is then skipped by
`_update_table`, but documents are shared by reference between the
in-memory copy and the table dict, so subsequent reads still see the
half-applied update. The operation is neither atomic nor recoverable.

Filter the requested IDs against the live table *inside* the updater,
before performing any side effects, and return only the IDs that were
actually updated/removed. This:

* makes the four `get`/`update`/`remove` paths consistent;
* makes both operations atomic - either every existing target is
  affected, or none is;
* lets `upsert` drop its now-unreachable `except KeyError` branch
  (`update` simply returns `[]` when nothing matched, which falls
  through the existing `if updated_docs:` guard into the insert
  path).

Regression coverage is added in `tests/test_tinydb.py` for the missing,
mixed and cross-method-consistency cases.

Fixes #591
Source Files on build 26256609337
Detailed source file information is not available for this build.
  • Back to Repo
  • 76d21d26 on github
  • Prev Build on master (#26188216701)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc