Repository navigation
fix: validate dataset sources before copying - #9618
Merged
koenvanderveen merged 5 commits intoNov 20, 2026
Merged
Conversation
yashb98
marked this pull request as ready for review
November 7, 2026 22:51
Check the mock, private and README paths in one place, at the start of _materialize_version, instead of again inside each _copy_* method. That also covers migrate_dataset, and removes the raise at the end of the copy methods that could no longer run. Replace the retry tests with one test for the three bad paths, and drop the RDS test that checked the same thing one layer up.
dev no longer has a codec for dataset protocol version 1.
Contributor
Author
|
Hi @koenvanderveen, sorry for the late reply. Thanks for reviewing this, tidying up the code and tests, and merging it. Really appreciate your time and help! |
Contributor
Author
|
@koenvanderveen , I’d be happy to help with more work on PySyft. I also work on ML systems, with PRs in PyTorch, JAX, bitsandbytes and Helion covering compiler fixes, CUDA performance and autotuning. Are there any issues, PRs or other areas you’d like me to look into? |
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.
Summary
create_datasetwith a private data path that does not exist, or a README that is missing, a folder or not a.mdfile, we previously copied the mock data (and the README, when only the private path was wrong) into the new dataset's folder before we raised the error. Now we check the mock, private and README paths before we copy anything, so a failed call leaves the SyftBox folder unchanged.create_datasetagain with the same name, we previously raisedFileExistsError, because the mock folder from the failed call was not empty, and the DO had to delete that folder by hand. Now the second call creates the dataset.Guidelines
High level
copy_pathstakingIterable[Path]instead ofIterator[Path], is a type hint on the same code path.create_datasetcan be retried with the same name.Mid level
_validate_source_fileschecks every source path once, at the start of_materialize_version, so it covers bothcreate_datasetandmigrate_dataset. The_copy_*methods only copy.test_bad_source_copies_nothing_and_retry_works, for a missing private file, a missing README and a README that is not.md.Low level
Security
No change.
Testing
test_bad_source_copies_nothing_and_retry_workspasses with the fix. Withdev'sdataset_storage.py, all 3 of its cases fail.dev, thesyft-datasetssuite andjust test-unit-fast(758 tests) pass.syft-rdssuite gives the same result with and without this change.Asana task