fix(backend): restore PyYAML cp38 hashes in poetry.lock and guard row truncation

- Re-add PyYAML cp38 wheel hashes dropped by local poetry lock on
  Python 3.13 (CI needs them for Python 3.11)
- Truncate rows to header length before dict conversion to prevent
  None keys when data rows exceed header column count
This commit is contained in:
Zamil Majdy
2026-03-13 18:17:22 +07:00
parent b3af75a71e
commit cb50c48eda

View File

@@ -307,7 +307,10 @@ def _tabular_to_list_of_dicts(parsed: list) -> list[dict[str, Any]]:
Ragged rows (fewer columns than the header) get None for missing values.
"""
header = parsed[0]
return [dict(itertools.zip_longest(header, row)) for row in parsed[1:]]
return [
{col: (row[i] if i < len(row) else None) for i, col in enumerate(header)}
for row in parsed[1:]
]
def _tabular_to_column_dict(parsed: list) -> dict[str, list]: