Skip to content

📝 Fix "Decimals in SQLModel" to reference Field() instead of condecimal() - #2035

Merged
tiangolo merged 3 commits into
fastapi:mainfrom
anxkhn:patch-1
Aug 28, 2026
Merged

📝 Fix "Decimals in SQLModel" to reference Field() instead of condecimal()#2035
tiangolo merged 3 commits into
fastapi:mainfrom
anxkhn:patch-1

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Updates the Decimal documentation to match the Field() example. Closes #354.

@github-actions github-actions Bot added the docs Improvements or additions to documentation label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit c828f9c at: https://749d56bd.sqlmodel.pages.dev

Modified Pages

@YuriiMotov

Copy link
Copy Markdown
Member

@anxkhn, the description is too verbose for such small fix..
Have you self-reviewed it before posting?

@YuriiMotov YuriiMotov changed the title docs: fix Decimal field prose to reference Field() instead of condecimal() 📝 Fix "Decimals in SQLModel" to reference Field() instead of condecimal() Jul 15, 2026

@YuriiMotov YuriiMotov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Added alternative wording (to avoid calling Field function)

Comment thread docs/advanced/decimal.md Outdated
anxkhn added 2 commits July 27, 2026 20:01
…mal()

The 'Decimals in SQLModel' section introduced its example with 'using
the condecimal() function', but the example (and current SQLModel) uses
Field(max_digits=..., decimal_places=...). condecimal() is a Pydantic v1
constrained-type helper that SQLModel does not re-export, and using it as
an annotation trips static type checkers.

Reword the sentence to match the paragraph above it and the code sample,
both of which already use Field().

Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
@anxkhn

anxkhn commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@YuriiMotov updated with your suggested wording and rebased onto current main. could you take another look when convenient?

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tiangolo
tiangolo enabled auto-merge (squash) August 28, 2026 18:44
@tiangolo
tiangolo merged commit 68ecb40 into fastapi:main Aug 28, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: condecimal gives type error "Illegal type annotation: call expression not allowed"

3 participants