Skip to content

docs: remove final pydantic v1 traces#3036

Merged
koxudaxi merged 1 commit intomainfrom
followup/remove-final-pydantic-v1-traces
Mar 8, 2026
Merged

docs: remove final pydantic v1 traces#3036
koxudaxi merged 1 commit intomainfrom
followup/remove-final-pydantic-v1-traces

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

@koxudaxi koxudaxi commented Mar 8, 2026

Summary

  • replace the last parse_obj() example in GraphQL docs with model_validate()
  • remove remaining Pydantic v1 mentions from internal comments
  • sync docs/llms-full.txt with the GraphQL doc example

Validation

  • pre-commit hooks run on commit (ruff, codespell)
  • no runtime behavior changes

Summary by CodeRabbit

  • Documentation
    • Updated GraphQL documentation examples to reflect current validation methods

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 500b09af-bb5d-4254-89b7-8058e757547c

📥 Commits

Reviewing files that changed from the base of the PR and between 1cbfbc5 and 407c599.

⛔ Files ignored due to path filters (1)
  • docs/llms-full.txt is excluded by none and included by none
📒 Files selected for processing (3)
  • docs/graphql.md
  • src/datamodel_code_generator/input_model.py
  • src/datamodel_code_generator/model/base.py

📝 Walkthrough

Walkthrough

Three files receive minor updates: a GraphQL documentation example switches from Pydantic v1 to v2 validation API, while docstrings in two source files are clarified for accuracy. No functional or behavioral changes occur.

Changes

Cohort / File(s) Summary
Documentation & Examples
docs/graphql.md
Updated GraphQL deserialization example from Pydantic v1 parse_obj() method to Pydantic v2 model_validate() API.
Docstring Clarifications
src/datamodel_code_generator/input_model.py, src/datamodel_code_generator/model/base.py
Minor wording refinements to docstrings describing lazy evaluation and Pydantic field assignment behavior; no logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A whisker twitch, a gentle nudge,
From v1 to v2, no fudge,
Docstrings polished, shining bright,
Clarity blooms in soft moonlight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the changeset: removing final Pydantic v1 references from the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch followup/remove-final-pydantic-v1-traces

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2026

📚 Docs Preview: https://pr-3036.datamodel-code-generator.pages.dev

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 8, 2026

Merging this PR will improve performance by 22.61%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 11 improved benchmarks
⏩ 98 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_perf_complex_refs 2.2 s 1.8 s +22.23%
WallTime test_perf_deep_nested 6.2 s 5.2 s +19.96%
WallTime test_perf_duplicate_names 1,066.7 ms 887.1 ms +20.24%
WallTime test_perf_large_models_pydantic_v2 3.7 s 3.1 s +21.5%
WallTime test_perf_all_options_enabled 6.8 s 5.6 s +21.53%
WallTime test_perf_multiple_files_input 3.8 s 3.1 s +22.61%
WallTime test_perf_openapi_large 3.1 s 2.6 s +18.69%
WallTime test_perf_kubernetes_style_pydantic_v2 2.7 s 2.2 s +21.6%
WallTime test_perf_stripe_style_pydantic_v2 2 s 1.7 s +19.75%
WallTime test_perf_graphql_style_pydantic_v2 839 ms 696.5 ms +20.47%
WallTime test_perf_aws_style_openapi_pydantic_v2 2 s 1.7 s +19.77%

Comparing followup/remove-final-pydantic-v1-traces (407c599) with main (1cbfbc5)

Open in CodSpeed

Footnotes

  1. 98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1cbfbc5) to head (407c599).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #3036   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           85        85           
  Lines        17684     17684           
  Branches      2068      2068           
=========================================
  Hits         17684     17684           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

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.

@koxudaxi koxudaxi merged commit 3c244da into main Mar 8, 2026
38 checks passed
@koxudaxi koxudaxi deleted the followup/remove-final-pydantic-v1-traces branch March 8, 2026 08:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2026

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: This PR contains only documentation and comment updates with no runtime behavior changes: (1) Updated a documentation example to use Pydantic v2's model_validate() instead of the deprecated parse_obj() - this is just a documentation improvement showing current best practices, not a change to generated code; (2) Synced the llms-full.txt documentation file; (3) Removed "Pydantic v1" references from two internal code comments. None of these changes affect code generation output, templates, CLI/API, defaults, Python version support, or error handling.


This analysis was performed by Claude Code Action

@github-actions
Copy link
Copy Markdown
Contributor

🎉 Released in 0.55.0

This PR is now available in the latest release. See the release notes for details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant