Skip to content

Commit

Permalink
move GraphNodeType to nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
  • Loading branch information
SajidAlamQB committed Oct 18, 2024
1 parent c8cf56a commit 7152c69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
10 changes: 0 additions & 10 deletions package/kedro_viz/models/flowchart/enums.py

This file was deleted.

2 changes: 1 addition & 1 deletion package/kedro_viz/models/flowchart/modular_pipelines.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import BaseModel, Field
from typing import Set, Optional
from .enums import GraphNodeType
from .nodes import GraphNodeType


class ModularPipelineChild(BaseModel):
Expand Down
11 changes: 10 additions & 1 deletion package/kedro_viz/models/flowchart/nodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from abc import ABC
from enum import Enum
from pydantic import (
BaseModel,
Field,
Expand Down Expand Up @@ -26,14 +27,22 @@
from kedro.io.core import AbstractDataSet as AbstractDataset # type: ignore

from .entities import NamedEntity
from .enums import GraphNodeType
from .utils import _parse_filepath, _extract_wrapped_func, get_dataset_type
from kedro_viz.utils import TRANSCODING_SEPARATOR, _strip_transcoding
from .modular_pipelines import ModularPipelineChild

logger = logging.getLogger(__name__)


class GraphNodeType(str, Enum):
"""Represent all possible node types in the graph representation of a Kedro pipeline."""

TASK = "task"
DATA = "data"
PARAMETERS = "parameters"
MODULAR_PIPELINE = "modularPipeline" # CamelCase for frontend compatibility


class GraphNode(BaseModel, ABC):
"""Abstract base class representing a node in the graph."""

Expand Down

0 comments on commit 7152c69

Please sign in to comment.