Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/snowflake/snowpark/_internal/server_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
get_plan_telemetry_metrics,
)
from snowflake.snowpark._internal.utils import (
IS_V5_DRIVER,
create_rlock,
create_thread_local,
escape_quotes,
Expand Down Expand Up @@ -462,7 +463,9 @@ def execute_and_notify_query_listener(
)
raise ex

notify_kwargs["requestId"] = str(results_cursor._request_id)
notify_kwargs["requestId"] = str(
results_cursor.request_id if IS_V5_DRIVER else results_cursor._request_id
)
self.notify_query_listeners(
QueryRecord(results_cursor.sfqid, results_cursor.query), **notify_kwargs
)
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/test_server_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from snowflake.connector.network import ReauthenticationRequest
from snowflake.snowpark import Session
from snowflake.snowpark._internal.analyzer.snowflake_plan import Query, SnowflakePlan
from snowflake.snowpark._internal.utils import IS_V5_DRIVER
from snowflake.snowpark.exceptions import (
SnowparkFetchDataException,
SnowparkQueryCancelledException,
Expand Down Expand Up @@ -95,7 +96,10 @@ def test_run_query_exceptions(mock_server_connection, caplog):
mock_server_connection._cursor.execute.return_value = mock_server_connection._cursor
mock_server_connection._cursor.sfqid = "fake id"
mock_server_connection._cursor.query = "fake query"
mock_server_connection._cursor._request_id = "1234"
if IS_V5_DRIVER:
mock_server_connection._cursor.request_id = "1234"
else:
mock_server_connection._cursor._request_id = "1234"
with mock.patch.object(
mock_server_connection._cursor,
"fetch_pandas_all",
Expand Down
Loading