Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lesnek
Copy link

@lesnek lesnek commented Jan 8, 2025

Typing PR

@@ -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
Copy link
Author

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

@lesnek lesnek changed the title #429 feat(typing): Add typing to workflow methods #429 feat(typing): Add typing Jan 8, 2025
@lesnek lesnek changed the title #429 feat(typing): Add typing feat(typing): Add typing Jan 8, 2025
@@ -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)
Copy link
Author

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)
Copy link
Author

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

@lesnek lesnek marked this pull request as ready for review January 8, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant