dlt._workspace.mcp.tools.helpers
format_csv
def format_csv(table: pa.Table, info: str = "") -> str
Format an Arrow table as a pipe-delimited CSV string, cleaning text columns.
- cleans string/large_string columns by normalizing unicode, stripping non-ascii characters, and replacing newlines with spaces.
- preserves original column types and table schema/metadata.
Arguments:
table- input Arrow table.info- optional info prefix to prepend to the CSV string.
Returns:
A string containing the optional info and a pipe-delimited CSV representation of the table with cleaned string columns.