-
Notifications
You must be signed in to change notification settings - Fork 578
Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels