What happened?
When calling the join() method of an actor (or _stop() or probably any method defined by the @actor decorator) we get an error from mypy complaining about the method not existing in the actor class, for example:
test.py:10: error: "SampleActor" has no attribute "join"
pylint seems to be complaining too.
What did you expect instead?
No errors when calling the method.
Affected version(s)
All
Affected part(s)
Actors
Extra information
The typing_extensions package (#19), in particular the @dataclass_transform() decorator, might help with this, it needs further investigation.
As a workaround, # noqa can be used when the method is called.
Here is an example where we need to use # noqa:
|
await distributor._stop() # type: ignore # pylint: disable=no-member |
What happened?
When calling the
join()method of an actor (or_stop()or probably any method defined by the@actordecorator) we get an error frommypycomplaining about the method not existing in the actor class, for example:pylintseems to be complaining too.What did you expect instead?
No errors when calling the method.
Affected version(s)
All
Affected part(s)
Actors
Extra information
The
typing_extensionspackage (#19), in particular the@dataclass_transform()decorator, might help with this, it needs further investigation.As a workaround,
# noqacan be used when the method is called.Here is an example where we need to use
# noqa:frequenz-sdk-python/tests/power_distribution/test_power_distributor.py
Line 193 in 20e1dff