-
Notifications
You must be signed in to change notification settings - Fork 105
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
Enable Pydantic I/O types in workflow context #1189
base: main
Are you sure you want to change the base?
Enable Pydantic I/O types in workflow context #1189
Commits on Oct 9, 2024
-
Factor out common _SCRIPT_PYDANTIC_IO_FLAG check
Code to check if _SCRIPT_PYDANTIC_IO_FLAG is set and error if not occurs twice; factor out into a shared utility function. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0dd8bcd - Browse repository at this point
Copy the full SHA 0dd8bcdView commit details -
Stop disabling declaring in _create_subnode
_create_subnode temporarily disables _context.declaring to avoid triggering the altered `__getattribute__` behaviour in TemplateInvocatorSubNodeMixin in two situations: - Pydantic's implementation of `!=`, which is attempting to read field values, and will raise a validation error due to the altered field names being of incorrect type. - Accessing `__class__` on a Pydantic subnode object with no build_obj set. Instead, fix this by: - Using `is not` instead of `!=`, which is correct where we use it, and also faster. - Fixing `__getattribute__` to no longer fail if used on an object with no build_obj set. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e22caac - Browse repository at this point
Copy the full SHA e22caacView commit details -
Enable Pydantic I/O types in workflow context
Extend experimental Pydantic I/O support to allow passing Pydantic types into `@script`-decorated functions when inside a `with` workflow context block, and using fields on the returned Pydantic output as shorthand for the associated Hera template in subsequent steps. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f5b912e - Browse repository at this point
Copy the full SHA f5b912eView commit details -
Add tests for the new Pydantic I/O syntax
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 74520a9 - Browse repository at this point
Copy the full SHA 74520a9View commit details -
Clear current task dependencies in DAG._add_sub
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8b394e4 - Browse repository at this point
Copy the full SHA 8b394e4View commit details -
Allow passing depends in a @w.dag context
Currently, TemplateDecoratorFuncMixin._create_subnode unconditionally adds a depends kwarg, causing a runtime error if the user also supplies one. Instead, prefer the user-supplied one. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 082f1b8 - Browse repository at this point
Copy the full SHA 082f1b8View commit details -
Move Step/Task creation to Steps/Parallel/DAG
Move the logic that creates the right leaf node for Steps, Parallel and DAG to a _create_leaf_node method on those types. DAG now specifies how to default the depends parameter to Task based on its _current_task_depends field. This simplifies the duplicated logic in _meta_mixins to a simple isinstance check for any of those three types, followed by a _create_leaf_node call. Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 48124bb - Browse repository at this point
Copy the full SHA 48124bbView commit details -
Move new syntax behind decorator_syntax feature
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9972d0c - Browse repository at this point
Copy the full SHA 9972d0cView commit details -
Fix name of experimental feature message function
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bed0b59 - Browse repository at this point
Copy the full SHA bed0b59View commit details -
Update new examples to Python 3.9 (logical merge conflict)
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 991edd7 - Browse repository at this point
Copy the full SHA 991edd7View commit details -
Create a new experimental flag
Add a new experimental flag to gate use of Pydantic types in a workflow context manager Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f0456d1 - Browse repository at this point
Copy the full SHA f0456d1View commit details -
Document incremental migration option
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f263f56 - Browse repository at this point
Copy the full SHA f263f56View commit details