Fix notebook restart flow: clear stale artifacts and guard against empty/corrupt checkpoint CSVs#134
Open
charlesmartin14 wants to merge 1 commit intomainfrom
Open
Conversation
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.
Motivation
pandas.errors.EmptyDataErrorand aborting runs.Description
remove_stale_run_artifacts()helper andstart_freshlogic that clearsregistry/,per_dataset/,aggregate/, andlogs/whenFORCE_RESTART_ALLis True or when restart/resume is disabled (RESTART=FalseorRESUME_FROM_CHECKPOINT=False).full_registry.csvwithtry/exceptcatchingpd.errors.EmptyDataErrorandpd.errors.ParserError, unlinking invalid caches and rebuilding via the scan when needed.random10_registry.csvwith the same guards and fallback resampling when the cached CSV is invalid or empty.load_dataset_checkpoint) robust to empty/corrupt metrics CSVs by catching CSV parse errors, removing bad files, and starting the dataset from round 1.Testing
python -c "import json; json.load(open('notebooks/XGBWW_Random10_LongRun_Alpha_Tracking.ipynb')); print('ok')", which succeeded.Starting fresh run,remove_stale_run_artifacts,Invalid cached full registry,Invalid cached sampled registry, andInvalid dataset checkpointinnotebooks/XGBWW_Random10_LongRun_Alpha_Tracking.ipynb, which returned matches.remove_stale_run_artifacts, safe CSV reads forfull_registry.csv/random10_registry.csv, and updatedload_dataset_checkpointbehavior were inserted correctly.Codex Task