We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c7039df + d58bf8b commit 4ecc480Copy full SHA for 4ecc480
1 file changed
src/mmirage/shard_utils.py
@@ -312,6 +312,14 @@ def _list_shard_dirs(dataset_dir: str) -> List[str]:
312
for name in os.listdir(dataset_dir):
313
if not name.startswith("shard_"):
314
continue
315
+ # Only accept canonical shard directories of the form "shard_<int>"
316
+ # and explicitly skip atomic-save temp dirs like
317
+ # "shard_0.tmp.<host>.<pid>.<uuid>".
318
+ if ".tmp." in name:
319
+ continue
320
+ suffix = name[len("shard_") :]
321
+ if not suffix.isdigit():
322
323
path = os.path.join(dataset_dir, name)
324
if os.path.isdir(path):
325
shard_dirs.append(path)
0 commit comments