Skip to content

Improve session.query typings #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CaselIT opened this issue Apr 22, 2021 · 1 comment
Closed

Improve session.query typings #72

CaselIT opened this issue Apr 22, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request mypy

Comments

@CaselIT
Copy link
Member

CaselIT commented Apr 22, 2021

Currently the session.query returns Query[Any] in all cases.

Some overloads could probably be added:

def query(self, model: T, ...) -> Query[T]: ...
def query(self, model: Union[TypeEngins, Type[TypeEngine]], ...) -> Query[Any]: ...
def query(self, model: T, model2: T2) -> Query[Tuple[T, T2]] # not sure it's actually correct
def query(self, thing: TableClause)->Query[tuple]

I'm not sure if these above are possible with python, or 100% correct

@CaselIT CaselIT added requires triage New issue that requires categorization enhancement New feature or request mypy and removed requires triage New issue that requires categorization labels Apr 22, 2021
@CaselIT
Copy link
Member Author

CaselIT commented Jul 30, 2021

duplicate of #10

@CaselIT CaselIT closed this as completed Jul 30, 2021
@CaselIT CaselIT added the duplicate This issue or pull request already exists label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request mypy
Projects
None yet
Development

No branches or pull requests

1 participant