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(events): add missing classvar to events, add validators for deserialization of events #6451

Merged

Conversation

psychedelicious
Copy link
Collaborator

Summary

Two fixes for pydantic events handling.

Related Issues / Discussions

n/a

QA Instructions

n/a

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

This improves types for event consumers that need to access the event name.
This is required to get these event fields to deserialize correctly. If omitted, pydantic uses `BaseInvocation`/`BaseInvocationOutput`, which is not correct.

This is similar to the workaround in the `Graph` and `GraphExecutionState` classes where we need to fanagle pydantic with manual validation handling.
@github-actions github-actions bot added python PRs that change python files services PRs that change app services labels May 28, 2024
@hipsterusername hipsterusername merged commit 21aa426 into main May 28, 2024
14 checks passed
@hipsterusername hipsterusername deleted the psyche/feat/events/invocation-pydantic-validator branch May 28, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants