-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
refreshing snowflake schema w/o waking cluster #4285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking a stab at this! I'm sure Snowflake users will appreciate it. 👍
Please see comments to improve the code maintainability. 🙏
redash/query_runner/snowflake.py
Outdated
@@ -104,16 +104,47 @@ def run_query(self, query, user): | |||
|
|||
return json_data, error | |||
|
|||
def __run_query_without_warehouse(self, query, user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __run_query_without_warehouse(self, query, user): | |
def _run_query_without_warehouse(self, query): |
A single underscore is enough :) (need to update the function call below too).
Also no need to take a user object here.
@arikfr addressed PR comments and rebased from master |
Have also added a new internal method to not select a warehouse while executing query Using 'show columns' to fetch database schema instead of executing a select query in information schema show columns does not require a warehouse to run
fixing internal function syntax and avoiding code repetition
Thank you! |
What type of PR is this? (check all applicable)
Description
Refreshing snowflake schema w/o waking cluster. Used
show columns
for this which executes the command w/o having to require a warehouse.Created a new internal function in the query runner
__run_query_without_warehouse
instead of modifying the existingrun_query
function so as to not change the definition as specified in the base classRelated Tickets & Documents
#4217