sbdchd / celery-types

:seedling: Type stubs for Celery and its related packages
Apache License 2.0
87 stars 41 forks source link

0.15.0 -> 0.17.0 error: "List[Dict[str, Any]]" has no attribute "items" [attr-defined] #123

Open max-wittig opened 1 year ago

max-wittig commented 1 year ago

Hi! Thanks for creating celery-types.

Since 0.17.0, the following type seems to be wrongly identified. The code below shows a working example. I'm guessing that inspect.active() just returns a dict.

def example(inspect: celery.app.control.Inspect):
    active = inspect.active()
    for _, tasks in active.items():   # error: List[Dict[str, Any]]" has no attribute "items"  [attr-defined] ## happens here
        print(task["type"])