Skip to content

Preserve dataset files when JSONL generation fails - #4

Merged
lmlearning merged 1 commit into
mainfrom
fix/atomic-jsonl-output
Sep 25, 2026
Merged

lmlearning merged 1 commit into
mainfrom
fix/atomic-jsonl-output

Conversation

@lmlearning

Copy link
Copy Markdown
Owner

A serialization error or interrupted input iterator previously truncated an existing dataset and left partial output. Write to a temporary file in the destination directory and atomically replace the destination only after successful serialization and close. Clean up temporary files on failure.

Keep iterable input, Unicode output and empty-file behavior. Document atomic replacement's scope, including new-file permissions and the absence of power-loss or concurrent-writer guarantees. Add Linux/Windows CI.

Validation: all 72 tests pass, including 7 new regressions for replacement, Unicode, empty input, serialization/iteration failure and failed replacement.

@lmlearning
lmlearning merged commit 3fa9575 into main Sep 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant