Remove redundant empty-frame guard in FocusCsvSerializer
Polars write_csv already handles empty DataFrames correctly (outputs header-only CSV), so the conditional branch was a no-op. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
230c85313b
commit
9e623ceaff
@ -16,7 +16,6 @@ class FocusCsvSerializer(FocusSerializer):
|
||||
|
||||
def serialize(self, frame: pl.DataFrame) -> bytes:
|
||||
"""Encode the provided frame as a CSV payload."""
|
||||
target = frame if not frame.is_empty() else pl.DataFrame(schema=frame.schema)
|
||||
buffer = io.BytesIO()
|
||||
target.write_csv(buffer)
|
||||
frame.write_csv(buffer)
|
||||
return buffer.getvalue()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user