Skip to content

Conversation

@CalebCourier
Copy link
Collaborator

@CalebCourier CalebCourier commented Sep 12, 2024

PR Summary

  • Refactors validator_service.py into a directory with different files for the different implementations of ValidatorService
  • Updates AsyncValidatorService to always run validators concurrently
  • Uses the default executor on the obtained event loop so that the user can specify threads vs processes if they want/need to.
  • Performs corrections on individual ValidationResults instead of many
  • Includes uv extra which installs uvloop for use within validator service
  • Increases Unit and Integration test coverage of AsynvValidatorService
  • Introduces Validator.async_validate
    • This allows users to create validators with async validation logic
    • This allows validation to be async all the way down to enable better concurrency
    • Backfills existing validators by running the synchronous Validator.validate method in the event loop's default executor
  • Adds a ser/de wrapped merge function to allow fix_value merging for builtin types plus Pydantic models and Dataclasses

TODO

  • Profile updated AsyncValidatorService vs previous implementation with and without run_in_separate_process on validators
  • Better type custom onfail function
  • Document on fail behaviour

@CalebCourier CalebCourier requested review from a team, nichwch and zsimjee September 12, 2024 17:43
@CalebCourier CalebCourier marked this pull request as ready for review September 12, 2024 22:10
dtam
dtam previously approved these changes Sep 17, 2024
Copy link
Contributor

@dtam dtam left a comment

Choose a reason for hiding this comment

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

some spelling updates in the doc updates but otherwise lgtm

Co-authored-by: dtam <[email protected]>
CalebCourier and others added 2 commits September 17, 2024 13:12
Co-authored-by: dtam <[email protected]>
Co-authored-by: dtam <[email protected]>
@dtam dtam merged commit 2ec1ee5 into main Sep 17, 2024
12 checks passed
@dtam dtam deleted the async-validator-service branch September 17, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants