Revisit custom id
field types and type: ignore[assignment]
#7
Labels
improvement
This issue or pull request will add or improve functionality, maintainability, or ease of use
need info
This issue or pull request requires further information
on hold
This pull request is awaiting an action or decision to move forward
💡 Summary
We've added
# type: ignore[assignment]
directives to theid
fields of our models that use types other thanObjectId
. In the case of Beanie the type is actuallyPydanticObjectId
.This directive is used in the following models:
CVEDoc
HostDoc
KEVDoc
PlaceDoc
RequestDoc
TallyDoc
Motivation and context
The following code, when used in a beanie
Document
will generate the type error below:The guidance in BeanieODM/beanie#12 does not work. I expect this is due to the current state of typing in Beanie. There is an ongoing effort to remedy this: BeanieODM/beanie#1050
The work-around is to ignore the assignment:
Once BeanieODM/beanie#1050 is resolved we should be able to remove the
# type: ignore[assignment]
directives. 🤞See:
The text was updated successfully, but these errors were encountered: