The type hints for Table.update say that if fields is Callable, then it must map Mapping to None. This probably either needs to be Callable[[MutableMapping], None] or Callable[[Mapping], Mapping].
For instance, the delete operation creates a "transform" function that deletes a key. But
def transform(doc: Mapping) -> None:
del doc[field]
is invalid since Mapping doesn't have __delitem__: https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes.
So either doc should be MutableMapping, or the operation should return the updated doc:
def transform(doc: Mapping) -> dict:
doc = dict(doc)
del doc[field]
return doc
The type hints for
Table.updatesay that iffieldsisCallable, then it must mapMappingtoNone. This probably either needs to beCallable[[MutableMapping], None]orCallable[[Mapping], Mapping].For instance, the
deleteoperation creates a "transform" function that deletes a key. Butis invalid since
Mappingdoesn't have__delitem__: https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes.So either
docshould beMutableMapping, or the operation should return the updated doc: