You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(backend/kernel): unit tests skip without pyarrow, mypy + black
Three CI failures after the poetry-lock fix uncovered three real
issues:
1. pyarrow is optional in the connector. The default-deps CI test
job installs without it; the +PyArrow job installs with. The
kernel backend's result_set.py + type_mapping.py import pyarrow
eagerly (the kernel always returns pyarrow), and the unit tests
import the backend at collection time — which crashes the
default-deps job at ModuleNotFoundError.
Fix: gate the three kernel unit tests on `pytest.importorskip(
"pyarrow")` so they skip on default-deps and run on +PyArrow.
Verified locally: 39 pass with pyarrow, 3 skipped without.
No change to the backend module itself — nothing imports it
until use_sea=True is invoked, and pyarrow is on the kernel
wheel's runtime dep list so use_sea=True can't hit this either.
2. mypy: KernelDatabricksClient.open_session returns
self._session_id, which mypy types as Optional[SessionId]
because the field starts as None. Fix: bind the new id to a
local non-Optional variable, assign to the field, return the
local. CI's check-types runs cleanly on backend/kernel/ now;
pre-existing mypy noise elsewhere isn't mine.
3. black --check: black 22.12.0 (the version CI pins) wants
reformatting on result_set.py / type_mapping.py / client.py.
Applied. Verified locally with the same black version.
All 39 kernel unit tests + 619 pre-existing unit tests pass.
Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
0 commit comments