diff --git a/src/snowflake/connector/cursor.py b/src/snowflake/connector/cursor.py index 5ff7a15e5..b403b8a3e 100644 --- a/src/snowflake/connector/cursor.py +++ b/src/snowflake/connector/cursor.py @@ -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