Skip to content

Conversation

@lesnek
Copy link

@lesnek lesnek commented Jan 8, 2025

Typing PR

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

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
def _predict(self, mask=TaskState.NOT_FINISHED_MASK):
"""Predict tasks with the provided mask"""
def _predict(self, mask: int = TaskState.NOT_FINISHED_MASK) -> None:
"""Predict tasks with the provided mask."""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add docstring for mask.

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.

2 participants