-
Notifications
You must be signed in to change notification settings - Fork 106
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 16, 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 9b0fa03 - Browse repository at this point
Copy the full SHA 9b0fa03View 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 6976d84 - Browse repository at this point
Copy the full SHA 6976d84View 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 d9a5d1d - Browse repository at this point
Copy the full SHA d9a5d1dView 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 90fd3bb - Browse repository at this point
Copy the full SHA 90fd3bbView 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 310658a - Browse repository at this point
Copy the full SHA 310658aView 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 4d1d257 - Browse repository at this point
Copy the full SHA 4d1d257View 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 853fb10 - Browse repository at this point
Copy the full SHA 853fb10View 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 f474926 - Browse repository at this point
Copy the full SHA f474926View 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 f90d3c9 - Browse repository at this point
Copy the full SHA f90d3c9View 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 f201ef1 - Browse repository at this point
Copy the full SHA f201ef1View 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 5969aa5 - Browse repository at this point
Copy the full SHA 5969aa5View commit details -
Document incremental migration option
Signed-off-by: Alice Purcell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 461785e - Browse repository at this point
Copy the full SHA 461785eView commit details