We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/deephaven/deephaven-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
_yaml.py•849 B
"""YAML formatter for PyArrow tables."""
import pyarrow as pa
import yaml # type: ignore[import-untyped]
def format_yaml(arrow_table: pa.Table) -> str:
"""
Format Arrow table as YAML.
Args:
arrow_table (pa.Table): PyArrow Table to format
Returns:
str: YAML-formatted string.
Example:
records:
- id: 1
name: Alice
age: 30
- id: 2
name: Bob
age: 25
Note:
PyYAML handles escaping and special characters automatically.
"""
# Use iterator to avoid loading entire table into memory
records = []
for batch in arrow_table.to_batches():
records.extend(batch.to_pylist())
data = {"records": records}
result: str = yaml.dump(data, default_flow_style=False, allow_unicode=True)
return result