-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple bugs in IO mixins (#1193)
**Pull Request Checklist** - [X] Fixes #1190, fixes #1165 - [X] Tests added - [ ] Documentation/examples added - [X] [Good commit messages](https://cbea.ms/git-commit/) and/or PR title **Description of PR** Currently, the methods that consume annotations in InputMixin and OutputMixin have multiple bugs: - ignoring fields with a workflow annotation with no name - ignoring fields with a Pydantic annotation and no workflow annotation - `OutputMixin._get_outputs` additionally was: * mutating the original annotations without copying them * ignoring the model default if a workflow annotation was present but had no default This PR pulls out a common function to iterate through fields and yield annotations, which: - copies the annotations so they cannot be accidentally changed - ignores unrecognized annotations (this is a requirement of the Annotated spec, and fixes the issue with Pydantic annotations) - defaults the annotation name to the field name if unset This ensures all functions treat an explicit Parameter and a missing workflow annotation the same way, solving the second issue with `OutputMixin._get_outputs`. --------- Signed-off-by: Alice Purcell <alicederyn@gmail.com> Signed-off-by: Elliot Gunton <elliotgunton@gmail.com> Co-authored-by: Elliot Gunton <elliotgunton@gmail.com>
- Loading branch information
1 parent
af5b19f
commit 3e58f22
Showing
2 changed files
with
618 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.