Skip to content

Commit

Permalink
SNOW-1882588 Allow Empty Sql Text when Dataframe Ast is Presented (#2136
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sfc-gh-bli authored Jan 16, 2025
1 parent 4b3ded1 commit fc5f548
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/snowflake/connector/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,12 +929,15 @@ def execute(

if _do_reset:
self.reset()
command = command.strip(" \t\n\r") if command else None
command = command.strip(" \t\n\r") if command else ""
if not command:
logger.warning("execute: no query is given to execute")
return None
logger.debug("query: [%s]", self._format_query_for_log(command))
if _dataframe_ast:
logger.debug("dataframe ast: [%s]", _dataframe_ast)
else:
logger.warning("execute: no query is given to execute")
return None

logger.debug("query: [%s]", self._format_query_for_log(command))
_statement_params = _statement_params or dict()
# If we need to add another parameter, please consider introducing a dict for all extra params
# See discussion in https://github.com/snowflakedb/snowflake-connector-python/pull/1524#discussion_r1174061775
Expand Down

0 comments on commit fc5f548

Please sign in to comment.