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

Upgrade to Pydantic V2 models #281

Merged
merged 7 commits into from
Feb 14, 2025
Merged

Conversation

tylerhutcherson
Copy link
Collaborator

@tylerhutcherson tylerhutcherson commented Feb 13, 2025

This PR introduces pydantic ^2.0.0 models, validators, and techniques. The implementation here improves performance of model construction and validation. It also introduces best practices when possible related to validators and serialization. Because RedisVL was already on pydantic v2, this change should not impact any end users as we already required this version and had been relying on the v1 shim.

@abrookins
Copy link
Collaborator

Beast PR 🔥

@tylerhutcherson tylerhutcherson force-pushed the feat/RAAE-607-pydantic-upgrade branch from d02025d to 744a515 Compare February 14, 2025 16:57
@tylerhutcherson tylerhutcherson changed the title Use Pydantic V2 models Upgrade to Pydantic V2 models Feb 14, 2025
@tylerhutcherson tylerhutcherson marked this pull request as ready for review February 14, 2025 16:59
@@ -110,7 +110,7 @@ def __init__(
existing_index = SearchIndex.from_existing(
name, redis_client=self._index.client
)
if existing_index.schema != self._index.schema:
if existing_index.schema.to_dict() != self._index.schema.to_dict():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Glad this worked, this is what I was going to suggest!

@tylerhutcherson tylerhutcherson force-pushed the feat/RAAE-607-pydantic-upgrade branch from b37ba34 to 3f10f1c Compare February 14, 2025 18:14
@tylerhutcherson tylerhutcherson merged commit 20c69bd into main Feb 14, 2025
36 checks passed
@tylerhutcherson tylerhutcherson deleted the feat/RAAE-607-pydantic-upgrade branch February 14, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants