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

HEP0001 - new DAG decorator #1043

Closed
elliotgunton opened this issue Apr 25, 2024 · 0 comments · Fixed by #1059
Closed

HEP0001 - new DAG decorator #1043

elliotgunton opened this issue Apr 25, 2024 · 0 comments · Fixed by #1059
Assignees
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement

Comments

@elliotgunton
Copy link
Collaborator

See https://github.com/argoproj-labs/hera/blob/main/hep/proposals/0001-decorators.md#dag-template

@elliotgunton elliotgunton added this to the HEP0001 - new decorators milestone Apr 25, 2024
@elliotgunton elliotgunton self-assigned this Apr 25, 2024
@elliotgunton elliotgunton added type:enhancement A general enhancement semver:minor A change requiring a minor version bump labels Apr 25, 2024
@elliotgunton elliotgunton changed the title HEP0001 - new DAG/Steps decorator HEP0001 - new DAG decorator Apr 25, 2024
@elliotgunton elliotgunton mentioned this issue May 7, 2024
4 tasks
samj1912 pushed a commit that referenced this issue May 15, 2024
**Pull Request Checklist**
- [x] Fixes #1043 
- [x] Tests added
- [ ] Documentation/examples added
- [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR
title

**Description of PR**
Adds the new dag decorator from HEP0001.

* Within the decorator function call we perform a static inspection of
inputs and outputs, add a `DAG` object to the Workflow, and finally
do a "run" of the DAG function code using a templated input to collect
the tasks
* Tasks that pass arguments simply take the templated input strings by
using pydantic's `construct` method to skip validation, and then pass
the strings around
* The dependencies between tasks are inferred automatically via
__getattr__ calls
on the Task object
* Add varname as a dependency to be able to get the python variable name
to use
as the task name (in the YAML)
* Make the _add_type_hints function work for *any* pydantic class

---------

Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant