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

Fix a regression in dotenv optional nested field #423

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

hramezani
Copy link
Member

No description provided.

@hramezani hramezani force-pushed the issue-420 branch 2 times, most recently from 97a1289 to afa09bb Compare September 26, 2024 10:50
@hsuyuming
Copy link

Let me pull this branch and test it within my local. Will provide the feedback when i get the result. Thank you!

@hsuyuming
Copy link

hsuyuming commented Sep 27, 2024

Hi @hramezani :

I cloned your "issue-420" branch and installed it using pip install -e .. After testing, this fix resolved the issue. I truly appreciate your quick response and excellent work!

(.venv) user@jupyter:~/abehsu/pydantic-settings$ pip install -e .
Obtaining file:///home/user/abehsu/pydantic-settings
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: pydantic>=2.7.0 in ./.venv/lib/python3.10/site-packages (from pydantic-settings==2.5.2) (2.9.1)
Requirement already satisfied: python-dotenv>=0.21.0 in ./.venv/lib/python3.10/site-packages (from pydantic-settings==2.5.2) (1.0.1)
Requirement already satisfied: annotated-types>=0.6.0 in ./.venv/lib/python3.10/site-packages (from pydantic>=2.7.0->pydantic-settings==2.5.2) (0.7.0)
Requirement already satisfied: pydantic-core==2.23.3 in ./.venv/lib/python3.10/site-packages (from pydantic>=2.7.0->pydantic-settings==2.5.2) (2.23.3)
Requirement already satisfied: typing-extensions>=4.6.1 in ./.venv/lib/python3.10/site-packages (from pydantic>=2.7.0->pydantic-settings==2.5.2) (4.12.2)
Building wheels for collected packages: pydantic-settings
  Building editable for pydantic-settings (pyproject.toml) ... done
  Created wheel for pydantic-settings: filename=pydantic_settings-2.5.2-py3-none-any.whl size=3008 sha256=97aad59cab642606f0923ccbc2fa3338f682b31ecfce35798d4ff61220b9ca4f
  Stored in directory: /tmp/pip-ephem-wheel-cache-2yrcwtb0/wheels/26/74/6f/a4558daf38621005fce811c2e94a8d499c396a7ff00be6fccf
Successfully built pydantic-settings
Installing collected packages: pydantic-settings
  Attempting uninstall: pydantic-settings
    Found existing installation: pydantic-settings 2.5.2
    Uninstalling pydantic-settings-2.5.2:
      Successfully uninstalled pydantic-settings-2.5.2
Successfully installed pydantic-settings-2.5.2
(.venv) user@jupyter~/abehsu/pydantic-settings$ python /home/user/abehsu/pydantic-settings/test.py
contents=InputModel(el_type='input', class_name='123', value=None)

@hramezani
Copy link
Member Author

hramezani commented Sep 27, 2024

Thanks @hsuyuming for checking!

The fix will be available in the next release.

@hramezani hramezani merged commit f3a25f2 into main Sep 27, 2024
18 checks passed
@hramezani hramezani deleted the issue-420 branch September 27, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants