-
Notifications
You must be signed in to change notification settings - Fork 478
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
SNOW-1882588 Allow Empty Sql Text when Dataframe Ast is Presented #2136
Conversation
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
@@ -929,8 +929,8 @@ def execute( | |||
|
|||
if _do_reset: | |||
self.reset() | |||
command = command.strip(" \t\n\r") if command else None |
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.
Change None
to "", otherwise the following log formatters will fail.
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.
that makes sense.
src/snowflake/connector/cursor.py
Outdated
command = command.strip(" \t\n\r") if command else None | ||
if not command: | ||
command = command.strip(" \t\n\r") if command else "" | ||
if not command and not _dataframe_ast: |
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.
Can we maybe clarify the logging logic here? If I understand this correctly, basically in the case of _dataframe_ast =True, command will be "". Should we log out the base64 string in debug mode? I.e.,
if not command:
if _dataframe_ast:
logger.debug("query[AST base64]: [%s]", _dataframe_ast)
else:
logger.warning("execute: no query is given to execute")
return
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.
Good Idea, let me change it.
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.
changed
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.
lgtm, some comment re logging. I think we can clear this up a bit.
Please add tests for this change! |
I have read the CLA Document and I hereby sign the CLA |
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
SNOW-1882588 Allow Empty Sql Text when Dataframe Ast is Presented
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
(Optional) PR for stored-proc connector: