From 97b6392bf84cf4f2a70bcd89c20e3bf81e229621 Mon Sep 17 00:00:00 2001 From: Jothi Prakash Date: Tue, 7 Jan 2025 22:49:39 +0530 Subject: [PATCH 1/4] Increased the number of retry attempts allowed (#486) Updated the number of attempts allowed --- src/databricks/sql/thrift_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/databricks/sql/thrift_backend.py b/src/databricks/sql/thrift_backend.py index 5fbd9f74..f76350a2 100644 --- a/src/databricks/sql/thrift_backend.py +++ b/src/databricks/sql/thrift_backend.py @@ -67,7 +67,7 @@ _retry_policy = { # (type, default, min, max) "_retry_delay_min": (float, 1, 0.1, 60), "_retry_delay_max": (float, 30, 5, 3600), - "_retry_stop_after_attempts_count": (int, 5, 1, 60), + "_retry_stop_after_attempts_count": (int, 30, 1, 60), "_retry_stop_after_attempts_duration": (float, 900, 1, 86400), "_retry_delay_default": (float, 5, 1, 60), } From 4c62c69178f7ff337123da273abafc82ce012b19 Mon Sep 17 00:00:00 2001 From: Jothi Prakash Date: Tue, 7 Jan 2025 23:03:13 +0530 Subject: [PATCH 2/4] bump version to 3.7.1 (#487) bumped up version --- CHANGELOG.md | 4 ++++ pyproject.toml | 2 +- src/databricks/sql/__init__.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d426b97e..5a2b6c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +# 3.7.1 (2025-01-07) + +- Relaxed the number of Http retry attempts (databricks/databricks-sql-python#486 by @jprakash-db) + # 3.7.0 (2024-12-23) - Fix: Incorrect number of rows fetched in inline results when fetching results with FETCH_NEXT orientation (databricks/databricks-sql-python#479 by @jprakash-db) diff --git a/pyproject.toml b/pyproject.toml index dc13f283..0156a5b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "databricks-sql-connector" -version = "3.7.0" +version = "3.7.1" description = "Databricks SQL Connector for Python" authors = ["Databricks "] license = "Apache-2.0" diff --git a/src/databricks/sql/__init__.py b/src/databricks/sql/__init__.py index eff1e812..44532884 100644 --- a/src/databricks/sql/__init__.py +++ b/src/databricks/sql/__init__.py @@ -68,7 +68,7 @@ def __repr__(self): DATE = DBAPITypeObject("date") ROWID = DBAPITypeObject() -__version__ = "3.7.0" +__version__ = "3.7.1" USER_AGENT_NAME = "PyDatabricksSqlConnector" # These two functions are pyhive legacy From 3b68d0f18694cb55287e5a420b4e080cc54e5606 Mon Sep 17 00:00:00 2001 From: Jothi Prakash Date: Thu, 16 Jan 2025 15:52:30 +0530 Subject: [PATCH 3/4] Refractore --- tests/unit/test_arrow_queue.py | 2 ++ tests/unit/test_cloud_fetch_queue.py | 1 + tests/unit/test_fetches.py | 3 ++- tests/unit/test_fetches_bench.py | 4 +++- tests/unit/test_thrift_backend.py | 6 ++++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/unit/test_arrow_queue.py b/tests/unit/test_arrow_queue.py index c6aef195..6c195bf1 100644 --- a/tests/unit/test_arrow_queue.py +++ b/tests/unit/test_arrow_queue.py @@ -1,11 +1,13 @@ import unittest import pytest + try: import pyarrow as pa except ImportError: pa = None from databricks.sql.utils import ArrowQueue + @pytest.mark.skipif(pa is None, reason="PyArrow is not installed") class ArrowQueueSuite(unittest.TestCase): @staticmethod diff --git a/tests/unit/test_cloud_fetch_queue.py b/tests/unit/test_cloud_fetch_queue.py index 59b6ce5c..7dec4e68 100644 --- a/tests/unit/test_cloud_fetch_queue.py +++ b/tests/unit/test_cloud_fetch_queue.py @@ -10,6 +10,7 @@ import databricks.sql.utils as utils from databricks.sql.types import SSLOptions + @pytest.mark.skipif(pyarrow is None, reason="PyArrow is not installed") class CloudFetchQueueSuite(unittest.TestCase): def create_result_link( diff --git a/tests/unit/test_fetches.py b/tests/unit/test_fetches.py index 2af679e3..71766f2c 100644 --- a/tests/unit/test_fetches.py +++ b/tests/unit/test_fetches.py @@ -5,11 +5,12 @@ try: import pyarrow as pa except ImportError: - pa=None + pa = None import databricks.sql.client as client from databricks.sql.utils import ExecuteResponse, ArrowQueue + @pytest.mark.skipif(pa is None, reason="PyArrow is not installed") class FetchTests(unittest.TestCase): """ diff --git a/tests/unit/test_fetches_bench.py b/tests/unit/test_fetches_bench.py index 6c5698b3..55287222 100644 --- a/tests/unit/test_fetches_bench.py +++ b/tests/unit/test_fetches_bench.py @@ -1,9 +1,10 @@ import unittest from unittest.mock import Mock + try: import pyarrow as pa except ImportError: - pa=None + pa = None import uuid import time import pytest @@ -11,6 +12,7 @@ import databricks.sql.client as client from databricks.sql.utils import ExecuteResponse, ArrowQueue + @pytest.mark.skipif(pa is None, reason="PyArrow is not installed") class FetchBenchmarkTests(unittest.TestCase): """ diff --git a/tests/unit/test_thrift_backend.py b/tests/unit/test_thrift_backend.py index 135f4229..592fd006 100644 --- a/tests/unit/test_thrift_backend.py +++ b/tests/unit/test_thrift_backend.py @@ -6,10 +6,11 @@ from unittest.mock import patch, MagicMock, Mock from ssl import CERT_NONE, CERT_REQUIRED from urllib3 import HTTPSConnectionPool + try: import pyarrow except ImportError: - pyarrow=None + pyarrow = None import databricks.sql from databricks.sql import utils from databricks.sql.types import SSLOptions @@ -28,7 +29,8 @@ def retry_policy_factory(): "_retry_delay_default": (float, 5, 1, 60), } -@pytest.mark.skipif(pyarrow is None,reason="PyArrow is not installed") + +@pytest.mark.skipif(pyarrow is None, reason="PyArrow is not installed") class ThriftBackendTestSuite(unittest.TestCase): okay_status = ttypes.TStatus(statusCode=ttypes.TStatusCode.SUCCESS_STATUS) From d65019a3359aacf6ade8e9463e3ecc12939ed115 Mon Sep 17 00:00:00 2001 From: Jothi Prakash Date: Thu, 16 Jan 2025 22:59:24 +0530 Subject: [PATCH 4/4] Minor change --- src/databricks/sql/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/databricks/sql/__init__.py b/src/databricks/sql/__init__.py index fd61ee6c..eff1e812 100644 --- a/src/databricks/sql/__init__.py +++ b/src/databricks/sql/__init__.py @@ -68,7 +68,7 @@ def __repr__(self): DATE = DBAPITypeObject("date") ROWID = DBAPITypeObject() -__version__ = "4.0.0" +__version__ = "3.7.0" USER_AGENT_NAME = "PyDatabricksSqlConnector" # These two functions are pyhive legacy