BeanieODM / beanie

Asynchronous Python ODM for MongoDB
http://beanie-odm.dev/
Apache License 2.0
2.02k stars 213 forks source link

[BUG] Mypy Strict fails with call to untyped function "Set" in typed context [no-untyped-call] error #946

Open AndrewMHenry opened 3 months ago

AndrewMHenry commented 3 months ago

Describe the bug This is the same basic bug as #836, except it applies to BaseUpdateGeneralOperator instead of BaseFindComparisonOperator.

To Reproduce Running mypy in strict mode produces error: Call to untyped function "Set" in typed context [no-untyped-call] for the call to Set on line 10 of the following Python code:

from beanie import Document
from beanie.odm.operators.update.general import Set

class Sample(Document):
    one: int

def main() -> None:
    Set({Sample.one: 2})

Expected behavior There should be no mypy errors.

Additional context Pull request #925 will fix issue #836, but it will not fix this one; fixing this issue would require also type-hinting the return value of BaseUpdateGeneralOperator.__init__(). It might be worth diving into the code to see if there are other similar instances, although I don't know of any right now.

Thanks!

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 14 days with no activity.