Closed
Description
As a follow-up from this non-issue in pydantic_settings, I want to file this issue here. pydantic-bump seem to import ConfigDict
from wrong package. And – if I got it right – it should import SettingsConfigDict
in my example instead of ConfigDict
.
I had this config in Pydantic v1:
from typing import Literal
from pydantic import BaseSettings
class Config(BaseSettings):
log_level: Literal["NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] = "WARNING"
class Config:
env_file = ".env"
Then, I executed dump-pydantic and got the following config file:
from typing import Literal
from pydantic import ConfigDict
from pydantic_settings import BaseSettings
class Config(BaseSettings):
log_level: Literal["NOTSET", "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] = "WARNING"
model_config = ConfigDict(env_file=".env")
As one can see bump-pydantic imported ConfigDict
from pydantic instead from pydantic_settings
. And as the example uses SettingsConfigDict
, I think bump-pydantic should use that as well.
Metadata
Metadata
Assignees
Labels
No labels