fix(cli): preserve raw text when SQL results contain pipes or newlines (#13432)
Merged
DW
1mo ago+75+75+01234567890123456789-7-7-0123456789
Fixes #13432
Summary
Prevents silent data truncation and table corruption when omi --json local sql receives query results containing pipe (|) delimiters or multiline text cells.
Changes Made
- Updated
_normalize_sql_resultinsdks/python-cli/omi_cli/commands/local.pyto verify that the parsed row count matchesexpected_countfrom the footer and that every line splits into exactlylen(columns)values. If a line contains extra pipe delimiters or multiline text,_normalize_sql_resultfalls back to{"text": result}to preserve raw text without discarding data. - Added regression tests in
sdks/python-cli/tests/test_local.pyvalidating raw text fallback when single-column output contains pipe characters or multiline strings.
Verification
- Executed
uv run pytest tests/test_local.py(49 passed). - Executed full test suite
uv run pytest(372 passed).