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

SNOW-1882588 Allow Empty Sql Text when Dataframe Ast is Presented #2136

Merged
merged 4 commits into from
Jan 16, 2025

Conversation

sfc-gh-bli
Copy link
Contributor

Please answer these questions before submitting your pull requests. Thanks!

  1. 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

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

  4. (Optional) PR for stored-proc connector:

Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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
Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

that makes sense.

@sfc-gh-bli sfc-gh-bli added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Jan 15, 2025
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:
Copy link
Contributor

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      

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

Copy link
Contributor

@sfc-gh-lspiegelberg sfc-gh-lspiegelberg left a 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.

@sfc-gh-bli sfc-gh-bli merged commit fc5f548 into main Jan 16, 2025
91 of 93 checks passed
@sfc-gh-bli sfc-gh-bli deleted the snow-1882588 branch January 16, 2025 22:01
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
@sfc-gh-mkeller
Copy link
Collaborator

Please add tests for this change!

@sfc-gh-bli
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants