Skip to content

Commit fc5f548

Browse files
authored
SNOW-1882588 Allow Empty Sql Text when Dataframe Ast is Presented (#2136)
1 parent 4b3ded1 commit fc5f548

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/snowflake/connector/cursor.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,12 +929,15 @@ def execute(
929929

930930
if _do_reset:
931931
self.reset()
932-
command = command.strip(" \t\n\r") if command else None
932+
command = command.strip(" \t\n\r") if command else ""
933933
if not command:
934-
logger.warning("execute: no query is given to execute")
935-
return None
936-
logger.debug("query: [%s]", self._format_query_for_log(command))
934+
if _dataframe_ast:
935+
logger.debug("dataframe ast: [%s]", _dataframe_ast)
936+
else:
937+
logger.warning("execute: no query is given to execute")
938+
return None
937939

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

0 commit comments

Comments
 (0)