| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Hi, thanks for your contribution!
It looks like the CI is failing, I'm not exactly sure why though. I'll put the PR in draft until the CI is green.
Then again, I think that perhaps it makes most sense to work on the PR that has the more generic fix. The conflicts usually just mean that the PR edits the same file as another PR that has already been merged into main - it's not necessarily an actual conflict or issue.
Sorry, something went wrong.
|
Hi @svlandeg Thank you for getting back to me! So this branch should be good now. Credits to @maxispeicher ofc :) Edit: did not change my branch name because I'd have to open a new PR I think and we'd lose the conversation context |
Sorry, something went wrong.
|
After testing in a large project, I am not sure this approach can work. There are the automatically generated types such as @overload
def select( # type: ignore
__ent0: _TCCA[_T0],
__ent1: _TCCA[_T1],
) -> Select[Tuple[_T0, _T1]]: ..
This overload would result in less specific typing and would break consumers relying on the less specific typing: @overload
def select(*entities: _TCCA[_T0]) -> Select[Tuple[_T0, ...]]: # type: ignore
...
select(ClassA, ClassB) would be typed as Select[Tuple[ClassA | ClassB, ...]] instead of Select[Tuple[ClassA, ClassB]] So I do not think this approach is viable. Unfortunately, I cannot think of a solution other than pre-generating types as we originally did. Happy to pick this issue up in another PR if we find an agreeable way forward! Thank you very much! |
Sorry, something went wrong.
No need to apologize, definitely appreciate the time and effort you spent, even if it's not mergeable right now! 🙏 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I am trying to write a select statement that selects 5 different SQLModel children. However I get a type error as the overloads for select are limited to 4.
I am aware there is a PR that adds typing for select for arbitrary length :)
Since that one is not merged and has conflicts (I think) I thought to give you the option to stick to the original appraoch of autogenerating types in the meantime. I increased the number of types and run the script.
Feel free to close my PR if you would rather take another approach but I think it's a quick win!
Resolves 92, 271
Thank you :)