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
ops functions cannot see write guards, value caches or preset hooks of a wrapper #3
Follow-up from the adversarial review of #2 (fix for #1).
The free functions in cosmodol.ops (replace_item, batch_items, delete_container, ...) resolve keys through every wrapping layer (_id_of_key), values through _data_of_obj, and, since #2, check k in store through the outer store before acting on an existing resource (so filt_iter scopes are honoured). Three things a function still cannot see, all documented in the cosmodol/ops.py module docstring:
Write guards: a layer whose own __setitem__/__delitem__ refuses (a read-only wrapper) is bypassed.
Value caches: cache_vals-style layers keep the pre-write value after replace_item/batch_items.
Key-aware preset= hooks (wrap_kvs(preset=...)) are not applied to replace_item/batch_items values; returned documents are in stored (leaf) form.
Creating operations (batch create/upsert, add_container, add_database) cannot consult a scope filter, since the key does not exist yet.
None of these is a regression (the old methods bypassed all of them too). Options: refuse when any layer overrides __setitem__/__delitem__ beyond dol.base.Store and is not a known-transparent dol wrapper (but filt_iter/cached_keys override them too, and the prefix-view pattern needs them); or wait for dol's is-a wrapping direction (i2mint/dol discussion #86), which would make methods correct again.
Activity