Skip to content

Commit 067a019

Browse files
remove has_more_rows from ExecuteResponse
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 2cd04df commit 067a019

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

src/databricks/sql/backend/thrift_backend.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,6 @@ def _results_message_to_execute_response(self, resp, operation_state):
787787
command_id=command_id,
788788
status=status,
789789
description=description,
790-
has_more_rows=has_more_rows,
791790
has_been_closed_server_side=has_been_closed_server_side,
792791
lz4_compressed=lz4_compressed,
793792
is_staging_operation=t_result_set_metadata_resp.isStagingOperation,
@@ -843,7 +842,6 @@ def get_execution_result(
843842
command_id=command_id,
844843
status=status,
845844
description=description,
846-
has_more_rows=has_more_rows,
847845
has_been_closed_server_side=False,
848846
lz4_compressed=lz4_compressed,
849847
is_staging_operation=is_staging_operation,

src/databricks/sql/backend/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ class ExecuteResponse:
424424
command_id: CommandId
425425
status: CommandState
426426
description: Optional[List[Tuple]] = None
427-
has_more_rows: bool = False
428427
has_been_closed_server_side: bool = False
429428
lz4_compressed: bool = True
430429
is_staging_operation: bool = False

src/databricks/sql/result_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def __init__(
205205
command_id=execute_response.command_id,
206206
status=execute_response.status,
207207
has_been_closed_server_side=execute_response.has_been_closed_server_side,
208-
has_more_rows=execute_response.has_more_rows,
208+
has_more_rows=False,
209209
results_queue=results_queue,
210210
description=execute_response.description,
211211
is_staging_operation=execute_response.is_staging_operation,

tests/unit/test_fetches.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def make_dummy_result_set_from_initial_results(initial_results):
5757
command_id=None,
5858
status=None,
5959
has_been_closed_server_side=True,
60-
has_more_rows=False,
6160
description=description,
6261
lz4_compressed=True,
6362
is_staging_operation=False,
@@ -105,7 +104,6 @@ def fetch_results(
105104
command_id=None,
106105
status=None,
107106
has_been_closed_server_side=False,
108-
has_more_rows=True,
109107
description=description,
110108
lz4_compressed=True,
111109
is_staging_operation=False,

tests/unit/test_thrift_backend.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,13 +1009,12 @@ def test_fall_back_to_hive_schema_if_no_arrow_schema(self, tcli_service_class):
10091009
"databricks.sql.utils.ResultSetQueueFactory.build_queue", return_value=Mock()
10101010
)
10111011
@patch("databricks.sql.backend.thrift_backend.TCLIService.Client", autospec=True)
1012-
def test_handle_execute_response_reads_has_more_rows_in_direct_results(
1012+
def test_handle_execute_response_creates_execute_response(
10131013
self, tcli_service_class, build_queue
10141014
):
1015-
for has_more_rows, resp_type in itertools.product(
1016-
[True, False], self.execute_response_types
1017-
):
1018-
with self.subTest(has_more_rows=has_more_rows, resp_type=resp_type):
1015+
"""Test that _handle_execute_response creates an ExecuteResponse object correctly."""
1016+
for resp_type in self.execute_response_types:
1017+
with self.subTest(resp_type=resp_type):
10191018
tcli_service_instance = tcli_service_class.return_value
10201019
results_mock = Mock()
10211020
results_mock.startRowOffset = 0
@@ -1027,7 +1026,7 @@ def test_handle_execute_response_reads_has_more_rows_in_direct_results(
10271026
resultSetMetadata=self.metadata_resp,
10281027
resultSet=ttypes.TFetchResultsResp(
10291028
status=self.okay_status,
1030-
hasMoreRows=has_more_rows,
1029+
hasMoreRows=True,
10311030
results=results_mock,
10321031
),
10331032
closeOperation=Mock(),
@@ -1047,7 +1046,8 @@ def test_handle_execute_response_reads_has_more_rows_in_direct_results(
10471046
execute_resp, Mock()
10481047
)
10491048

1050-
self.assertEqual(has_more_rows, execute_response.has_more_rows)
1049+
self.assertIsNotNone(execute_response)
1050+
self.assertIsInstance(execute_response, ExecuteResponse)
10511051

10521052
@patch(
10531053
"databricks.sql.utils.ResultSetQueueFactory.build_queue", return_value=Mock()

0 commit comments

Comments
 (0)