Repository navigation
fix: prevent dataset folder collisions - #1051
Conversation
Prevent fresh generation runs from sharing an artifact directory when their folder timestamps collide. Keep resumed runs in their existing directories and refresh media paths after claiming a fresh directory. Fixes #1050 Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Fern preview: https://nvidia-preview-pr-1051.docs.buildwithfern.com/nemo/datadesigner
|
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryFresh runs now claim dataset directories atomically instead of sharing a folder when names collide.
|
|
Thanks for putting this together, @andreatnvidia. It's a tight, well-scoped fix for a nasty data-mixing bug. SummaryBefore this PR, a fresh FindingsSuggestions — Take it or leave it
What Looks Good
Residual Risk
Structural Impact (graphify 0.9.90, 8.1s)Risk: HIGH (3 core abstraction(s) modified)
Core Abstractions Modified
High-Connectivity Changes
Cross-Package Dependencies
VerdictShip it (with nits): there are no blocking issues. The suggestions above (one source of truth for This review was generated by an AI assistant. |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
|
||
| if dataset_path != self.base_dataset_path: | ||
| logger.info(f"📂 Dataset directory already claimed. This run will be saved to {str(dataset_path)!r}.") | ||
| self.resolved_dataset_name = dataset_path.name |
There was a problem hiding this comment.
resolved_dataset_name is a cached_property, not a Pydantic field. Pydantic 2.9 and 2.10 reject this direct assignment with ValueError, and both versions are allowed by pydantic>=2.9.2,<3. Every fresh create() call therefore fails after creating its directory in those environments.
Keep the direct __dict__ update, or require a Pydantic version that supports assigning to cached properties.
| self.resolved_dataset_name = dataset_path.name | |
| self.__dict__["resolved_dataset_name"] = dataset_path.name |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/data-designer-engine/src/data_designer/engine/storage/artifact_storage.py
Line: 190
Comment:
**Fresh dataset creation fails**
`resolved_dataset_name` is a `cached_property`, not a Pydantic field. Pydantic 2.9 and 2.10 reject this direct assignment with `ValueError`, and both versions are allowed by `pydantic>=2.9.2,<3`. Every fresh `create()` call therefore fails after creating its directory in those environments.
Keep the direct `__dict__` update, or require a Pydantic version that supports assigning to cached properties.
```suggestion
self.__dict__["resolved_dataset_name"] = dataset_path.name
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Looks good overall. Please restore the Once that’s addressed, I’m happy to approve. Could we also track a low-priority refactor to finalize the dataset directory after the resume decision and before initializing media storage? That would remove the need to rewrite the cached name and refresh media paths. |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Summary
Fresh
create()calls can select the same artifact directory and overwrite each other's batches, causing results to include another run's rows. Claim each fresh directory atomically after the resume decision so repeated or concurrent calls cannot share it.Related Issue
Fixes #1050
Follow-up refactor: #1056 (low priority).
Changes
create()docstring.Testing
.venv/bin/pytest -q packages/data-designer-engine/tests: 2,489 passed..venv/bin/pytest -q packages/data-designer/tests: 1,186 passed, 3 skipped.packages/,scripts/, andtests_e2e/; commit hooks passed.Checklist