You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(experimentation): add a Snowflake statement client - #9008
I have added information to docs/ if required so people know about the feature.
I have filled in the "Changes" section below.
I have filled in the "How did you test this code" section below.
Changes
Add a client for Snowflake's SQL API with key-pair (JWT) authentication, using requests and PyJWT (no new dependency).
It submits a statement with positional bindings, polls and cancels at the deadline, and decodes results by column type.
Existing SnowflakeWarehouse behaviour is unchanged; the provider follows in a later PR.
How did you test this code?
Unit tests with mocked HTTP (100% coverage of warehouses/snowflake.py), plus a real Snowflake account for every binding type, result type and error case; the poll-and-cancel path is unit-tested only.
No actionable comments were generated in the recent review.
Walkthrough
The changes add a SnowflakeCredentials type and a Snowflake warehouse session. The session validates configuration and credentials, creates key-pair JWT authentication, submits and polls statements, handles timeouts and request errors, and converts supported results. Unit tests cover configuration, authentication, bindings, execution, cancellation, errors, and result conversion.
The client is not yet wired into the provider, so exposure is limited. Before merge, fix the single-token reuse during long polling and cancellation, reject incomplete 391908 results, and stop rewriting placeholder-like text inside SQL literals.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.93%. Comparing base (02dd781) to head (73458da). ⚠️ Report is 25 commits behind head on main.
The reason will be displayed to describe this comment to others. Learn more.
All reported issues were addressed across 4 files
Reply to a comment to ask cubic a question or push back. It learns from your replies. Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
Automated review surfaced no issues in the provided summaries.
No files require special attention.
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews. Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
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
apiIssue related to the REST APIfeatureNew feature or request
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
requestsand PyJWT (no new dependency).SnowflakeWarehousebehaviour is unchanged; the provider follows in a later PR.How did you test this code?
Unit tests with mocked HTTP (100% coverage of
warehouses/snowflake.py), plus a real Snowflake account for every binding type, result type and error case; the poll-and-cancel path is unit-tested only.