Closed mitrydoug closed 2 months ago
Attention: Patch coverage is 90.00000%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 81.8%. Comparing base (
d553546
) to head (c4653ef
). Report is 81 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
src/hera/workflows/io/_io_mixins.py | 66.6% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
applying a simplifying commit and additional test
applying one more change, please do not merge
@mitrydoug can you please update the PR description with the motivation behind the implementation and also add some comments to the code describing "why" we are performing certain operations? For eg the copy.
I removed the logic about finding a unique Parameter/Artifact since it became clear to me that the remainder of the codebase assumes Parameters/Artifacts to be at index 1 of Annotated
, so I wanted to stay consistent with that.
@samj1912 I have updated my PR description, and commented on the copy.
From my end, this is ready to go.
the remainder of the codebase assumes Parameters/Artifacts to be at index 1
Yeah we haven't heard any complaints from people who want to use more Annotations, so if/when they do we should convert all these parts of the codebase at once
Pull Request Checklist
Summary
Currently, users cannot leverage inheritance when defining
RunnerInput
models that utilizeAnnotated
fields. For example:This would fail at runtime with a KeyError at this line, because apparently
cls.__annotations__
are not inherited by child classes.This PR enables the above inheritance structure by utilizing the existing get_field_annotations instead of
my_runner_input.__annotations__
.Parameter Default Names
This PR also changes logic so that
Input
fieldParameters
adopt the name of their field if no name is provided. For example, inThe parameter is converted to
Parameter(name="my_int", description="this is my int")
. This avoids an error from here which is thrown when trying to generate a workflow yaml.