Skip to content
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

feat+fix(engine)!: Support enums and defaults in Action Templates #644

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

topher-lo
Copy link
Contributor

@topher-lo topher-lo commented Dec 21, 2024

What changed?

  • Fixes issue where arguments with defaults do not show up in the action run. Fixed by validated arguments (i.e. creating the expectation model) before running the template action.
  • Updates validate_args method to return model_schema_inputs with json mode (i.e. enum instances are coerced into string)
  • Drop unused validate conditional in _run_action_direct (this path isn't used anywhere in the code)
  • Replaced all references to tracecat_registry._internal.exceptions.TracecatValidationError with tracecat.types.exceptions.TracecatValidationError

Note: we had to make key in TracecatValidationError optional and serializable in order to bypass Ray's issue reraising instances of exceptions. ray-project/ray#8948. Unsure why but unless all init variables for the exception are optional, ray seems to keep raising the TypeError with missing key. See reference for example.

Screenshot 2024-12-22 at 4 51 03 PM

References

ray serialization error

@topher-lo topher-lo requested a review from daryllimyt December 21, 2024 06:16
@topher-lo topher-lo added engine Improvements or additions to the workflow engine breaking Breaking changes labels Dec 21, 2024
Copy link
Contributor

@daryllimyt daryllimyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor change

tracecat/registry/actions/models.py Outdated Show resolved Hide resolved
Signed-off-by: Chris Lo <[email protected]>
Copy link
Contributor

@daryllimyt daryllimyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking changes engine Improvements or additions to the workflow engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants