fix(perf): svod2_paging_check сверяет склейку view=full с ответом без null-полей (AURORA-1848)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
61541c74a7
commit
24ad2728d7
@ -54,8 +54,19 @@ def _line_id(row: dict):
|
|||||||
return (row.get("data") or {}).get("line_id")
|
return (row.get("data") or {}).get("line_id")
|
||||||
|
|
||||||
|
|
||||||
|
def strip_nulls(value):
|
||||||
|
"""Как jsonb_strip_nulls: после AURORA-1848 прежний (без параметров) ответ отдаёт data без null-полей,
|
||||||
|
а постраничный view=full - с ними. Сверка идёт по значениям, поэтому null-поля отбрасываются."""
|
||||||
|
if isinstance(value, dict):
|
||||||
|
return {k: strip_nulls(v) for k, v in value.items() if v is not None}
|
||||||
|
if isinstance(value, list):
|
||||||
|
return [strip_nulls(v) for v in value]
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
def compare_stitched(full_rows: list[dict], stitched: list[dict]) -> list[str]:
|
def compare_stitched(full_rows: list[dict], stitched: list[dict]) -> list[str]:
|
||||||
problems: list[str] = []
|
problems: list[str] = []
|
||||||
|
stitched = strip_nulls(stitched)
|
||||||
if len(full_rows) != len(stitched):
|
if len(full_rows) != len(stitched):
|
||||||
problems.append(f"число строк: прежний ответ {len(full_rows)}, склейка {len(stitched)}")
|
problems.append(f"число строк: прежний ответ {len(full_rows)}, склейка {len(stitched)}")
|
||||||
ids = [_line_id(r) for r in stitched]
|
ids = [_line_id(r) for r in stitched]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user