From 348e675bc12bcad673c6d066254e360f9d8ed04f Mon Sep 17 00:00:00 2001 From: Stepan Burlakov Date: Fri, 10 Jan 2025 13:59:36 +0200 Subject: [PATCH 1/2] add timeout setting documentation --- docsrc/Connecting_and_queries.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docsrc/Connecting_and_queries.rst b/docsrc/Connecting_and_queries.rst index 8dd903eaed..50eb5bca4f 100644 --- a/docsrc/Connecting_and_queries.rst +++ b/docsrc/Connecting_and_queries.rst @@ -626,3 +626,12 @@ You can import this module as follows: from datetime import datetime +Execution timeout +============================== + +The Firebolt Python SDK allows you to set a timeout for query execution. +In order to do this, you can call the :meth:`Cursor.execute` or :meth:`Cursor.executemany` function with the +``timeout_seconds`` parameter provided. In case the timeout will be reached before the query execution finishes, the +function will raise a ``QueryTimeoutError`` exception. +Warning: If running multiple queries, and one of queries times out, all the previous queries will not be rolled back and their result will persist. All the remaining queries will be cancelled. + From 2cc1afd978044eacf27313762ea1c89f7b1edc63 Mon Sep 17 00:00:00 2001 From: Stepan Burlakov Date: Mon, 13 Jan 2025 10:35:12 +0200 Subject: [PATCH 2/2] address comments --- docsrc/Connecting_and_queries.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docsrc/Connecting_and_queries.rst b/docsrc/Connecting_and_queries.rst index 50eb5bca4f..04cef199a9 100644 --- a/docsrc/Connecting_and_queries.rst +++ b/docsrc/Connecting_and_queries.rst @@ -633,5 +633,13 @@ The Firebolt Python SDK allows you to set a timeout for query execution. In order to do this, you can call the :meth:`Cursor.execute` or :meth:`Cursor.executemany` function with the ``timeout_seconds`` parameter provided. In case the timeout will be reached before the query execution finishes, the function will raise a ``QueryTimeoutError`` exception. -Warning: If running multiple queries, and one of queries times out, all the previous queries will not be rolled back and their result will persist. All the remaining queries will be cancelled. + +:: + + cursor.execute( + "SELECT * FROM test_table;", + timeout_seconds=5 + ) + +**Warning**: If running multiple queries, and one of queries times out, all the previous queries will not be rolled back and their result will persist. All the remaining queries will be cancelled.