feat: define public generation invocation contract - #854
Conversation
|
Fern preview: https://nvidia-preview-pr-854.docs.buildwithfern.com/nemo/datadesigner
|
Greptile SummaryThe PR defines a public generation invocation contract and exposes typed configuration, artifact, completion, partial-run, early-shutdown, and resume metadata.
|
| Filename | Overview |
|---|---|
| packages/data-designer-config/src/data_designer/config/utils/io_helpers.py | The revised path heuristics fix the previously reported mixed-case, malformed-filename, and mapping-like absolute-path classification failures. |
| packages/data-designer-config/src/data_designer/config/config_builder.py | Builder loading now translates filesystem and YAML decoding failures into public configuration error types. |
| packages/data-designer/src/data_designer/interface/results.py | Adds public dataset outcome metadata and normalizes missing or unreadable artifact failures. |
| packages/data-designer/src/data_designer/interface/composite_workflow.py | Reconstructed completed-stage results now retain the relevant requested record count. |
| packages/data-designer/src/data_designer/interface/data_designer.py | Creation results now receive invocation record counts, early-shutdown state, and requested and effective resume modes. |
Reviews (9): Last reviewed commit: "fix: tighten generation result contract" | Re-trigger Greptile
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Thanks for putting this together, @andreatnvidia! SummaryThis PR defines the optional-package invocation boundary, promotes the relevant public errors, and adds result metadata for record counts, partial completion, early shutdown, artifact resolution, and resume decisions. The implementation mostly matches that intent, but a valid inline-config case now breaks and a few documented public error/outcome guarantees are not yet enforced. FindingsCritical — Let's fix these before merge
Warnings — Worth addressing
What Looks Good
VerdictNeeds changes — fix the inline-YAML regression, complete the promised public error normalization for malformed/missing artifacts, and align the published run-outcome documentation with the new contract. This review was generated by an AI assistant. |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Thanks for the detailed review, @nabinchha. I pushed The config loader now parses inline YAML before deciding that a string is a missing file path, and invalid UTF-8 is normalized to I added focused regression coverage for these cases. Ruff, the 839 config/interface tests, and the Fern docs checks pass locally. |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Thanks for the quick follow-up, @andreatnvidia! SummaryThe three new commits address the four findings from my earlier review and the subsequent Greptile path-classification comment, with focused tests and updated Fern guidance. Two edge cases still leave the public error boundary dependent on input shape or raw filesystem exceptions. FindingsWarnings — Worth addressing
What Looks Good
VerdictNeeds changes — clarify the remaining path-versus-inline parser ambiguity and finish normalizing inaccessible batch reads across the public result-counting boundary. This review was generated by an AI assistant. |
Classify malformed inline configs independently of filename suffixes. Wrap unreadable result artifacts in the public storage error across counting and export paths. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
@nabinchha I tightened up both remaining edge cases in Malformed inline YAML is no longer mistaken for a missing file based on its suffix. Missing-file handling now requires clear path evidence, with regression coverage for I also wrapped failures while reading batch metadata and export inputs in Mind taking another look? |
|
Thanks for another focused follow-up, @andreatnvidia! SummaryCommit FindingsWarnings — Worth addressing
What Looks Good
VerdictNeeds changes — resolve the existing Greptile path-syntax thread and complete the public normalization for corrupt dataset and unreadable processor artifacts. This review was generated by an AI assistant. |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
@nabinchha I tightened the results boundary in 8ad60d2: corrupt Parquet reads and processor output read failures now surface as ArtifactStorageError. Export-time schema incompatibilities still use InvalidFileFormatError. I also fixed the absolute-path classification Greptile called out. Could you take another look? |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
nabinchha
left a comment
There was a problem hiding this comment.
Thanks for the careful follow-up, @andreatnvidia!
Summary
Commits 8ad60d21 and 4de14e9e resolve the previously reported corrupt-Parquet, processor-read, and absolute-path classification cases, and they tighten the requested-count invariant in reconstructed workflow results. The implementation matches the stated intent; one pre-existing processor-artifact edge case may be worth handling in a follow-up.
Findings
Suggestions — Take it or leave it
plans/850/data-designer-contract.md:260 — Consider covering empty processor artifact directories in a follow-up
- What: The pre-existing processor loader treats an existing
processors-files/<name>/directory containing no Parquet files as a successful empty(0, 0)DataFrame. This behavior is unchanged by the PR, whose new normalization correctly handles missing paths, filesystem failures, and corrupt Parquet. - Why: An empty directory left by an interrupted or moved processor run could still be mistaken for a valid processor result, although this is not a regression introduced by these changes.
- Suggestion: As a follow-up, we could have the storage loader treat a processor directory with no Parquet files as missing while continuing to allow a genuine zero-row Parquet file.
What Looks Good
- Corrupt Parquet now consistently becomes
ArtifactStorageErroracross dataset loading, counting, all export paths, and processor reads, with the underlying cause preserved. - Absolute config paths now take precedence over inline-YAML heuristics, including mapping-like filenames, and the early-shutdown docstring accurately distinguishes zero-record failures from partial returns.
- Making
requested_num_recordsrequired removes the tri-stateis_partialresult, while the workflow reuse guard safely rerunsIF_POSSIBLEstages whose older metadata lacks the required count.
Verdict
Ship it (with nits) — the new commits resolve the outstanding review findings; the empty processor-directory behavior is pre-existing and can be handled separately.
This review was generated by an AI assistant.
📋 Summary
Defines a stable public generation contract for optional execution packages so they can configure, validate, invoke, and classify Data Designer runs without importing
data_designer.engine. It also normalizes builder-loading failures and exposes public outcome metadata for complete, partial, resumed, and early-shutdown invocations.🔗 Related Issue
Closes #851
Related to #850
🔄 Changes
InvalidConfigError,InvalidFileFormatError, andInvalidFilePathErrorfromdata_designer.config, andArtifactStorageErrorfromdata_designer.interface.DatasetCreationResults.🔍 Attention Areas
DatasetCreationResults- public completion and resume semantics.🧪 Testing
make testpasses - not run; targeted package suites were used..venv/bin/pytest packages/data-designer-config/tests packages/data-designer/tests -p no:cacheprovider(1772 passed, 1 skipped).venv/bin/ruff check --fix ..venv/bin/ruff format .✅ Checklist