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

Removed references to SequentialTaskRunner #13996

Merged
merged 3 commits into from
Jun 13, 2024
Merged

Removed references to SequentialTaskRunner #13996

merged 3 commits into from
Jun 13, 2024

Conversation

mthatt
Copy link
Contributor

@mthatt mthatt commented Jun 12, 2024

I had this brought up by someone who found that their usage of SequentialTaskRunner was no longer working. I've changed the explanation and examples of task runners to explain how tasks are sequential by default, and concurrent by default, when using .submit().

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.

For documentation changes:

  • This pull request includes redirect settings in mint.json for files that are removed or renamed.

For new functions or classes in the Python SDK:

  • This pull request includes helpful docstrings.
  • If a new Python file was added, this pull request contains a stub page in the Python SDK docs and an entry in docs/mint.json navigation.

Copy link
Contributor

@billpalombi billpalombi left a comment

Choose a reason for hiding this comment

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

Thank you! I committed a couple other changes. I hope you don't mind.

Comment on lines +9 to +10
Task runners are not required for task execution. Calling a task function directly without a task runner executes the
function sequentially by default. Execution of a task function blocks execution of its flow until the task completes.
Copy link
Collaborator

@zzstoatzz zzstoatzz Jun 13, 2024

Choose a reason for hiding this comment

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

Suggested change
Task runners are not required for task execution. Calling a task function directly without a task runner executes the
function sequentially by default. Execution of a task function blocks execution of its flow until the task completes.
Task runners are not required for task execution. Directly calling a function decorated with `@task` executes it like a normal python function, that is, it blocks execution of the parent flow run until the task completes.

@flow(task_runner=DaskTaskRunner())
def dask_subflow():
hello_dask.submit()

@flow(task_runner=ConcurrentTaskRunner())
Copy link
Collaborator

@zzstoatzz zzstoatzz Jun 13, 2024

Choose a reason for hiding this comment

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

wouldn't be needed since each subflow specifies its own task_runner already

Suggested change
@flow(task_runner=ConcurrentTaskRunner())
@flow

Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

thanks! a couple comments


<Note>
Copy link
Collaborator

Choose a reason for hiding this comment

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

perhaps we could keep an admonition like "SequentialTaskRunner is longer necessary, just call your task" or link to task concept page since it seems likely that people will have used it for one reason or another and come here looking for it after installing 3.x / breaking imports

@mthatt mthatt merged commit 0ebc904 into main Jun 13, 2024
4 checks passed
@mthatt mthatt deleted the task-runner-docs branch June 13, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants