Skip to content

_compact_sample_rows

Internal helper
This page documents an internal implementation helper, not a primary public API.
Source code in src/fabricops_kit/ai.py
289
290
291
292
293
294
295
def _compact_sample_rows(sample_rows=None) -> str:
    if sample_rows is None:
        return ""
    try:
        return json.dumps(sample_rows, ensure_ascii=False)[:3000]
    except Exception:
        return str(sample_rows)[:3000]