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

feat: saved queries in query and compile_sql #45

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

serramatutu
Copy link
Collaborator

This PR adds saved queries to query and compile_sql. I used @overload so that users have the option to statically typecheck for correct usage of the args, i.e that they're not using metrics and group_by with saved_query. I also added a client-side validation for query parameters before we submit queries to the servers.

This commit adds `saved_query` to `query` and `compile_sql`, so it's now
possible to use them with saved queries. I added some method overrides
so that typecheckers can detect invalid usage of them, and I also
created a method which validates at runtime whether the parameters are
valid before submitting them to the servers.
Copy link

@WilliamDee WilliamDee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, few spots where you need to remove group_by when using saved_query

dbtsl/api/graphql/client/asyncio.pyi Outdated Show resolved Hide resolved
dbtsl/api/graphql/client/asyncio.pyi Outdated Show resolved Hide resolved
dbtsl/client/asyncio.pyi Outdated Show resolved Hide resolved
dbtsl/client/asyncio.pyi Outdated Show resolved Hide resolved
@serramatutu serramatutu merged commit 53aa90e into main Sep 20, 2024
4 checks passed
@serramatutu serramatutu deleted the serramatutu/saved-queries branch September 20, 2024 18:43
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