-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
- Loading branch information
1 parent
29b3b3a
commit 1d87c53
Showing
20 changed files
with
633 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class GraphEdge(BaseModel, frozen=True): | ||
"""Represent an edge in the graph | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from pydantic import BaseModel, Field, ValidationInfo, field_validator | ||
from typing import Optional | ||
|
||
|
||
class NamedEntity(BaseModel): | ||
"""Represent a named entity (Tag/Registered Pipeline) in a Kedro project.""" | ||
|
||
id: str | ||
name: Optional[str] = Field( | ||
default=None, | ||
validate_default=True, | ||
description="The name of the entity", | ||
) | ||
|
||
@field_validator("name") | ||
@classmethod | ||
def set_name(cls, _, info: ValidationInfo): | ||
assert "id" in info.data | ||
return info.data["id"] | ||
|
||
|
||
class RegisteredPipeline(NamedEntity): | ||
"""Represent a registered pipeline in a Kedro project.""" | ||
|
||
|
||
class Tag(NamedEntity): | ||
"""Represent a tag in a Kedro project.""" | ||
|
||
def __hash__(self) -> int: | ||
return hash(self.id) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from enum import Enum | ||
|
||
|
||
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 |
Oops, something went wrong.