Skip to content

Commit 3becefe

Browse files
Merge branch 'fetch-json-inline' into ext-links-sea
2 parents c09508e + 5e01e7b commit 3becefe

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/databricks/sql/backend/sea/backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def execute_command(
407407
max_rows: int,
408408
max_bytes: int,
409409
lz4_compression: bool,
410-
cursor: "Cursor",
410+
cursor: Cursor,
411411
use_cloud_fetch: bool,
412412
parameters: List[ttypes.TSparkParameter],
413413
async_op: bool,
@@ -718,7 +718,7 @@ def get_tables(
718718
session_id: SessionId,
719719
max_rows: int,
720720
max_bytes: int,
721-
cursor: "Cursor",
721+
cursor: Cursor,
722722
catalog_name: Optional[str] = None,
723723
schema_name: Optional[str] = None,
724724
table_name: Optional[str] = None,

src/databricks/sql/backend/sea/utils/filters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def filter_by_column_values(
112112
result_set,
113113
lambda row: (
114114
len(row) > column_index
115-
and isinstance(row[column_index], str)
116115
and (
117116
row[column_index].upper()
118117
if not case_sensitive

tests/unit/test_sea_backend.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from databricks.sql.exc import (
1919
Error,
2020
NotSupportedError,
21+
ProgrammingError,
2122
ServerOperationError,
2223
DatabaseError,
2324
)
@@ -129,7 +130,7 @@ def test_initialization(self, mock_http_client):
129130
assert client3.max_download_threads == 5
130131

131132
# Test with invalid HTTP path
132-
with pytest.raises(ValueError) as excinfo:
133+
with pytest.raises(ProgrammingError) as excinfo:
133134
SeaDatabricksClient(
134135
server_hostname="test-server.databricks.com",
135136
port=443,
@@ -195,7 +196,7 @@ def test_session_management(self, sea_client, mock_http_client, thrift_session_i
195196
)
196197

197198
# Test close_session with invalid ID type
198-
with pytest.raises(ValueError) as excinfo:
199+
with pytest.raises(ProgrammingError) as excinfo:
199200
sea_client.close_session(thrift_session_id)
200201
assert "Not a valid SEA session ID" in str(excinfo.value)
201202

@@ -244,7 +245,7 @@ def test_command_execution_sync(
244245
assert cmd_id_arg.guid == "test-statement-123"
245246

246247
# Test with invalid session ID
247-
with pytest.raises(ValueError) as excinfo:
248+
with pytest.raises(ProgrammingError) as excinfo:
248249
mock_thrift_handle = MagicMock()
249250
mock_thrift_handle.sessionId.guid = b"guid"
250251
mock_thrift_handle.sessionId.secret = b"secret"
@@ -452,7 +453,7 @@ def test_command_management(
452453
)
453454

454455
# Test cancel_command with invalid ID
455-
with pytest.raises(ValueError) as excinfo:
456+
with pytest.raises(ProgrammingError) as excinfo:
456457
sea_client.cancel_command(thrift_command_id)
457458
assert "Not a valid SEA command ID" in str(excinfo.value)
458459

@@ -466,7 +467,7 @@ def test_command_management(
466467
)
467468

468469
# Test close_command with invalid ID
469-
with pytest.raises(ValueError) as excinfo:
470+
with pytest.raises(ProgrammingError) as excinfo:
470471
sea_client.close_command(thrift_command_id)
471472
assert "Not a valid SEA command ID" in str(excinfo.value)
472473

@@ -525,7 +526,7 @@ def test_command_management(
525526
assert result.status == CommandState.SUCCEEDED
526527

527528
# Test get_execution_result with invalid ID
528-
with pytest.raises(ValueError) as excinfo:
529+
with pytest.raises(ProgrammingError) as excinfo:
529530
sea_client.get_execution_result(thrift_command_id, mock_cursor)
530531
assert "Not a valid SEA command ID" in str(excinfo.value)
531532

@@ -721,7 +722,7 @@ def test_get_schemas(self, sea_client, sea_session_id, mock_cursor):
721722
)
722723

723724
# Case 3: Without catalog name (should raise ValueError)
724-
with pytest.raises(ValueError) as excinfo:
725+
with pytest.raises(DatabaseError) as excinfo:
725726
sea_client.get_schemas(
726727
session_id=sea_session_id,
727728
max_rows=100,
@@ -872,7 +873,7 @@ def test_get_columns(self, sea_client, sea_session_id, mock_cursor):
872873
)
873874

874875
# Case 3: Without catalog name (should raise ValueError)
875-
with pytest.raises(ValueError) as excinfo:
876+
with pytest.raises(DatabaseError) as excinfo:
876877
sea_client.get_columns(
877878
session_id=sea_session_id,
878879
max_rows=100,

0 commit comments

Comments
 (0)