Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb135fc

Browse files
stronger typing in JsonQueue
Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent cc9db8b commit bb135fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ def build_queue(
5151
class JsonQueue(ResultSetQueue):
5252
"""Queue implementation for JSON_ARRAY format data."""
5353

54-
def __init__(self, data_array):
54+
def __init__(self, data_array: Optional[List[List[str]]]):
5555
"""Initialize with JSON array data."""
5656
self.data_array = data_array or []
5757
self.cur_row_index = 0
5858
self.num_rows = len(self.data_array)
5959

60-
def next_n_rows(self, num_rows):
60+
def next_n_rows(self, num_rows: int) -> List[List[str]]:
6161
"""Get the next n rows from the data array."""
6262
length = min(num_rows, self.num_rows - self.cur_row_index)
6363
slice = self.data_array[self.cur_row_index : self.cur_row_index + length]
6464
self.cur_row_index += length
6565
return slice
6666

67-
def remaining_rows(self):
67+
def remaining_rows(self) -> List[List[str]]:
6868
"""Get all remaining rows from the data array."""
6969
slice = self.data_array[self.cur_row_index :]
7070
self.cur_row_index += len(slice)

0 commit comments

Comments
 (0)