Repository navigation
fix(ndd): preserve nested JSON storage across workflow handoffs - #375
Conversation
[High impact] The PR appears safe to merge; no new blocking issues were found. SummaryThe PR preserves nested engine columns across DataDesigner workflow handoffs.
No new actionable issues were found in the changes since the previous review. Reviews (4) · Last reviewed commit: "fix(ndd): wrap seed errors and verify mu..." · Reviewed by Greptile |
|
A Non Blocking Consideration: Anonymizer already handles nested NumPy arrays from Parquet reloads. Could we add a test confirming those inputs still work with the new JSON storage? Codex reproduced a failure with an ordinary pandas reload, though the normal DD reader path passes. |
binaryaaron
left a comment
There was a problem hiding this comment.
agent (
review-pr): The blocking issue is Andre's thread atstorage.py:84; #378 fixes it against this branch. The points below are separate from that fix.
- Should-fix: the tests do not cover more than one batch, and the description says they do. Every DataDesigner test in
tests/engine/test_ndd_storage.pyuses a single record and never setsbuffer_size, but the description claims "two-batch DataDesigner coverage". That gap is why the multi-batch failure was not caught. #378 adds one adapter-level test withbuffer_size=2; a Substitute or latent-detection handoff test with two row groups would cover the production path. Please also correct the description. - Should-fix: the error escapes as DataDesigner's
InvalidFileFormatError, notAnonymizerWorkflowError.prepare_json_storage_seedruns outside the adapter'stry(adapter.py:352and:515), so any encode failure on the seed reaches the caller as a raw DataDesigner exception. Moving the call inside thetry, or wrapping it, keeps the adapter's error contract. - Should-fix:
pyproject.toml:11widens the cap todata-designer>=0.10.0,<2. DataDesigner is pre-1.0, and 0.9 to 0.10 changed storage behavior that this PR depends on. Main capped at<0.10;<0.11keeps that discipline. - Nit:
test_dd010_all_failed_batch_still_raises_not_failed_recordspins the #331 behavior. It will need flipping when #331 lands; a comment naming #331 would make that clear. - Nit:
plans/dd-json-storage/plan.mdrecords run-specific counts ("1,613 passed", "113 hash-locked…"), which will go stale.
On @memadi-nv's question about nested NumPy arrays from Parquet reloads: #378 converts them before encoding, and test_seed_values_are_plain_python_before_json_encoding[numpy] covers that case.
Signed-off-by: lipikaramaswamy <lramaswamy@nvidia.com>
prepare_json_storage_seed normalized only Arrow-backed columns. When row groups infer different nested types, DataDesigner reads a registered side-effect column back as object arrays, and its JSON encoder rejects the numpy arrays inside (and NaN or numpy scalars). Normalize every registered column with to_python, moved from rewrite/parsers.py to schemas/shared.py so ndd does not import rewrite. Add a two-row-group handoff test and a NaN/numpy seed test; both fail without the fix. 🤖 Generated with Claude Code Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com> Co-authored-by: Claude <noreply@anthropic.com>
f0f654e to
42a9827
Compare
Signed-off-by: lipikaramaswamy <lramaswamy@nvidia.com>
|
@memadi-nv — your NumPy reload concern is addressed by the merged #378 and the follow-up in f858c4b. |
|
@binaryaaron — addressed all five points from your review in f858c4bb:
#378 is merged into this branch, and the rebase onto main preserves #367's strict parser alongside the shared converter. Validation: |
Two notes, neither blocking:
|
|
@binaryaaron — thanks for the recheck. Agreed that these two notes are nonblocking for the current schemas.
No additional code changes in response to these notes. The earlier fixes and validation remain at f858c4b. |
|
Related Issue
No linked issue required: maintainer-requested shared DataDesigner upgrade and JSON-storage prerequisite for the nested-column handoff reported on #305.
Related: #331 remains unresolved by this change; this PR does not close it.
Plan Document
plans/dd-json-storage/plan.md
Summary
data-designer>=0.10.0,<0.11(lockfile resolves DD/config/engine 0.10.0), and update the notebook Pillow range to compatible 13.x.buffer_size=2) carried into both production Substitute-map generation and latent detection. Assert preserved record order, IDs, and diagnostic entity spans.AnonymizerWorkflowErrorwith the original exception chained, for run, preview, and exported configs.Scope and follow-up for #305
This is a shared prerequisite, not a claim that Aaron's complete #305 report is fixed. Main does not contain
COL_VALIDATION_INVENTORIES; #305 must register that constant after rebasing. DD 0.10 cannot independently declare JSON storage for plugin side-effect outputs, so initial inventory generation may also require a named output generator or upstream side-effect storage support.A deterministic all-failed DataDesigner generation test still raises
AnonymizerWorkflowErrorcaused byDataDesignerGenerationError. The missing-output/all-failed behavior in #331 is separate and deliberately unchanged.Type of Change
Contributor Checklist
Validation
make check: formatting, Ruff, full typecheck, lock freshness, and SPDX checks passed. Commit hooks and DCO signoff passed.pytest tests/engine/test_ndd_adapter.py tests/engine/test_ndd_storage.py -q: 37 passed.buffer_size=2: an empty-entity row group followed by a populated group. Model generation and readiness are stubbed; scheduling, prompt rendering, parsing, and Parquet I/O are real.make testwith a short temporary path and local socket access: 1,776 passed, 2 skipped.<0.11changed no resolved package versions.Documentation and Artifacts
make docs-buildpasses locally (not run; no site documentation changes)