Skip to content

Commit 2f7a264

Browse files
test: skip retry-threading test when pyarrow absent
test_retry_kwargs_threaded_into_kernel_client patches KernelDatabricksClient, which requires importing databricks.sql.backend.kernel.client — that module imports pyarrow at load. In the no-pyarrow CI tier the patch target can't be resolved (AttributeError: module '...kernel' has no attribute 'client'), failing the Unit Tests (non-PyArrow) jobs while the PyArrow jobs passed. Add pytest.importorskip("pyarrow") to the test (matching the other kernel tests) so it skips without pyarrow and runs where it's present. Corrected the stale class docstring (it patches the client directly, not via a _create_backend stub). Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 0678f4a commit 2f7a264

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

tests/unit/test_session.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,15 @@ def test_use_kernel_pat_builds_minimal_access_token_provider(self):
413413
class TestKernelRetryOptionsThreading:
414414
"""The connector's ``_retry_*`` kwargs must be forwarded into the
415415
kernel client's ``retry_options`` on the use_kernel path (the kernel
416-
owns the retry loop). Stubs ``_create_backend`` so the kernel client
417-
is never imported — wheel-independent — and inspects the
418-
``retry_options`` dict session.py builds by patching the kernel
419-
client and capturing its call args.
416+
owns the retry loop). Captures the kwargs session.py passes by
417+
patching ``KernelDatabricksClient`` and inspecting its call args.
418+
419+
Patching ``KernelDatabricksClient`` requires importing
420+
``databricks.sql.backend.kernel.client``, which imports pyarrow at
421+
module load — so this test is skipped when pyarrow is absent (the
422+
no-pyarrow CI tier), matching the other kernel tests. The Rust wheel
423+
is still faked via sys.modules so the kernel extension itself isn't
424+
needed.
420425
"""
421426

422427
PACKAGE = "databricks.sql"
@@ -425,6 +430,11 @@ def test_retry_kwargs_threaded_into_kernel_client(self):
425430
import sys
426431
import types
427432

433+
pytest.importorskip(
434+
"pyarrow",
435+
reason="kernel client module imports pyarrow at load",
436+
)
437+
428438
# The lazy ``from databricks.sql.backend.kernel.client import
429439
# KernelDatabricksClient`` triggers ``import databricks_sql_kernel``
430440
# at module load; the unit-test job has no Rust wheel, so inject

0 commit comments

Comments
 (0)