Repository navigation
fix: make drop flags order-independent by deriving them from the full config - #1057
Conversation
Refs NVIDIA-NeMo#996 Co-authored-by: Grok Bot <noreply@grokbot.com>
Whether a column ended up with drop=True depended on whether the columns or the drop processor were added first, and replacing a processor cleared drop flags the user had set on columns. Stop mutating column configs in add_processor and derive the flag in build() instead, on copies, so every call order gives the same config. Read dropped names from the built config when displaying a record, and skip glob-targeted columns when deciding whether a default drop processor is needed. Fixes NVIDIA-NeMo#996 Co-authored-by: Grok Bot <noreply@grokbot.com>
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryDerives processor-driven drop flags from the complete config, regardless of declaration order.
|
There was a problem hiding this comment.
Thanks for putting this together, @namanraii — resolving drops from the complete configuration follows the direction agreed in #996.
Summary
This addresses declaration-order dependence, preserves explicitly declared drop flags during processor replacement, and prevents redundant default drops for glob targets. One save/reload/edit regression remains; that lifecycle was not specified in the original acceptance criteria, and the plan explicitly calls out the behavior.
Findings
Critical — Let's fix these before merge
packages/data-designer-config/src/data_designer/config/config_builder.py:434–436 — [P2] Preserve authored drop flags in builder exports
- What:
build()now materializes processor-deriveddrop=True, andget_builder_config()/write_config()export that effective state. Afterfrom_config(), those derived flags become permanent declarations. Configurecleanupto droptmp_a, save/reload the builder, then replacecleanupto drop onlytmp_b: both columns remain dropped. The same edit on the original builder drops onlytmp_b. A sampler-only generation run confirmed the output difference: the original builder emits["keep", "tmp_a"], while the reloaded builder emits only["keep"]. - Why: Saving and reloading changes subsequent editing behavior. The engine adds its default drop processor for the stale
tmp_aflag, excluding a column the replacement processor no longer targets. I reproduced this against the PR and its parent: the parent clearstmp_ain both cases. Although the plan acknowledges the effective-to-explicit conversion, this is a user-visible compatibility regression worth resolving before merge. - Suggestion: Keep effective flags in
build(), but preserve authored column flags inget_builder_config()/write_config()so they can be recomputed after reload. This can be addressed without adding a public schema field. Add a save → reload → replace regression test, including an explicitly declareddrop=Truecolumn that must remain dropped. Keep compiled run artifacts as effective execution snapshots: resume checks compare their fingerprints. Direct serialization ofbuild()can be documented separately with those snapshot semantics.
What Looks Good
- Deriving flags on copies removes the original order dependence without mutating the builder's column declarations.
- The engine reuses its existing resolver for glob-aware default-drop suppression while preserving processor order and package layering.
- Sampler-only integration coverage checks both emitted columns and profiling with
preserve_dropped_columns=False.
Residual Risk
Reviewed head ca3f9b6994ae875ab2c47937ac881ba1ac9ab3f7, verified unchanged at the end of the review. Validation across rounds: 1,193 tests passed across the complete config suite, related compiler/validation/processing tests, dataset builder tests, the affected interface test module, and all 78 composite workflow tests. Ruff lint and formatting checks passed on all eight changed Python files. The reload regression was separately reproduced against the PR and its parent, then verified in actual dataset generation. Additional targeted probes covered custom config copying and 50,000 builder state transitions without another confirmed defect. The full repository suite was not run.
Verdict
Needs changes — preserve authored flags in builder exports and add the reload-and-replace regression test. No additional confirmed findings.
This review was generated by an AI assistant.
get_builder_config() and write_config() now export the column drop flags as authored instead of the processor-derived effective state from build(). A builder reloaded with from_config() recomputes processor drops, so replacing a drop processor afterwards behaves the same as on the original builder. build() still returns the effective snapshot. Co-authored-by: Grok Bot <noreply@grokbot.com> Signed-off-by: Naman Rai <172734224+namanraii@users.noreply.github.com>
|
Thanks for catching this. get_builder_config() and write_config() now export the column drop flags as you wrote them, so a reloaded builder recomputes the processor drops. build() still returns the effective flags, and run artifacts are unchanged. I added a save, reload and replace test (YAML and JSON) that includes a column explicitly set to drop=True, and updated the plan doc to say that serializing build() output directly gives a snapshot. |
|
Thanks for addressing the builder export regression, @namanraii! SummaryRe-reviewed the full PR at FindingsWarnings — Worth addressing
What Looks Good
VerdictNeeds changes — fix all four style items above before shipping. The previous correctness blocker is resolved; these remaining requests enforce the repository's documented conventions. Validation of the current implementation: all three package suites were exercised, with 4,435 passed and 3 skipped in the full run. Six attribution-header failures were caused by my telemetry-disable test setting; all 14 related tests, including those six, passed with the expected default restored. Ruff lint and formatting passed for all eight changed Python files. Additional independent lifecycle, plugin, fingerprint, and rendering checks found no new correctness issue. This review was generated by an AI assistant. |
Annotate the new tests and builder_with_columns fixture, move the sampler helper to module scope as make_sampler_column, rename _built_drop_flags to _get_built_drop_flags, and place the new private config builder helpers after the public methods. Co-authored-by: Grok Bot <noreply@grokbot.com> Signed-off-by: Naman Rai <172734224+namanraii@users.noreply.github.com>
|
Thanks for the re-review, @nabinchha! Addressed all four items in 04b9dba:
No behavior changes. Ruff lint and format pass, and the config (667), engine (2579) and interface (1194) suites pass. |
|
Thanks for addressing the four style requests, @namanraii! SummaryRe-reviewed FindingsWarnings — Worth addressing
What Looks Good
Residual RiskValidation: 248 tests passed across the four affected test modules; Ruff lint and formatting checks passed for all eight changed Python files. Independent AST comparison confirmed production code is unchanged apart from method ordering and test assertions/decorators remain equivalent after helper/annotation normalization. The full package suites were exercised in the prior review and were not repeated for these style-only edits. VerdictNeeds changes — one final test-helper ordering cleanup for complete compliance with the documented style rule. All four previously posted requests are resolved; there are no new correctness findings. This review was generated by an AI assistant. |
Co-authored-by: Grok Bot <noreply@grokbot.com> Signed-off-by: Naman Rai <172734224+namanraii@users.noreply.github.com>
|
Thanks @nabinchha! Moved |
Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
nabinchha
left a comment
There was a problem hiding this comment.
Thanks for addressing the review feedback, @namanraii!
Summary
Reviewed the final revision, including removal of the unnecessary implementation plan. The order-independent drop behavior, authored-config round trips, and requested style fixes are complete.
Findings
No remaining actionable findings. The previously reported correctness and style issues are resolved, and the scoped security review found no vulnerabilities introduced by these changes.
What Looks Good
- Builder exports preserve authored flags while execution resolves effective drops.
- Regression tests cover call order, processor replacement, explicit drops, and YAML/JSON reloads.
- The final commit deletes only the plan; the PR description no longer references it.
Verdict
Ship it. Approved at a7fab32d061655ee73d304eb2818707c5a0019bd. Prior test, lint, formatting, lifecycle, and security-review evidence remains applicable; no runtime code changed in the final plan-removal commit.
This review was generated by an AI assistant.
Use the configured-builder fixture so config-only CI does not require engine-provided default model configs. Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
Fixes #996
Summary
Drop flags were derived in a way that depended on the order columns were added to the config, so the same set of columns could produce different drop behavior depending on declaration order. This change derives drop flags from the full config, making them order-independent. Touches the config builder, visualization helper, engine compiler, and dataset builder.
Tests
Added regression tests covering different column orderings in:
tests/config/test_config_builder.pytests/config/utils/test_visualization.pyengine/.../dataset_builders/test_dataset_builder.pytests/interface/test_data_designer.pyNotes
test_import_performancefails locally on plainmainas well, so that failure is pre-existing and unrelated to this change.