-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
2.6.0 breaks environment variable loading #445
Comments
Thanks @palfrey for reporting this. I will check it |
@palfrey I've investigated the problem and it comes from a change from me. you are using the model_validate in your code. Probably the old current behavior was wrong and the current one is right. can't you change your code to class BaseSettings(PydanticBaseSettings):
@classmethod
def load(cls: type[_Model]) -> _Model:
return cls() BTW, we can revert my change but I would like to keep it if you can fix the problem on your side. Please let me know. |
We can change on our side, that's fine, especially as I've just done some testing and the revised code is fine on both 2.5.2 and 2.6.0. I'm not quite sure where we got the Thanks for investigating! |
Myself and my team use the |
There is a mypy plugin for pydantic that solves the problem for mypy. Unfortunately there isn't anything for pyright |
No worries, we'll go the |
We use |
@jessemyers-lettuce @rseeley @palle-k I will discuss with the team about reverting the change that made |
Thanks, I'd also be perfectly happy with another mechanism that achieves partial construction without running afoul of type checkers. |
I discussed this with the team and we decided to find a way to make For now please stay on Thanks for your feedback! |
The following code works with 2.5.2, but not 2.6.0
I've gone through all the changes between the versions, but I'm not seeing anything obvious that's broken this?
The text was updated successfully, but these errors were encountered: