Skip to content

Commit f58a599

Browse files
docs: clarify narwhals CSV separator fallback rationale
1 parent a5a2f1d commit f58a599

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

marimo/_utils/narwhals_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def dataframe_to_csv(df: IntoFrame, separator: str | None = None) -> str:
109109
if resolved_separator == ",":
110110
return frame.write_csv()
111111

112+
# Narwhals inputs can map to different backends, and
113+
# write_csv(separator=...) is not consistently reliable across them.
114+
# For non-comma separators, use Python's csv writer for stable behavior.
112115
buffer = io.StringIO()
113116
writer = csv.writer(
114117
buffer, delimiter=resolved_separator, lineterminator="\n"

0 commit comments

Comments
 (0)