Skip to content

Commit 8a014f0

Browse files
move description to List[Tuple]
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent d3200c4 commit 8a014f0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/databricks/sql/backend/thrift_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def _col_to_description(col):
727727
else:
728728
precision, scale = None, None
729729

730-
return [col.columnName, cleaned_type, None, None, precision, scale, None]
730+
return (col.columnName, cleaned_type, None, None, precision, scale, None)
731731

732732
@staticmethod
733733
def _hive_schema_to_description(t_table_schema):

src/databricks/sql/backend/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class ExecuteResponse:
423423

424424
command_id: CommandId
425425
status: CommandState
426-
description: Optional[List[List[Any]]] = None
426+
description: Optional[List[Tuple]] = None
427427
has_more_rows: bool = False
428428
has_been_closed_server_side: bool = False
429429
lz4_compressed: bool = True

src/databricks/sql/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from collections.abc import Iterable
99
from decimal import Decimal
1010
from enum import Enum
11-
from typing import Any, Dict, List, Optional, Union
11+
from typing import Any, Dict, List, Optional, Tuple, Union
1212
import re
1313

1414
import lz4.frame
@@ -57,7 +57,7 @@ def build_queue(
5757
max_download_threads: int,
5858
ssl_options: SSLOptions,
5959
lz4_compressed: bool = True,
60-
description: Optional[List[List[Any]]] = None,
60+
description: Optional[List[Tuple]] = None,
6161
) -> ResultSetQueue:
6262
"""
6363
Factory method to build a result set queue.
@@ -206,7 +206,7 @@ def __init__(
206206
start_row_offset: int = 0,
207207
result_links: Optional[List[TSparkArrowResultLink]] = None,
208208
lz4_compressed: bool = True,
209-
description: Optional[List[List[Any]]] = None,
209+
description: Optional[List[Tuple]] = None,
210210
):
211211
"""
212212
A queue-like wrapper over CloudFetch arrow batches.

tests/unit/test_thrift_backend.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ def test_hive_schema_to_description_preserves_column_names_and_types(self):
511511
self.assertEqual(
512512
description,
513513
[
514-
["column 1", "int", None, None, None, None, None],
515-
["column 2", "boolean", None, None, None, None, None],
516-
["column 2", "map", None, None, None, None, None],
517-
["", "struct", None, None, None, None, None],
514+
("column 1", "int", None, None, None, None, None),
515+
("column 2", "boolean", None, None, None, None, None),
516+
("column 2", "map", None, None, None, None, None),
517+
("", "struct", None, None, None, None, None),
518518
],
519519
)
520520

@@ -549,7 +549,7 @@ def test_hive_schema_to_description_preserves_scale_and_precision(self):
549549
self.assertEqual(
550550
description,
551551
[
552-
["column 1", "decimal", None, None, 10, 100, None],
552+
("column 1", "decimal", None, None, 10, 100, None),
553553
],
554554
)
555555

0 commit comments

Comments
 (0)