Skip to content

Commit 8b167b9

Browse files
committed
Refractor
1 parent a58c97f commit 8b167b9

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

databricks_sql_connector_core/tests/unit/test_fetches_bench.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import unittest
22
from unittest.mock import Mock
33

4-
import pyarrow as pa
54
import uuid
65
import time
76
import pytest
87

98
import databricks.sql.client as client
109
from databricks.sql.utils import ExecuteResponse, ArrowQueue
10+
from tests.e2e.predicate import pysql_supports_arrow
1111

12+
try:
13+
import pyarrow as pa
14+
except ImportError:
15+
pa = None
1216

17+
@pytest.mark.skipif(not pysql_supports_arrow(), reason="Skipping because pyarrow is not installed")
1318
class FetchBenchmarkTests(unittest.TestCase):
1419
"""
1520
Micro benchmark test for Arrow result handling.

databricks_sql_connector_core/tests/unit/test_thrift_backend.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
from decimal import Decimal
33
import itertools
44
import unittest
5+
import pytest
56
from unittest.mock import patch, MagicMock, Mock
67
from ssl import CERT_NONE, CERT_REQUIRED
78

8-
import pyarrow
9-
109
import databricks.sql
1110
from databricks.sql import utils
1211
from databricks.sql.thrift_api.TCLIService import ttypes
1312
from databricks.sql import *
1413
from databricks.sql.auth.authenticators import AuthProvider
1514
from databricks.sql.thrift_backend import ThriftBackend
15+
from tests.e2e.predicate import pysql_supports_arrow
1616

17+
try:
18+
import pyarrow
19+
except ImportError:
20+
pyarrow = None
1721

1822
def retry_policy_factory():
1923
return { # (type, default, min, max)
@@ -24,7 +28,7 @@ def retry_policy_factory():
2428
"_retry_delay_default": (float, 5, 1, 60),
2529
}
2630

27-
31+
@pytest.mark.skipif(not pysql_supports_arrow(), reason="Skipping because pyarrow is not installed")
2832
class ThriftBackendTestSuite(unittest.TestCase):
2933
okay_status = ttypes.TStatus(statusCode=ttypes.TStatusCode.SUCCESS_STATUS)
3034

0 commit comments

Comments
 (0)