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

Pydantic 2.1.1 #546

Closed
anton-petrov opened this issue Jul 27, 2023 · 5 comments · Fixed by #603
Closed

Pydantic 2.1.1 #546

anton-petrov opened this issue Jul 27, 2023 · 5 comments · Fixed by #603

Comments

@anton-petrov
Copy link

Need support for newest pydantic 2.1.1, just released 2023-07-25

redis-om (0.2.1) depends on pydantic (>=1.10.2,<2.1.0)

@hudrazine
Copy link

+1 Likewise, support for pydantic 2.1.x or higher is required but is blocked by redis-om (0.2.1).

@anton-petrov
Copy link
Author

anton-petrov commented Jul 30, 2023

Everyone who doesn't want to wait can use my repository https://github.com/anton-petrov/redis-om-python and install package directly from github. I have already tested redis-om with pydantic 2.1.1 on a production project.

For example, for poetry project, add this line to pyproject.toml:

redis-om = {git = "https://github.com/anton-petrov/redis-om-python.git"}

@PARKER-X
Copy link

Hii Guys can u help me
My code https://github.com/PARKER-X/Microservices-Fastapi
@app.get('/products')
def all():
return Product.all_pks()
my code is not working give fastapi response model error!

@PARKER-X
Copy link

Error:===

raise fastapi.exceptions.FastAPIError(

fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that <class 'inventory.schema.Product'> is a valid Pydantic field type. If you are using a return type annotation that is not a valid Pydantic field (e.g. Union[Response, dict, None]) you can disable generating the response model from the type annotation with the path operation decorator parameter response_model=None. Read more: https://fastapi.tiangolo.com/tutorial/response-model/

@loureirorg
Copy link

loureirorg commented Dec 23, 2023

Overriding the dependency check worked for me:

pip install pydantic==2.5 --force-reinstall

The command triggered a dependency error, yet it successfully installed pydantic 2.5 alongside redis-om 0.2.1.

I use Conda/Mamba as my virtual environment manager. I believe it's worth trying this approach even if you don't use Conda/Mamba.

Note that it's not possible to force a version via Conda's environment.yml. However, if you're using Docker (e.g., in devcontainers), you can include the pip install ... command in the Dockerfile file after creating the Conda environment. That will install the latest versions of pydantic and redis-om.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants