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 V2 Configuration Warning #26

Open
patrickwasp opened this issue Nov 14, 2024 · 0 comments
Open

Pydantic V2 Configuration Warning #26

patrickwasp opened this issue Nov 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@patrickwasp
Copy link

Pydantic V2 Configuration Warning with FastAPI Users + SQLModel

Describe the bug

Pydantic V2 configuration warning appears when using FastAPI Users with SQLModel: UserWarning: Valid config keys have changed in V2: 'orm_mode' has been renamed to 'from_attributes'

To Reproduce

Steps to reproduce the behavior:

  1. Create a FastAPI application using SQLModel and FastAPI Users
  2. Import the fastapi_users_db_sqlmodel module
  3. Run the application
  4. Warning appears in console output from pydantic internal config

Expected behavior

No warnings should appear when using FastAPI Users with SQLModel, as the configuration should be compatible with Pydantic V2.

Configuration

  • Python version: 3.12
  • FastAPI version: latest
  • FastAPI Users version: latest

FastAPI Users configuration

from fastapi_users.db import SQLAlchemyBaseUserTable
from sqlmodel import SQLModel

class User(SQLModel, SQLAlchemyBaseUserTable):
    class Config:
        arbitrary_types_allowed = True

Additional context

@patrickwasp patrickwasp added the bug Something isn't working label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant