Support for nested indexing?
- Dominant language
- Python
- Stars
- 72
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
**What happened**:
Nested indexing doesn't seem to be supported.
**What you expected to happen**:
Maybe it's not in the scope of this library, but it would be great if the mutable mapping felt more like a dictionary.
**Minimal Complete Verifiable Example**:
```python
import pickle
import zlib
from zict import File, Func, LRU
l4 = File("cache/", mode="a")
l3 = Func(zlib.compress, zlib.decompress, l4)
l2 = Func(pickle.dumps, pickle.loads, l3)
l1 = LRU(100, l2)
l1["foo"] = {}
l1["foo"]
# {}
l1["foo"]["bar"] = {}
l1["foo"]["bar"]
# Traceback (most recent call last):
# File "", line 1, in
# KeyError: 'bar'
```
**Anything else we need to know?**:
I'd like to use zict [in akernel to cache the execution of cells](https://github.com/davidbrochart/akernel/pull/35). It currently uses a dictionary for the cache, and I thought I would be able to swap if with a mutable mapping from zict.
**Environment**:
- Dask version: N/A
- Python version: 3.10
- Operating System: Ubuntu 21.04
- Install method (conda, pip, source): pip
Contributor guide
Research direction
Start by reproducing the nested-indexing example with the File, Func, and LRU mappings shown in the issue, then inspect how these Mutable Mapping layers handle reads and writes. Done should define and implement behavior that makes nested updates persist like dictionary updates, with tests covering the reported example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100