Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Flowchart models from dataclass to pydantic base models #1565

Merged
merged 41 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a2636f3
create pydantic flowchart classes
ravi-kumar-pilla Oct 2, 2023
240a383
fixing pydantic class conversions
ravi-kumar-pilla Oct 5, 2023
772ed02
minor modifications and code comments
ravi-kumar-pilla Oct 7, 2023
900fb70
fix pytests for flowchart and managers
ravi-kumar-pilla Oct 10, 2023
57811a7
fix pytests
ravi-kumar-pilla Oct 10, 2023
182be16
fix lint errors and pytests
ravi-kumar-pilla Oct 11, 2023
62efd72
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into ch…
ravi-kumar-pilla Oct 11, 2023
47cc4d7
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into ch…
ravi-kumar-pilla Oct 11, 2023
d82f71d
fix lint issues and merge main
ravi-kumar-pilla Oct 11, 2023
fe67d26
fix initialization issues and lint issues
ravi-kumar-pilla Oct 11, 2023
47d3211
fix push issue
ravi-kumar-pilla Oct 11, 2023
1696c81
Merge branch 'main' into chore/refactor-data-classes
ravi-kumar-pilla Oct 12, 2023
c30e102
revert class method to static method
ravi-kumar-pilla Oct 16, 2023
2406458
merge main
ravi-kumar-pilla Oct 16, 2023
e620bcb
Merge branch 'chore/refactor-data-classes' of https://github.com/kedr…
ravi-kumar-pilla Oct 16, 2023
5ec1451
update method comments
ravi-kumar-pilla Oct 16, 2023
15855e2
Merge branch 'main' of https://github.com/kedro-org/kedro-viz into ch…
ravi-kumar-pilla Oct 16, 2023
5c97bbf
Merge branch 'main' into chore/refactor-data-classes
ravi-kumar-pilla Oct 16, 2023
198e946
Merge branch 'chore/refactor-data-classes' of https://github.com/kedr…
ravi-kumar-pilla Oct 17, 2023
3175df5
revert back method shuffles for better PR reviews
ravi-kumar-pilla Oct 17, 2023
38d0029
addressing PR comments
ravi-kumar-pilla Oct 17, 2023
c82e04c
merge main
ravi-kumar-pilla Oct 26, 2023
b106ad8
not-working version of pydantic shift
ravi-kumar-pilla Oct 26, 2023
1a95fd3
non-working p2
ravi-kumar-pilla Oct 31, 2023
844531d
not-working v3
ravi-kumar-pilla Nov 1, 2023
20bf139
modify metadata classes and update pytests
ravi-kumar-pilla Nov 3, 2023
a7564bd
merge main
ravi-kumar-pilla Nov 6, 2023
c526956
fix all pytests
ravi-kumar-pilla Nov 7, 2023
f61deb9
fix pytest for coverage
ravi-kumar-pilla Nov 7, 2023
ff39824
Merge branch 'main' into chore/refactor-data-classes
ravi-kumar-pilla Nov 7, 2023
d7e2653
Merge branch 'main' into chore/refactor-data-classes
ravi-kumar-pilla Nov 7, 2023
74b2930
address PR comments1
ravi-kumar-pilla Nov 7, 2023
b0e34ef
Merge branch 'chore/refactor-data-classes' of https://github.com/kedr…
ravi-kumar-pilla Nov 7, 2023
ca6b16f
fix lint issues
ravi-kumar-pilla Nov 7, 2023
2970e9e
add hash for pylint
ravi-kumar-pilla Nov 7, 2023
50c9d08
merge main
ravi-kumar-pilla Nov 7, 2023
80848d5
fix lint errors
ravi-kumar-pilla Nov 7, 2023
5cc645a
fix lint errors
ravi-kumar-pilla Nov 7, 2023
8e53a76
Merge branch 'main' into chore/refactor-data-classes
tynandebold Nov 13, 2023
6ce4e37
create base class for tag and registered pipeline
ravi-kumar-pilla Nov 14, 2023
bb51814
add release note
ravi-kumar-pilla Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions package/kedro_viz/data_access/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def add_pipeline(self, registered_pipeline_id: str, pipeline: KedroPipeline):
task_node = self.add_node(registered_pipeline_id, node)
self.registered_pipelines.add_node(registered_pipeline_id, task_node.id)

current_modular_pipeline = modular_pipelines.extract_from_node(task_node)
current_modular_pipeline_id = modular_pipelines.extract_from_node(task_node)

# Add node's inputs as DataNode to the graph
for input_ in node.inputs:
Expand All @@ -154,8 +154,8 @@ def add_pipeline(self, registered_pipeline_id: str, pipeline: KedroPipeline):
# The method `add_input` will take care of figuring out whether
# it is an internal or external input of the modular pipeline.
modular_pipelines.extract_from_node(input_node)
if current_modular_pipeline is not None:
modular_pipelines.add_input(current_modular_pipeline, input_node)
if current_modular_pipeline_id is not None:
modular_pipelines.add_input(current_modular_pipeline_id, input_node)

# Add node outputs as DataNode to the graph.
# It follows similar logic to adding inputs.
Expand All @@ -171,8 +171,10 @@ def add_pipeline(self, registered_pipeline_id: str, pipeline: KedroPipeline):
output_node.original_version = self.catalog.get_dataset(output)

modular_pipelines.extract_from_node(output_node)
if current_modular_pipeline is not None:
modular_pipelines.add_output(current_modular_pipeline, output_node)
if current_modular_pipeline_id is not None:
modular_pipelines.add_output(
current_modular_pipeline_id, output_node
)

def add_node(self, registered_pipeline_id: str, node: KedroNode) -> TaskNode:
"""Add a Kedro node as a TaskNode to the NodesRepository
Expand Down Expand Up @@ -461,7 +463,9 @@ def create_modular_pipelines_tree_for_registered_pipeline(
bad_inputs = modular_pipeline.inputs.intersection(descendants)
for bad_input in bad_inputs:
digraph.remove_edge(bad_input, modular_pipeline_id)
edges.remove_edge(GraphEdge(bad_input, modular_pipeline_id))
edges.remove_edge(
GraphEdge(source=bad_input, target=modular_pipeline_id)
)
node_dependencies[bad_input].remove(modular_pipeline_id)

for node_id, node in self.nodes.as_dict().items():
Expand All @@ -473,7 +477,7 @@ def create_modular_pipelines_tree_for_registered_pipeline(
if not node.modular_pipelines or node_id in root_parameters:
modular_pipelines_tree[ROOT_MODULAR_PIPELINE_ID].children.add(
ModularPipelineChild(
node_id, self.nodes.get_node_by_id(node_id).type
id=node_id, type=self.nodes.get_node_by_id(node_id).type
)
)

Expand Down
Loading