FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

🚨 Fix `Type of "Field" is partially unknown` with Pyright in `strict` mode by mpyuglgwkxcmodyrpo · Pull Request #1644 · fastapi/sqlmodel · GitHub

Repository navigation

🚨 Fix Type of "Field" is partially unknown with Pyright in strict mode - #1644

Closed
mpyuglgwkxcmodyrpo wants to merge 1 commit into
fastapi:mainfrom
mpyuglgwkxcmodyrpo:1598-fix-field-type-error-pyright
Closed

mpyuglgwkxcmodyrpo wants to merge 1 commit into
fastapi:mainfrom
mpyuglgwkxcmodyrpo:1598-fix-field-type-error-pyright

Conversation

mpyuglgwkxcmodyrpo commented Nov 11, 2025 •
edited
Loading

Copy link
Copy Markdown

See #1598 for discussion. I wanted to see if this would pass tests across the matrix (don't see why they wouldn't).
I think this only applies to pyright in strict mode.

I can't edit lables, so someone should add the bug label or whatever else is relevant.

mpyuglgwkxcmodyrpo commented Nov 11, 2025 •
edited
Loading

Copy link
Copy Markdown
Author

This is a more suitable alternative to #1604 as it keeps the from __future__ import annotations line a the top of main.py, thus keeping python 3.9 support.

YuriiMotov changed the title fix #1598: pyright error on Field import due to partially unknown types 🚨 Fix Type of "Field" is partially unknown with Pyright in strict mode Nov 11, 2025

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This fixes the issue and solution looks good to me.

To reproduce the issue, create main.py with:

# pyright: strict
from sqlmodel import Field

And run:

pip install pyright
pyright main.py

@mpyuglgwkxcmodyrpo, thanks!

Copy link
Copy Markdown

That's awesome!

I hope the version with these changes gets released soon.

Copy link
Copy Markdown

@tiangolo @YuriiMotov I'm wondering when this PR will be added to the release.
I'm so sad it was left out of the 0.0.29 version release. 🥺🥺

github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label Dec 28, 2025

This comment was marked as resolved.

1 similar comment

Copy link
Copy Markdown
Contributor

This pull request has a merge conflict that needs to be resolved.

Copy link
Copy Markdown

I have confirmed that the issue has been resolved in the newly released 0.0.31 version. Thank you.

Copy link
Copy Markdown
Member

I have confirmed that the issue has been resolved in the newly released 0.0.31 version. Thank you.

Thanks!
I just checked it as well and can confirm there is no such issue in latest version (0.0.31).
So, closing this PR.

@mpyuglgwkxcmodyrpo, thank you for your efforts!

YuriiMotov closed this Jan 8, 2026
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

Labels

conflicts Automatically generated when a PR has a merge conflict refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL