Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion paimon-python/pypaimon/tests/native_hybrid_search_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def test_one_authoritative_rest_snapshot_for_all_routes_without_retry(rest_catal
first = table.snapshot_manager().get_latest_snapshot()
indexes._append(table, _rows(8, 4), schema=SCHEMA)
if response == 'error':
reply, code = ErrorResponse('TABLE', 'indexes', 'snapshot unavailable', 503), 503
# 500, not 503: REST clients retry reads on 429 and 503, as Java does.
reply, code = ErrorResponse('TABLE', 'indexes', 'snapshot unavailable', 500), 500
else:
reply = (GetTableSnapshotResponse(TableSnapshot(first, 1, 0, 7, first.time_millis))
if response == 'first' else GetTableSnapshotResponse())
Expand Down
5 changes: 3 additions & 2 deletions paimon-python/pypaimon/tests/native_read_snapshot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ def test_rest_snapshot_response_is_authoritative_without_search_retry(rest_catal
from pypaimon.api.api_response import ErrorResponse, GetTableSnapshotResponse
catalog, server = rest_catalog
table = hybrid._table(catalog)
# 500, not 503: REST clients retry reads on 429 and 503, as Java does.
reply = GetTableSnapshotResponse() if response == 'empty' else ErrorResponse(
'TABLE', 'indexes', 'snapshot unavailable', 503)
code = 200 if response == 'empty' else 503
'TABLE', 'indexes', 'snapshot unavailable', 500)
code = 200 if response == 'empty' else 500
with patch.object(server, '_table_snapshot_handle', return_value=server._mock_response(reply, code)) as latest:
with _native_only():
if response == 'error':
Expand Down
Loading