Repository navigation
[v1] Modularity of Kedro-Viz using core inspection API. - #2782
Open
ravi-kumar-pilla wants to merge 55 commits into
Open
ravi-kumar-pilla wants to merge 55 commits into
ravi-kumar-pilla wants to merge 55 commits into
Conversation
* Foundations: snapshot loader, node-ID scheme, parity harness (#2655) First slice of the inspection-adapter work (issue #2655) — the floor everything else builds on. Purely additive on top of feat/backend_v2; no existing behaviour changed. - integrations/kedro/inspection/snapshot_source.py: load_snapshot / is_inspection_available / load_catalog_config (plus parameter-value loading and lite import stubs used by later layers). - integrations/kedro/inspection/__init__.py: package marker exposing the snapshot loader + node-ID helpers (the graph builder etc. are added in later layers). - integrations/kedro/node_ids.py: task_node_id / dataset_node_id — the shared new-scheme IDs the adapter graph and the run-status hook both use. New ID scheme = hash of [name, inputs, outputs] (tags excluded), a deliberate one-time break. - tests/test_inspection_adapter/: conftest (restores Kedro global state per module), capture_baseline + baseline/ (golden answer key captured from the live backend), test_snapshot_source, test_ids. Requires kedro>=1.4.0 for the inspection API; load_snapshot raises if it is unavailable. * Mark the parity-baseline fixtures as generated (.gitattributes) The baseline/*.json files are machine-generated by capture_baseline.py (not hand-written), so mark them linguist-generated to collapse them in PR diffs and exclude them from language stats. Reviewers should focus on the generator script and the tests, not the JSON. * fix(foundation): regenerate stale node-id baseline and guard it The checked-in node_id_report.json stored the old whole-node-string hash in its `graph_id` column (it was generated before task_node_id switched to the name+inputs+outputs scheme), so every stored graph_id disagreed with the current algorithm. test_ids never compared the two, so the stale baseline passed silently. - Regenerate node_id_report.json: graph_id now uses node_ids.task_node_id (the new scheme). It no longer equals runstatus_hook_id because the run-status hook still uses the legacy _hash(str(node)) scheme; aligning the hook is deferred to #2660. all_graph_ids_match_runstatus is now false -- the honest Foundation state. - Add test_stored_graph_id_matches_current_scheme so the baseline can never drift out of sync with the ID algorithm again. - capture_baseline.py: correct the misleading "the run-status hook already uses the shared scheme" comment, and drop the dangling INSPECTION_ADAPTER_PLAN.md doc reference. Graph baselines (main.json, pipelines/*.json) are intentionally unchanged -- they capture the live "before" output, whose old-scheme IDs are the parity oracle later phases diff against. * refactor(foundation): tighten docstrings and harden the ID tests Review polish for the foundation PR. - Docstrings describe current behavior, not roadmap/tasks: drop the "later layers add ..." framing and the "preserving the API contract" wording from inspection/__init__; neutralize node_ids' "shared by the run-status hook" claim (the hook is not aligned until #2660); remove internal decision IDs (D9, "Path B (D19)") and phase labels from the test docstrings and capture_baseline. - test_task_node_id_excludes_tags: replace the tautological "call it twice" assertion with a golden-hash check that pins the ID to exactly (name, inputs, outputs), so a future change that folds an extra field into the hash fails loudly. - capture_baseline.build_node_id_report: dedup by node identity (name, inputs, outputs) instead of by graph_id, so an ID collision between two distinct nodes is preserved for test_task_node_ids_are_unique to catch instead of being silently deduped away. - task_node_id: accept Sequence[str] (it does not mutate inputs/outputs). Output-neutral: node_id_report.json and the graph baselines regenerate byte-identical. * docs(foundation): conform docstrings to the kedro-viz house style Reviewed every docstring in the foundation files against the repo convention (short module docstrings, imperative Google-style function docstrings with Args/Returns, one-line test docstrings, no roadmap/decision-ID language). - Module docstrings trimmed to a concise noun-phrase (node_ids, snapshot_source, test_ids); dropped the multi-paragraph framing. - Function docstrings: task_node_id_for is now imperative; task_node_id gains a Returns section; load_catalog_config / load_parameters gain Args/Returns to match load_snapshot; added one-liners to _write_json / main. - Test docstrings: every test now carries a single-line description; collapsed the multi-paragraph ones. - Removed the dangling ``:mod:`.layers``` cross-reference (that module belongs to a later phase and is not in this PR). No behavior change. * More docstring cleanup * refactor(foundation): address review feedback (trim surface, rename, contract test) Code-review follow-ups on PR #2689: - inspection/__init__: stop re-exporting the node-id helpers; the package's public surface is just load_snapshot + is_inspection_available (consumers import the id helpers from node_ids directly). - snapshot_source: simplify the lite_import_stubs docstring; rename _config_loader -> _create_config_loader (factory-style name). - node_ids: drop the unused task_node_id_for wrapper (to be re-added in the phase that actually uses it). - tests: add a contract test asserting the snapshot exposes every field kedro-viz reads (pipelines/nodes/datasets/parameters), so a future change to the Kedro snapshot shape fails loudly. * refactor(foundation): require kedro>=1.4, drop the inspection-availability check Per review on PR #2689: the adapter is a breaking change that requires the Kedro inspection API, so older Kedro is dropped rather than detected. - requirements: bump the kedro floor 1.0.0 -> 1.4.0. - snapshot_source: remove is_inspection_available() and the load_snapshot ImportError guard (both unreachable once the floor is enforced). - inspection/__init__: export only load_snapshot. - tests: drop the availability test and the now-pointless skipif guards. - capture_baseline: add a TODO that the graph baselines + parity harness are temporary and to be removed before feat/backend_v2 merges to main. * test(foundation): cover the config-loader path to reach 100% Add targeted tests for the previously-uncovered config-loader functions in snapshot_source (load_catalog_config / load_parameters / _create_config_loader): - read the demo project's catalog config and parameter values - apply a --params runtime override (the merge branch) - fall back to {} when the catalog/parameters section is absent (parametrized) Brings package coverage to 100%, satisfying the --cov-fail-under=100 gate. * Code review fixes * Remove merging part * Rename InspectionSession
* Graph builder: main graph from the inspection snapshot Adds GraphBuilder, which turns the inspection snapshot into the main graph response (task/data/parameter nodes, edges, tags, pipelines, per-node pipeline membership, and data-node tags), validated by structural parity against the captured baseline. Modular pipelines, layers, and resolved parameters are deferred to later phases and left as empty placeholders. * Graph builder: aggregate node tags globally across pipelines Task and dataset tags were scoped to the selected pipeline, while pipeline membership was already aggregated globally. This diverged from the live backend, which merges tags into shared graph nodes. Index task and dataset tags alongside pipeline membership. Add cross-pipeline regression coverage and parity checks for per-node tags and membership in every pipeline view. Also cover source and sink nodes at the graph-builder level. * Comment updated * Test updated * transcoded dataset fixes * Code review suggestions * Refactor graph builder to aggregate task and dataset tags globally using _SnapshotGraphIndex * Rename methods in _SnapshotGraphIndex for clarity and consistency * Refactor GraphBuilder to use pipeline IDs for better clarity and add error handling for empty snapshots * Update test_per_node_fields_match_baseline docstring
* Add layer mapping support to GraphBuilder and implement layer extraction utility * Narrow node type in layer edge-case test to fix mypy union-attr * Raise on conflicting transcoded dataset layers (match legacy backend) * Enhance _extract_layers to support dataset name resolution and add unit tests for factory layer precedence * Add code review suggestions * Add code review suggestions * Add code review suggestions * Refactor _extract_layers call to use named parameters for clarity
* Add layer mapping support to GraphBuilder and implement layer extraction utility * Narrow node type in layer edge-case test to fix mypy union-attr * Raise on conflicting transcoded dataset layers (match legacy backend) * Enhance _extract_layers to support dataset name resolution and add unit tests for factory layer precedence * Add code review suggestions * Add code review suggestions * Add code review suggestions * Refactor _extract_layers call to use named parameters for clarity * Adopt NodeSnapshot.func_name from Snapshot * Enhance _is_auto_node_name docstring with detailed explanation and examples * Enhance docstrings for _display_name and _is_auto_node_name functions; add test for task node ID changes with I/O
* Modular pipelines from the inspection snapshot Derive modular pipelines from NodeSnapshot.namespace, without live Pipeline objects, and fill the placeholders the graph builder left behind. - modular_pipelines.py: ModularMembership (which modular pipelines each node belongs to), ModularTreeBuilder (the expand/collapse tree with per-pipeline boundary inputs and outputs), and the modular edge helpers including cycle removal. - graph_builder.py: emit modularPipeline nodes, modular edges and the tree response, and set modular_pipelines on task and dataset nodes. - Baseline parity now covers modular pipelines: node sets, every edge compared by raw ID, per-node membership, modular node tags, and the tree's inputs, outputs and children. - Add hermetic tests for membership, the tree and the edge helpers. The tree's __root__ children are compared by ID rather than by (ID, type): the legacy backend lists one parameter there twice, as both parameters and data, which is not reproduced here. * Enhance graph builder and modular pipelines to support modular membership and improve dataset handling; add tests for modular pipeline behavior and edge cases. * Fix modular-pipeline correctness gaps and align naming with the adapter Correctness: - Dataset owners and the tree now share one free-input/free-output calculation, so a dataset on an ancestor's boundary is no longer reported as belonging only to the inner pipeline. - The boundary calculation mirrors Kedro's Pipeline set algebra: transcoding is stripped only to decide what is intermediate, and names are compared in their original form. A transcoded dataset whose outside reader uses a different suffix is no longer treated as a boundary output, matching the legacy backend. - Deduplicate the global node set by task ID rather than name, so two pipelines registering same-named tasks with different I/O both keep their datasets. - A namespace literally called __root__ no longer collides with the synthetic root entry. - Modular edges are emitted in sorted order so responses are stable. Naming and docs, following the conventions used elsewhere in the adapter: - Drop the "membership" wording; ModularMembership becomes _ModularPipelineIndex with get_modular_pipelines_for_task/_for_dataset, mirroring _SnapshotGraphIndex. - Make the module's surface private, since nothing outside the package uses it. - Share one _create_task_node_id_from_snapshot helper instead of repeating the five-argument call, and trim the module docstring to what the file does. - get_modular_pipelines_for_dataset strips transcoding itself rather than relying on callers. Tests: regressions for each correctness fix, plus stronger parity checks that key nodes by type and ID and compare root children by ID and type after normalising the one known legacy duplicate. * Refactor graph builder and modular pipelines for improved modular membership handling; add tests for edge cases and reserved namespace validation. * Update error message for reserved namespace conflict in modular pipelines * Add docstrings to modular tree builder methods for clarity on functionality * Refactor modular pipeline data handling and improve index construction in tests * Refactor modular pipeline functions and update task node ID creation for improved clarity and consistency * Rename modular tree classes for consistency and clarity; update references in related files * Update GraphBuilder docstring for clarity on pipeline rendering and tag aggregation * Align review wording: drop "membership", clarify docstrings Follow-up review comments on PR #2726. - _ModularPipelineIndex docstring said it resolved tasks and datasets, but the task lookup was removed when task namespaces moved inline. It is dataset-only. - Rewrite the module docstring as two sentences instead of chained "and" lists, keeping the node-ID and catalog-type notes. - Drop "membership" throughout in favour of the API field name, modular_pipelines: build() and test docstrings, four test names, the _membership test helper, and local variables. - Rename selected/selected_pipeline to selected_pipeline_id consistently, so build() and both modular-pipeline helpers agree. Wording and naming only. The modular_pipelines API field is unchanged. * Refactor modular pipeline handling: rename methods for clarity, enhance docstrings, and improve boundary calculations * Change 1: Implement modular pipeline set algebra: add new module and tests for namespace boundary calculations and dataset ownership * Change 2: Refactor modular pipeline classes: rename and update methods for clarity; enhance documentation and improve graph handling * Rename modular pipeline dataset lookup * Split modular pipeline code into a package * Rename compute_namespace_boundaries to _compute_namespace_boundaries for consistency and clarity * Add modular pipeline tests for boundaries, index, tree, and view rendering * Reword test docstrings to drop 'hermetic' Review nit on PR #2726: 'hermetic' is not used anywhere else in the test suite. The five module docstrings now say plainly what the file covers, and the two prose mentions say 'no Kedro project is loaded' instead.
* Modular pipelines from the inspection snapshot Derive modular pipelines from NodeSnapshot.namespace, without live Pipeline objects, and fill the placeholders the graph builder left behind. - modular_pipelines.py: ModularMembership (which modular pipelines each node belongs to), ModularTreeBuilder (the expand/collapse tree with per-pipeline boundary inputs and outputs), and the modular edge helpers including cycle removal. - graph_builder.py: emit modularPipeline nodes, modular edges and the tree response, and set modular_pipelines on task and dataset nodes. - Baseline parity now covers modular pipelines: node sets, every edge compared by raw ID, per-node membership, modular node tags, and the tree's inputs, outputs and children. - Add hermetic tests for membership, the tree and the edge helpers. The tree's __root__ children are compared by ID rather than by (ID, type): the legacy backend lists one parameter there twice, as both parameters and data, which is not reproduced here. * Enhance graph builder and modular pipelines to support modular membership and improve dataset handling; add tests for modular pipeline behavior and edge cases. * Fix modular-pipeline correctness gaps and align naming with the adapter Correctness: - Dataset owners and the tree now share one free-input/free-output calculation, so a dataset on an ancestor's boundary is no longer reported as belonging only to the inner pipeline. - The boundary calculation mirrors Kedro's Pipeline set algebra: transcoding is stripped only to decide what is intermediate, and names are compared in their original form. A transcoded dataset whose outside reader uses a different suffix is no longer treated as a boundary output, matching the legacy backend. - Deduplicate the global node set by task ID rather than name, so two pipelines registering same-named tasks with different I/O both keep their datasets. - A namespace literally called __root__ no longer collides with the synthetic root entry. - Modular edges are emitted in sorted order so responses are stable. Naming and docs, following the conventions used elsewhere in the adapter: - Drop the "membership" wording; ModularMembership becomes _ModularPipelineIndex with get_modular_pipelines_for_task/_for_dataset, mirroring _SnapshotGraphIndex. - Make the module's surface private, since nothing outside the package uses it. - Share one _create_task_node_id_from_snapshot helper instead of repeating the five-argument call, and trim the module docstring to what the file does. - get_modular_pipelines_for_dataset strips transcoding itself rather than relying on callers. Tests: regressions for each correctness fix, plus stronger parity checks that key nodes by type and ID and compare root children by ID and type after normalising the one known legacy duplicate. * Refactor graph builder and modular pipelines for improved modular membership handling; add tests for edge cases and reserved namespace validation. * Update error message for reserved namespace conflict in modular pipelines * Add docstrings to modular tree builder methods for clarity on functionality * Refactor modular pipeline data handling and improve index construction in tests * Refactor modular pipeline functions and update task node ID creation for improved clarity and consistency * Rename modular tree classes for consistency and clarity; update references in related files * Update GraphBuilder docstring for clarity on pipeline rendering and tag aggregation * Align review wording: drop "membership", clarify docstrings Follow-up review comments on PR #2726. - _ModularPipelineIndex docstring said it resolved tasks and datasets, but the task lookup was removed when task namespaces moved inline. It is dataset-only. - Rewrite the module docstring as two sentences instead of chained "and" lists, keeping the node-ID and catalog-type notes. - Drop "membership" throughout in favour of the API field name, modular_pipelines: build() and test docstrings, four test names, the _membership test helper, and local variables. - Rename selected/selected_pipeline to selected_pipeline_id consistently, so build() and both modular-pipeline helpers agree. Wording and naming only. The modular_pipelines API field is unchanged. * Refactor modular pipeline handling: rename methods for clarity, enhance docstrings, and improve boundary calculations * Change 1: Implement modular pipeline set algebra: add new module and tests for namespace boundary calculations and dataset ownership * Change 2: Refactor modular pipeline classes: rename and update methods for clarity; enhance documentation and improve graph handling * Rename modular pipeline dataset lookup * Split modular pipeline code into a package * Rename compute_namespace_boundaries to _compute_namespace_boundaries for consistency and clarity * Add modular pipeline tests for boundaries, index, tree, and view rendering * add draft param implementation Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * adjust file permissions Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update trufflehog Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update parameters resolution to include dotted params Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update fixes for lint Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update TODO comment Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * move constants to top of the file Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> --------- Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> Co-authored-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
…hot (#2750) * Support populated catalog layers in GraphBuilder Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Add explicit graph enrichment and Pydantic value models Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Add project-scoped inspection graph services Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Serve graph endpoints from the project context Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Verify inspection graph parity with legacy responses Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Merge load_and_populate_data and _load_and_populate_project_data --------- Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Keep VizProjectContext.from_project as a thin composition root: load once, optionally filter, then pass InspectionInputs to the graph service. Move the existing load and filter orchestration into module-level helpers. Store only snapshot, catalog_config and resolved parameters. Preserve GraphBuilder(parameters=...) and the existing parameter reads unchanged; leave validation and feed expansion for a separate parameter PR. Keep the prebuilt snapshot opaque at runtime so Kedro imports stay lazy. Cover shared-input reuse, early pipeline rejection, unvalidated parameter values and lazy imports. Keep graph baselines and the dependency pin unchanged. Later metadata, enrichment and HTTP layers remain separate. Verified: 695 backend tests pass with 100% statement coverage on both the existing pinned Kedro and released Kedro 1.6.0 in an isolated overlay. Ruff, formatting, both MyPy targets and targeted Bandit checks pass. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Return EnrichmentSources from one preparation function for file-backed stats and styles, copied live graph overlays, and supplied layer overrides. Reuse already-loaded file extras and preserve name-keyed metadata separately from canonical-ID live values. Keep the legacy data-loader wrapper delegating to the same preparation path. Make the context consume one prepared enrichment object and remove the separate live-node factory. Require kedro>=1.6.0 from PyPI; CI uses the project requirement without an additional main-branch install. Verify file-only loading, no rereads for supplied mappings, copying, and unchanged live precedence. All 699 backend tests pass with 100% statement coverage on Kedro 1.6.0. The separate inherited lite-mode import-cache failure remains outside this change. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Keep response construction in NodeMetadataBuilder behind context.node_metadata. Share dataset indexing and existing parameter preparation in snapshot_source, preserving per-pipeline graph scope, snapshot-wide metadata order, and canonical IDs. Return dataset responses to the owning index instead of mutating it from a helper. Pass only GraphExtras to the renamed GraphService and name-keyed enrichment to NodeMetadataService. Keep loading at the context boundary, preserve existing parameter semantics, and leave live enrichment and HTTP routing to subsequent layers. Rename the context service argument and attribute to node_metadata following review, with matching context tests. Preserve response behavior and baseline expectations. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
* Remove unused inspection node metadata preparation Keep V1 focused on inspection graph responses while retaining legacy node details. Remove the unused static metadata service, eager context wiring and metadata-only dataset bookkeeping without reverting shared graph preparation. Replace static-service tests with full/lite HTTP coverage linking all supported demo graph IDs to legacy metadata. Keep graph baselines, live metadata behavior and the existing PR stack unchanged. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Remove upcoming release notes for unused inspection node metadata preparation --------- Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
* Implement run status service and update API routes for project-specific run status handling * Refactor run status handling in Kedro Viz
* live load only for metadata Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix lint Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix unit tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix unit tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * address metadata concurrent issue Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix lint Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update file docstring Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> --------- Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
* Forward --params runtime overrides to the inspection snapshot
The snapshot was built without runtime_params while the separate config
loader received them, so catalog values using ${runtime_params:...} either
failed to resolve at startup or silently used a different value.
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
* Fix duplicate definition of _RUNTIME_DATASET in test_snapshot_source.py
---------
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
* fix lite mode implementation Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix lint Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * add coverage Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix e2e tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * address PR comments Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix lite mode issue Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * address review comments Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> --------- Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
* restructured inspection hierarchy Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update comments Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update parsing spinner text Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> --------- Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
* restructured inspection hierarchy Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update comments Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * update parsing spinner text Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * restructure integration and remove legacy mentions Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> * fix tests Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com> --------- Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
* Remove parity baseline tests before merging to main The recorded baseline of the old live backend and the parity tests built on it were temporary scaffolding to prove the inspection adapter matched the live backend (see the TODO(#2265) in capture_baseline.py). Remove them now that V1 is close to merging. - Remove the recorded baseline JSON, capture_baseline.py and the parity test - Drop the baseline comparisons from test_graph_builder.py and test_ids.py, keeping the behaviour tests - Remove .gitattributes, which only marked the baseline JSON as generated - Check that the run-status hook ID matches the graph ID in the graph and node-metadata compatibility test, which the removed node ID report covered - Make that test importable on its own instead of relying on earlier tests Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> * Point export TODOs at #2776 #2660 was closed with reduced scope and moved context-backed export and deployment to #2776. Update the server TODO to match, and add the ticket to the run-status note that waits on the same work. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com> --------- Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: Ravi Kumar <ravi_kumar_pilla@mckinsey.com>
Making the /nodes route a plain `def` moved every metadata request into FastAPI's threadpool, so task and dataset previews ran off the main thread. A `preview_fn` that draws with pyplot then aborts the whole server on macOS, which `except Exception` cannot catch. Keep the route async and run only the one-off deferred live load in the threadpool, so it still doesn't block other requests. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
`kedro viz run` receives KEDRO_ENV through the Click option, but `%run_viz` passes no env and `kedro jupyter --env` only sets KEDRO_ENV. The snapshot then read the default environment while the deferred `KedroSession.create` honoured KEDRO_ENV, so the graph and the details panel came from different configs. Resolve the env the way `KedroSession.create` does: an explicit env wins, otherwise fall back to KEDRO_ENV. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
On main a broken project, such as a missing credentials key, stopped `kedro viz run` at startup. With the deferred live load the failure happens on the first node click, the frontend turns the 503 into an empty panel, and the only trace is a traceback in the logs. Print one red CLI line on the first failure, and drop "temporarily" from the 503 message since the load is never retried. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
List the Kedro floor with the major changes, name the moved modules and the new create_api_app_from_project argument under breaking changes, and describe the run-status change accurately: events are now read from the project root, not from the Inspection API. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
The server now builds its inspection context separately and the deferred load discards the return value, so no caller uses the returned repositories. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
_wait_for_main_response returned {} on timeout, so the None check in check_kedroviz_up never fired and a hang surfaced as KeyError: 'nodes'. Return None, check it in both callers, and fix the comment that said 30 seconds for a 45-second wait.
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
node_ids.py documents that an explicit name shaped like a generated one cannot be reconstructed from the snapshot; say so where the overview claims IDs match across both paths. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
The live helper normalised the whole node string, so an input or output dataset named like an object repr, such as "<Raw object at 0x123>", was rewritten on the live side only. The snapshot and legacy IDs kept the name verbatim, so the node's details panel returned 404 even for an ordinary function. Replace only the function-name segment, which is what the snapshot side normalises. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
The snapshot graph read parameter values straight from config, so a field that a node annotates as a pydantic SecretStr showed in plain text. The node details and 12.5.0 mask it, because KedroContext.params builds the annotated model before Viz encodes it. Type the parameters with Kedro's ParameterValidator over the registered pipelines, as KedroContext.params does, and let nested params: lookups step into model fields, as Kedro does when it registers them. A value that does not fit its type now fails the graph build, as kedro run and 12.5.0 do, rather than falling back to raw values that show the secret. Reported in #2761. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
The callable-object task ID change rewrote this file with LF endings, so the PR showed every line as changed. Restore the CRLF endings it has on main, leaving only the import and the two hashing calls in the diff. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Kedro resets its pipeline registry on every bootstrap_project call. The snapshot API and the config loader each bootstrapped the project, so typing the parameters registered the pipelines a second time before the graph could be served, repeating any project side effects. Bootstrap once per session and pass that bootstrap to the snapshot API through its metadata argument. Loading the inputs now registers the pipelines once again, and the server is back to one registration before the graph response and two after the first node details request. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com>
SajidAlamQB
approved these changes
Oct 30, 2026
SajidAlamQB
left a comment
Contributor
There was a problem hiding this comment.
Thanks @jitu5 for addressing all my comments I went through the fixes and all looks good 🚀
jitu5
approved these changes
Nov 2, 2026
Signed-off-by: Jitendra Gundaniya <38945204+jitu5@users.noreply.github.com>
The merge from main on 11 Nov left the top heading as "# # Release 13.0.0". Main uses "# Upcoming Release" until the release PR renames it, and tools/github_actions/extract_release_notes.py cannot match the doubled "#". Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
A parameters.yml key that contains a dot, such as `ns2.opts: {lr: 0.1}`,
showed as null in the graph's task parameters. The snapshot lookup always
split the name on dots, while KedroContext registers a `params:` dataset for
every key path joined with ".", so the live node details had the value.
Look parameters up the same way Kedro registers them: flat and nested keys,
typed-parameter fields, and the later registration winning when two paths
give the same name. A new test checks every name Kedro registers.
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Moving `integrations/kedro/hooks.py` into the `hooks` package left the package's `__init__.py` empty, so a project `settings.py` that registers the hook with `from kedro_viz.integrations.kedro.hooks import DatasetStatsHook` failed on import, which stops `kedro run` itself, not just Kedro-Viz. Re-export `DatasetStatsHook` and `dataset_stats_hook`, the two public names of the old module, and note it with the breaking change in RELEASE.md. Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Kedro-Viz used to build its graph by loading the user's Kedro project and reading the live pipeline and catalog objects. This PR is V1 of the Kedro-Viz modularity work (#2265): the graph now comes from Kedro's Inspection API, a read-only snapshot of the project, and the live project is only loaded when something still needs it.
It combines the PRs merged into
feat/backend_v2(#2689, #2697, #2700, #2716, #2726, #2736, #2750, #2763, #2764, #2765, #2772, #2773, #2774, #2777, #2778, #2780, #2781, #2785, #2788) and requireskedro>=1.6.0, the first release with the snapshot API.Development notes
Served from the inspection snapshot
/api/mainand/api/pipelines/{id}: nodes, edges, tags, pipelines, layers, modular pipelines and task parameters, built byGraphBuilderfrom the snapshot plus the raw catalog and parameter config.KedroContext.paramstypes them, so typed secrets (SecretStr) stay masked. Values JSON can't represent fall back to their string form.--params,--envandKEDRO_ENVare forwarded to the snapshot, so the graph and the node details read the same config.Still served from the live project
/api/nodes/{id}(code, file paths, previews and statistics). The live load now runs once, on the first node click, instead of at startup (DeferredDataLoader).--include-hooks, the live catalog still loads at startup, so layers changed by a hook appear in the graph.kedro viz build,kedro viz deploy,--save-file,NotebookVisualizerand the VS Code extension still build their output from the live project. Moving them to the snapshot is Route static export and deployment throughVizProjectContext#2776.Run status is served from a project-scoped
RunStatusServiceand reads.viz/kedro_pipeline_events.jsonfrom the project root.Node IDs keep the existing scheme: the snapshot side rebuilds the same ID the live side and the run-status hook compute, so bookmarked links and run status keep working. Two exceptions:
<function>__<8 hex characters>) can't be told apart from a generated one.node(MyClass(), ...)) now gets an ID based on the class name. Before, its ID changed on every restart.Package layout:
integrations/kedrois split intohooks,lite,liveandinspectionsubpackages, and the tests mirror it.ARCHITECTURE.mddescribes the two paths.Tests: the parity and baseline tests used during development were removed in #2785.
test_graph_metadata_compatibility.pystays: it checks that every graph node ID resolves through/api/nodes/{id}and matches the run-status hook's ID.Behaviour changes
/api/nodes/{id}returns 503. Before,kedro viz runfailed at startup.--envnames may only contain letters, digits,-and_, because Kedro's snapshot API rejects anything else.MemoryDataset./api/nodes/<modular pipeline id>returns 404 instead of{}. The UI never requests it.Breaking changes to the API
kedro>=1.6.0(waskedro>=1.0.0).create_api_app_from_projecttakes a requiredcontextargument.kedro_viz.integrations.kedrointo the new subpackages.DatasetStatsHookcan still be imported fromkedro_viz.integrations.kedro.hooks. The other modules have no compatibility imports.QA notes
Testing plan and sign-off: #2761 (closed).
v1-compat,v1-lite-casesandv1-largetest projects and testers' own projects.KEDRO_ENVmismatch in%run_viz, typed secrets, callable-object node IDs, and previews running off the main thread.main, so this PR wasn't tested on Windows in CI. Check the nightly Windows run after merging, before releasing.Changes since approval:
# Upcoming Releaseheading inRELEASE.md.ns.opts: {...}) in the graph the way Kedro registers them. They showed asnull.DatasetStatsHookimportable from its old path, so a project'ssettings.pythat imports it still works.Follow-ups
VizProjectContext#2776: route static export and deployment throughVizProjectContext.--include-hookswith an unknown--pipelineraises a rawKeyError. This also happens on 12.5.0.Checklist
RELEASE.mdfile