diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c4979d..3eab95d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ - Split the connector into two separate packages: `databricks-sql-connector` and `databricks-sqlalchemy`. The `databricks-sql-connector` package contains the core functionality of the connector, while the `databricks-sqlalchemy` package contains the SQLAlchemy dialect for the connector. - Pyarrow dependency is now optional in `databricks-sql-connector`. Users needing arrow are supposed to explicitly install pyarrow +# 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/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), } 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)