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

Allow tasks to return products. #404

Merged
merged 8 commits into from
Aug 27, 2023
Merged

Conversation

tobiasraabe
Copy link
Member

@tobiasraabe tobiasraabe commented Aug 1, 2023

Changes

  • Allow tasks to produce by returning values. The produced nodes are specified as return-type annotations.

    def task_example() -> Annotated[str, PathNode("out.txt")]:
        return "Hello, World!"
  • Allow a similar interface via @pytask.mark.task(produces=...) for the Python API to declare product types for return values.

Todo

  • Rewrite all existing node types such that they use .load and .save

@tobiasraabe tobiasraabe added this to the v0.4.0 milestone Aug 1, 2023
@tobiasraabe tobiasraabe changed the base branch from main to v4 August 1, 2023 07:36
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

❗ No coverage uploaded for pull request base (v4@37d244e). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 70e5de9 differs from pull request most recent head 75e3659. Consider uploading reports for the commit 75e3659 to get more accurate results

@@          Coverage Diff          @@
##             v4     #404   +/-   ##
=====================================
  Coverage      ?   95.62%           
=====================================
  Files         ?       94           
  Lines         ?     8254           
  Branches      ?        0           
=====================================
  Hits          ?     7893           
  Misses        ?      361           
  Partials      ?        0           
Flag Coverage Δ
end_to_end 82.92% <0.00%> (?)
integration 39.62% <0.00%> (?)
unit 66.06% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@tobiasraabe tobiasraabe marked this pull request as ready for review August 27, 2023 15:49
@tobiasraabe tobiasraabe merged commit 0c4b0c5 into v4 Aug 27, 2023
15 checks passed
@tobiasraabe tobiasraabe deleted the draft-allow-tasks-to-return branch August 27, 2023 16:06
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.

None yet

1 participant