Skip to content
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

Add better type hint for the output query type when compiling to a SQL backend #977

Open
obi1kenobi opened this issue Dec 7, 2020 · 0 comments
Labels
maintainer quality-of-life Features that ease development, but are not necessarily visible to package users. user friendliness

Comments

@obi1kenobi
Copy link
Contributor

Currently, CompilationResult is an untyped namedtuple, which means that it's unclear what is the type of its query attribute. For non-SQL backends, it appears to be str, but for SQL it seems to be some SQLAlchemy-specific type and it's not clear which of its superclasses/protocols we should claim as the return type.

This is also a concern for the insert_arguments_into_query function, whose return type is the same type as CompilationResult.query and currently set to the correct-but-extremely-imprecise Any.

@obi1kenobi obi1kenobi added user friendliness maintainer quality-of-life Features that ease development, but are not necessarily visible to package users. labels Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer quality-of-life Features that ease development, but are not necessarily visible to package users. user friendliness
Projects
None yet
Development

No branches or pull requests

2 participants
@obi1kenobi and others