-
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 Sep 24, 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 b372ba8 - Browse repository at this point
Copy the full SHA b372ba8View 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 d5bb695 - Browse repository at this point
Copy the full SHA d5bb695View 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 7115e24 - Browse repository at this point
Copy the full SHA 7115e24View 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 d2dd3d7 - Browse repository at this point
Copy the full SHA d2dd3d7View 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 9055bb5 - Browse repository at this point
Copy the full SHA 9055bb5View 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 6209b2e - Browse repository at this point
Copy the full SHA 6209b2eView 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 c6a5bdc - Browse repository at this point
Copy the full SHA c6a5bdcView 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 f012868 - Browse repository at this point
Copy the full SHA f012868View 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 af1bcef - Browse repository at this point
Copy the full SHA af1bcefView commit details