Skip to content

Commit

Permalink
Refractor
Browse files Browse the repository at this point in the history
  • Loading branch information
jprakash-db committed Sep 18, 2024
1 parent a58c97f commit 8b167b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import unittest
from unittest.mock import Mock

import pyarrow as pa
import uuid
import time
import pytest

import databricks.sql.client as client
from databricks.sql.utils import ExecuteResponse, ArrowQueue
from tests.e2e.predicate import pysql_supports_arrow

try:
import pyarrow as pa
except ImportError:
pa = None

@pytest.mark.skipif(not pysql_supports_arrow(), reason="Skipping because pyarrow is not installed")
class FetchBenchmarkTests(unittest.TestCase):
"""
Micro benchmark test for Arrow result handling.
Expand Down
10 changes: 7 additions & 3 deletions databricks_sql_connector_core/tests/unit/test_thrift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
from decimal import Decimal
import itertools
import unittest
import pytest
from unittest.mock import patch, MagicMock, Mock
from ssl import CERT_NONE, CERT_REQUIRED

import pyarrow

import databricks.sql
from databricks.sql import utils
from databricks.sql.thrift_api.TCLIService import ttypes
from databricks.sql import *
from databricks.sql.auth.authenticators import AuthProvider
from databricks.sql.thrift_backend import ThriftBackend
from tests.e2e.predicate import pysql_supports_arrow

try:
import pyarrow
except ImportError:
pyarrow = None

def retry_policy_factory():
return { # (type, default, min, max)
Expand All @@ -24,7 +28,7 @@ def retry_policy_factory():
"_retry_delay_default": (float, 5, 1, 60),
}


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

Expand Down

0 comments on commit 8b167b9

Please sign in to comment.