Issue 538: Skip individual split files that already exist#548
Open
mmarusiak wants to merge 1 commit into
Open
Conversation
Previously, all three splitters used an all-or-nothing approach: if any output file existed (via wildcard match), the entire input file was skipped. If even one output file was missing, the splitter re-split the whole input and overwrote all previously created children. Now each splitter checks existence per output file and only generates the missing ones: - GribSplitter: replaced the upfront should_skip() guard with a per-key should_skip_file() check inside the message loop, using a skipped_keys set to avoid redundant filesystem calls for the same output path. - GribSplitterV2: already checked per-file before running grib_copy, but the upload loop was copying every file grib_copy produced (including already-existing ones). Fixed by filtering the upload loop to only paths in output_paths. - NetCdfSplitter: removed the upfront should_skip() guard and moved the existence check into _write_dataset(), which now returns a bool so split_data() can track how many files were actually written. Added test_splits_only_missing_files for both GribSplitter/GribSplitterV2 (parametrized) and NetCdfSplitter: full split, delete one output file, re-split, assert only the deleted file was recreated and all others have unchanged modification times.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #538
Previously, all three splitters used an all-or-nothing approach: if any output file existed (via wildcard match), the entire input file was skipped. If even one output file was missing, the splitter re-split the whole input and overwrote all previously created children.
Now each splitter checks existence per output file and only generates the missing ones:
Added test_splits_only_missing_files for both GribSplitter/GribSplitterV2 (parametrized) and NetCdfSplitter: full split, delete one output file, re-split, assert only the deleted file was recreated and all others have unchanged modification times.