Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh committed Jul 18, 2024
1 parent 52570a4 commit 4631679
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pydantic-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run tests
shell: bash -el {0}
run: |
cd tests/pydantic-2 && poetry run pytest -Werror
cd tests/pydantic-2 && poetry run pytest
2 changes: 1 addition & 1 deletion .github/workflows/python-3-9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run tests
shell: bash -el {0}
run: |
cd tests/python-3-9 && poetry run pytest -Werror
cd tests/python-3-9 && poetry run pytest
4 changes: 4 additions & 0 deletions substrate/core/coregraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def __init__(self, id=None, initial_args=None):
def futures(self) -> List[BaseFuture]:
raise NotImplementedError

def add_edge(self, u_node: CoreNode, v_node: CoreNode, **kwargs) -> "CoreGraph":
self.DAG.add_edge(u_node, v_node, **kwargs)
return self

def add_node(self, node: CoreNode) -> "CoreGraph":
if self.DAG.has_node(node):
raise ValueError(f"Node with id {node.id} already exists")
Expand Down
3 changes: 2 additions & 1 deletion substrate/substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def collect_nodes(node):

graph = Graph()
for node in all_nodes:
graph.add_node(node)
if not graph.DAG.has_node(node):
graph.add_node(node)
for depend_node in node._depends:
graph.add_edge(depend_node, node)
graph_serialized = graph.to_dict()
Expand Down

0 comments on commit 4631679

Please sign in to comment.