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

fix typing for data parsing by kafai-lam · Pull Request #27 · fastapi/sqlmodel · GitHub

Repository navigation

fix typing for data parsing - #27

Closed
kafai-lam wants to merge 3 commits into
fastapi:mainfrom
kafai-lam:main
Closed

kafai-lam wants to merge 3 commits into
fastapi:mainfrom
kafai-lam:main

Conversation

Copy link
Copy Markdown

For now, whenever .from_orm or .parse_obj method was called on a SQLModel, it will return SQLModel type only instead of the actually model class.

This PR applies generic TypeVar for those methods to generate a more precise typing.

maresb commented Dec 8, 2021

Copy link
Copy Markdown

Please see also https://github.com/kafai97/sqlmodel/pull/1 which adds the return type to .from_orm.

Add correct return type in from_orm

kafai-lam commented Dec 9, 2021 •
edited
Loading

Copy link
Copy Markdown
Author

@maresb seems the author already resolve the type annotations issue with #173

maresb commented Dec 9, 2021

Copy link
Copy Markdown

Indeed! Thanks for pointing that out. Hopefully there will soon be a release.

kafai-lam closed this Dec 9, 2021
synodriver pushed a commit to synodriver/sqlmodel that referenced this pull request Jun 24, 2022
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL