refactor: remove verified dead code#791
Conversation
Remove unreachable helpers and production code exercised only by tests after a triple review of static references, runtime registration paths, and extension surfaces. Keep reusable observability fixtures in the explicit engine.testing namespace. Closes #789 Signed-off-by: Nabin Mulepati <nmulepati@nvidia.com>
|
Fern preview: https://nvidia-preview-pr-791.docs.buildwithfern.com/nemo/datadesigner
|
Greptile SummaryThis PR removes verified dead code across three packages (
|
| Filename | Overview |
|---|---|
| packages/data-designer-engine/src/data_designer/engine/dataset_builders/utils/async_concurrency.py | Removes entire AsyncConcurrentExecutor class and its supporting types (Success, Failure, TaskResult); retains only the process-wide ensure_async_engine_loop() singleton used by the live async engine. |
| packages/data-designer-engine/src/data_designer/engine/observability.py | Removes InMemoryAdmissionEventSink and CorrelatedRuntimeView from the production module; these are cleanly re-exported from the new testing namespace. |
| packages/data-designer-engine/src/data_designer/engine/testing/observability.py | New file — homes InMemoryAdmissionEventSink and CorrelatedRuntimeView in the intentional testing namespace; implementation is identical to what was removed from observability.py. |
| packages/data-designer-engine/src/data_designer/engine/dataset_builders/utils/skip_tracker.py | Removes SkipMetadataRestoreContext, SKIP_METADATA_RESTORE_ID_COLUMN_PREFIX, prepare_records_for_skip_metadata_round_trip, restore_skip_metadata, and _choose_restore_id_column — all confirmed dead by grep. |
| packages/data-designer-engine/src/data_designer/engine/models/parsers/postprocessors.py | Removes RealizePydanticTypes postprocessor class; PydanticTypeBlock type definition remains in types.py but is now without a producer. |
| packages/data-designer-engine/src/data_designer/engine/dataset_builders/dataset_builder.py | Removes set_processor_runner() and single_column_config_by_name cached_property; tests are updated to use a local _replace_processors helper that accesses _processor_runner directly. |
| packages/data-designer-config/src/data_designer/config/utils/io_helpers.py | Removes ensure_config_dir_exists() and smart_load_dataframe() helpers plus the now-unused PurePosixPath import; both functions had no production callers. |
| packages/data-designer/src/data_designer/cli/repositories/persona_repository.py | Removes get_dataset_name() and get_dataset_prefix() convenience methods; the test that depended on get_dataset_prefix() is updated to use an inline constant. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph removed["Removed from Production"]
ACE["AsyncConcurrentExecutor\n(async_concurrency.py)"]
TR["TaskResult dataclass\n(task_model.py)"]
RPT["RealizePydanticTypes\n(postprocessors.py)"]
SMR["SkipMetadata round-trip helpers\n(skip_tracker.py)"]
IH["ensure_config_dir_exists /\nsmart_load_dataframe\n(io_helpers.py)"]
UMA["UnknownModelAliasError\n(errors.py)"]
VCO["_validate_cell_output\n(custom.py)"]
end
subgraph moved["Moved to Testing Namespace"]
IMAS_old["observability.InMemoryAdmissionEventSink"]
CRV_old["observability.CorrelatedRuntimeView"]
end
subgraph testing["data_designer.engine.testing"]
IMAS_new["testing.InMemoryAdmissionEventSink"]
CRV_new["testing.CorrelatedRuntimeView"]
end
subgraph kept["Retained"]
EAEL["ensure_async_engine_loop()\n(async_concurrency.py)"]
end
IMAS_old --> IMAS_new
CRV_old --> CRV_new
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
subgraph removed["Removed from Production"]
ACE["AsyncConcurrentExecutor\n(async_concurrency.py)"]
TR["TaskResult dataclass\n(task_model.py)"]
RPT["RealizePydanticTypes\n(postprocessors.py)"]
SMR["SkipMetadata round-trip helpers\n(skip_tracker.py)"]
IH["ensure_config_dir_exists /\nsmart_load_dataframe\n(io_helpers.py)"]
UMA["UnknownModelAliasError\n(errors.py)"]
VCO["_validate_cell_output\n(custom.py)"]
end
subgraph moved["Moved to Testing Namespace"]
IMAS_old["observability.InMemoryAdmissionEventSink"]
CRV_old["observability.CorrelatedRuntimeView"]
end
subgraph testing["data_designer.engine.testing"]
IMAS_new["testing.InMemoryAdmissionEventSink"]
CRV_new["testing.CorrelatedRuntimeView"]
end
subgraph kept["Retained"]
EAEL["ensure_async_engine_loop()\n(async_concurrency.py)"]
end
IMAS_old --> IMAS_new
CRV_old --> CRV_new
Reviews (2): Last reviewed commit: "fix: preserve active capacity diagnostic..." | Re-trigger Greptile
Code Review: PR #791 —
|
📋 Summary
Remove production code that a triple review confirmed is unreachable or used only by tests. The review covers static references, runtime registration and callback paths, repository history, extension surfaces, and open-PR dependencies; capacity planning and completion diagnostics used by #745 and #743 are explicitly retained.
🔗 Related Issue
Closes #789
🔄 Changes
✨ Added
data_designer.engine.testingnamespace.🔧 Changed
🗑️ Removed
🔍 Attention Areas
io_helpers.py— removes two unexported, undocumented helpers with no production callers.async_concurrency.py— removes the obsolete executor while retaining the live shared event-loop lifecycle.skip_tracker.py— removes the orphaned sync-engine round-trip restoration subgraph; no open PR references it.🧪 Testing
make testpasses — not run directly; the complete package test suites were run via pytest.git diff --checkpass.✅ Checklist
Description updated with AI