docs: fix Decimal field prose to reference Field() instead of condecimal()#2035
Open
anxkhn wants to merge 1 commit into
Open
docs: fix Decimal field prose to reference Field() instead of condecimal()#2035anxkhn wants to merge 1 commit into
anxkhn wants to merge 1 commit into
Conversation
…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>
Contributor
📝 Docs previewLast commit 884053d at: https://b0285440.sqlmodel.pages.dev Modified Pages |
Member
|
@anxkhn, the description is too verbose for such small fix.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Decimals in SQLModel" section introduces its example like this:
but the example it introduces (and current SQLModel) uses
Field():So the sentence contradicts the code sample that immediately follows it, and it also disagrees with the paragraph just above it, which already says the number of digits and decimal places are specified "in the
Field()function".condecimal()is a Pydantic v1 constrained-type helper. SQLModel does not re-export it, and using it as a type annotation trips static type checkers; this is what a user hit in #354 ("Illegal type annotation: call expression not allowed"). TheField(max_digits=..., decimal_places=...)form the example already uses is the type-checker-clean way, and it is what the rest of the page describes.This PR rewords that one sentence so the prose matches both the surrounding text and the sample:
Docs-only, one line changed, no code touched.
Reference
Related issue: #354.