Skip to content

Fix pydantic example to include arbitrary_types_allowed config#1627

Open
veeceey wants to merge 4 commits intoaio-libs:masterfrom
veeceey:fix/issue-1624
Open

Fix pydantic example to include arbitrary_types_allowed config#1627
veeceey wants to merge 4 commits intoaio-libs:masterfrom
veeceey:fix/issue-1624

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 8, 2026

Summary

  • Fixes docs: arbitrary_types_allowed needed in Pydantic example #1624
  • The pydantic usage example in the docs was missing the required model_config = ConfigDict(arbitrary_types_allowed=True) setting, causing a PydanticSchemaGenerationError when users followed the example verbatim
  • Updated the code example to import ConfigDict and set arbitrary_types_allowed=True, and adjusted the prose to mention this requirement

What changed

docs/index.rst: Updated the pydantic example to include:

from pydantic import BaseModel, ConfigDict
from yarl import URL

class Model(BaseModel):
    model_config = ConfigDict(arbitrary_types_allowed=True)

    url: URL

CHANGES/1624.doc.rst: Added a towncrier changelog fragment for this documentation fix.

Test plan

  • Verify the docs render correctly (RST syntax is valid)
  • Verify the example works with pydantic>=2.0 and current yarl

…ibs#1624)

The pydantic usage example was missing the required
`model_config = ConfigDict(arbitrary_types_allowed=True)` setting,
causing a PydanticSchemaGenerationError when users followed the docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Feb 8, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 8, 2026

Merging this PR will not alter performance

✅ 99 untouched benchmarks


Comparing veeceey:fix/issue-1624 (e94f79d) with master (7829b01)

Open in CodSpeed

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (7829b01) to head (e94f79d).

❌ Your project check has failed because the head coverage (97.63%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1627   +/-   ##
=======================================
  Coverage   99.37%   99.37%           
=======================================
  Files          30       30           
  Lines        5940     5940           
  Branches      282      282           
=======================================
  Hits         5903     5903           
  Misses         22       22           
  Partials       15       15           
Flag Coverage Δ
CI-GHA 99.37% <ø> (ø)
MyPy 97.63% <ø> (ø)
OS-Linux 99.73% <ø> (ø)
OS-Windows 98.66% <ø> (ø)
OS-macOS 98.80% <ø> (ø)
Py-3.10.11 98.63% <ø> (ø)
Py-3.10.19 99.65% <ø> (ø)
Py-3.11.14 99.65% <ø> (ø)
Py-3.11.9 98.63% <ø> (ø)
Py-3.12.10 98.63% <ø> (ø)
Py-3.12.12 99.65% <ø> (ø)
Py-3.13.11 99.70% <ø> (ø)
Py-3.13.11t ?
Py-3.13.12t 99.70% <ø> (ø)
Py-3.14.2 99.70% <ø> (ø)
Py-3.14.2t ?
Py-3.14.3t 99.70% <ø> (ø)
Py-pypy3.10.16-7.3.19 99.31% <ø> (ø)
VM-macos-latest 98.80% <ø> (ø)
VM-ubuntu-latest 99.73% <ø> (ø)
VM-windows-latest 98.66% <ø> (ø)
pytest 99.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

veeceey and others added 3 commits February 8, 2026 15:48
The lint CI was failing because the GitHub Actions runner had stale
package indices, causing 404 errors when fetching glib2.0 dependencies
of libenchant-2-dev. Adding apt-get update refreshes the package lists
before the install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove trailing underscore from `pydantic_` in the changelog
fragment to avoid an RST "Unknown target name" error during
the sphinx doc-spelling lint step, since the `_pydantic`
hyperlink target is only defined in docs/index.rst.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@veeceey
Copy link
Author

veeceey commented Feb 16, 2026

The Windows CI failure on Test (3.13, windows-latest) appears to be unrelated to the changes in this PR — the Codecov uploader fails with a SHA256SUM verification error (Could not verify SHASUM) during the upload step, which is a known transient infrastructure issue with the Codecov CLI on Windows runners. All actual tests pass across all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: arbitrary_types_allowed needed in Pydantic example

1 participant

Comments