Repository navigation
Commit d5bf5a1
committed
docs(model): correct the model and config docstrings
Ten findings from the 2026-08-13 audit, all in the published API
reference:
- M1 bind() claimed every config key can be bound late; it has no
use_revision parameter and _config.py says the opposite. Names
the five bindable keys, states the exception, and gains the Args
and Raises sections it never had.
- M2 update() claimed "every other write verb" enforces Unique.
Four update verbs do not. Names the six instance-level writes
that enforce and the five update verbs that do not.
- M3 update()'s summary said non-field keys "pass through
unchanged" — true only under extra_keys="allow", not the
"reject" default its own Args section documents.
- M4 insert_many()'s Raises omitted UniqueConstraintError.
- M5 twelve Raises omissions across four exception types
(UniqueConstraintError, RevisionUpdateError, QueryTypeError,
pydantic.ValidationError) on the public read and write verbs.
The raising helpers are private, so the reference surfaced them
nowhere.
- M6 __pydantic_init_subclass__ omitted ConstraintFieldError.
- M7 the before_write no-hook list named two verbs where five
apply, and _config.py's validate_writes note named a different
incomplete pair.
- M8 the metaclass and field() described class-level access as
returning where(), not a GuardedQuery — contradicting _query.py
in the same reference.
- M9 "transform callable is handed to TinyDB as-is" describes only
the validate_writes=False fast path; on every other path
tinydantic runs it, rotates revision_id after it, and validates
its output.
- M10 an orphaned comment, upsert()'s missing Args, search()'s
missing Args and Returns, the extra="forbid" caveat on merged
validation, and the order-insensitive constraint collapse now
linked to #142.
Also refreshes _check_doc_ids_exist's stale `doc_ids=` spelling.
Assisted-by: Claude:claude-opus-51 parent 297faa0 commit d5bf5a1
3 files changed
Lines changed: 196 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
0 commit comments