Skip to content

Commit 31a0e52

Browse files
n_valid_rows -> num_rows
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 14c5625 commit 31a0e52

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/databricks/sql/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def build_queue(
118118
manifest: Optional[ResultManifest],
119119
statement_id: str,
120120
description: List[Tuple] = [],
121-
schema_bytes: Optional[bytes] = None,
122121
max_download_threads: Optional[int] = None,
123122
sea_client: Optional[SeaDatabricksClient] = None,
124123
lz4_compressed: bool = False,
@@ -141,6 +140,7 @@ def build_queue(
141140
ResultSetQueue: The appropriate queue for the result data
142141
"""
143142

143+
print(sea_result_data)
144144
if sea_result_data.data is not None:
145145
# INLINE disposition with JSON_ARRAY format
146146
return JsonQueue(sea_result_data.data)
@@ -159,11 +159,11 @@ def __init__(self, data_array):
159159
"""Initialize with JSON array data."""
160160
self.data_array = data_array
161161
self.cur_row_index = 0
162-
self.n_valid_rows = len(data_array)
162+
self.num_rows = len(data_array)
163163

164164
def next_n_rows(self, num_rows):
165165
"""Get the next n rows from the data array."""
166-
length = min(num_rows, self.n_valid_rows - self.cur_row_index)
166+
length = min(num_rows, self.num_rows - self.cur_row_index)
167167
slice = self.data_array[self.cur_row_index : self.cur_row_index + length]
168168
self.cur_row_index += length
169169
return slice

tests/unit/test_sea_queue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_init(self, sample_data):
3030
queue = JsonQueue(sample_data)
3131
assert queue.data_array == sample_data
3232
assert queue.cur_row_index == 0
33-
assert queue.n_valid_rows == len(sample_data)
33+
assert queue.num_rows == len(sample_data)
3434

3535
def test_next_n_rows_partial(self, sample_data):
3636
"""Test fetching a subset of rows."""
@@ -82,7 +82,7 @@ def test_empty_data(self):
8282
assert queue.next_n_rows(10) == []
8383
assert queue.remaining_rows() == []
8484
assert queue.cur_row_index == 0
85-
assert queue.n_valid_rows == 0
85+
assert queue.num_rows == 0
8686

8787

8888
class TestSeaResultSetQueueFactory:
@@ -130,7 +130,7 @@ def test_build_queue_with_inline_data(self, mock_sea_client, mock_description):
130130
# Verify the queue is a JsonQueue with the correct data
131131
assert isinstance(queue, JsonQueue)
132132
assert queue.data_array == data
133-
assert queue.n_valid_rows == len(data)
133+
assert queue.num_rows == len(data)
134134

135135
def test_build_queue_with_empty_data(self, mock_sea_client, mock_description):
136136
"""Test building a queue with empty data."""
@@ -149,7 +149,7 @@ def test_build_queue_with_empty_data(self, mock_sea_client, mock_description):
149149
# Verify the queue is a JsonQueue with empty data
150150
assert isinstance(queue, JsonQueue)
151151
assert queue.data_array == []
152-
assert queue.n_valid_rows == 0
152+
assert queue.num_rows == 0
153153

154154
def test_build_queue_with_external_links(self, mock_sea_client, mock_description):
155155
"""Test building a queue with external links raises NotImplementedError."""

tests/unit/test_sea_result_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_init_with_result_data(self, result_set_with_data, sample_data):
194194
# Verify the results queue was created correctly
195195
assert isinstance(result_set_with_data.results, JsonQueue)
196196
assert result_set_with_data.results.data_array == sample_data
197-
assert result_set_with_data.results.n_valid_rows == len(sample_data)
197+
assert result_set_with_data.results.num_rows == len(sample_data)
198198

199199
def test_convert_json_types(self, result_set_with_data, sample_data):
200200
"""Test the _convert_json_types method."""

0 commit comments

Comments
 (0)