Add dummy factory methods for ExecuteSuccessEvent and ExecuteFailureEvent#6687
Add dummy factory methods for ExecuteSuccessEvent and ExecuteFailureEvent#6687crusaderky merged 5 commits intodask:mainfrom
dummy factory methods for ExecuteSuccessEvent and ExecuteFailureEvent#6687Conversation
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 15 files ± 0 15 suites ±0 6h 13m 51s ⏱️ - 16m 31s For more details on these failures, see this check. Results for commit 6a15062. ± Comparison against base commit f7f6501. |
distributed/worker_state_machine.py
Outdated
| else: | ||
| TaskStateState = str | ||
|
|
||
| Type = type |
There was a problem hiding this comment.
What mypy madness makes this necessary?
There was a problem hiding this comment.
mypy complains about type being used as a type for type and pyupgrade force-corrects from typing import Type.
There was a problem hiding this comment.
Specifically, I think mypy is confused by type also being an instance variable on the dataclass.
There was a problem hiding this comment.
but how comes it worked before?!?
There was a problem hiding this comment.
mypy only got confused in the scope of dummy, where it suddenly had 3 options for type:
- instance variable
- type class
- function parameter
distributed/worker_state_machine.py
Outdated
| start: float = 0.0, | ||
| stop: float = 1.0, | ||
| nbytes: int = 8, | ||
| type_: Type | None = None, |
There was a problem hiding this comment.
| type_: Type | None = None, | |
| type: Type | None = None, |
I think ideally, dummy would have the same signature as the non-dummy __init__.
There was a problem hiding this comment.
Done, this was a remnant from mypy complaining about type being used as a type for type. I double-checked and switching the variable name is not a problem.
|
I removed the option to pass fields like exception, start, stop, etc. as they're all inconsequential to the worker state |
Addresses #6676 (comment)
pre-commit run --all-files