-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(typing): Add typing #432
base: main
Are you sure you want to change the base?
Conversation
@@ -6,4 +6,4 @@ indent_size = 4 | |||
end_of_line = lf | |||
insert_final_newline = true | |||
trim_trailing_whitespace = true | |||
max_line_length = 79 | |||
max_line_length = 140 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff setup is on 140 characters, does not make sense to prevent IDE
@@ -78,26 +90,26 @@ def __init__(self, workflow, task_spec, parent=None, state=TaskState.MAYBE, id=N | |||
self._state = state | |||
|
|||
self.triggered = False | |||
self.task_spec = task_spec | |||
self.task_spec = task_spec if task_spec else StartTask(workflow.spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this, check by pyright/mypy introduces the possibility of task_spec being None, but in the case of None task_spec, a lot of stuff cannot properly work.
I can delete this "fix" for typing, but it is something to consider.
if parent is not None: | ||
self.parent._child_added_notify(self) | ||
if _parent := self.parent: | ||
_parent._child_added_notify(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix to conform typing, to check if the self.parent method really is not None
Typing PR