Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: 1597463007 <[email protected]>
  • Loading branch information
1597463007 committed Oct 4, 2024
1 parent cc45815 commit 77eb680
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pargraph/graph/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def wrapper(*args, **kwargs) -> Union[Graph, GraphContext, Tuple[GraphContext, .
default_value = bound_args.signature.parameters[name].default
if default_value is inspect.Parameter.empty:
continue

const_id = f"_{uuid.uuid4().hex}"
sub_graph.consts[ConstKey(key=const_id)] = Const.from_value(default_value)
sub_graph.inputs[InputKey(key=name)] = ConstKey(key=const_id)
Expand Down Expand Up @@ -283,7 +283,7 @@ def wrapper(*args, **kwargs) -> Union[Graph, GraphContext, Tuple[GraphContext, .
const_id = f"_{uuid.uuid4().hex}"
graph_result.consts[ConstKey(key=const_id)] = Const.from_value(default_value)
graph_result.inputs[InputKey(key=name)] = ConstKey(key=const_id)

return graph_result

# Inject function call node into graph
Expand Down
2 changes: 1 addition & 1 deletion tests/test_graph_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_graph_default_argument(self):
@graph
def sample_graph(x: int, y: int = 1) -> int:
return x + y

self.assertEqual(self.engine.get(*sample_graph.to_graph().to_dask(x=2, y=3))[0], sample_graph(x=2, y=3))

def test_graph_default_argument_missing(self):
Expand Down

0 comments on commit 77eb680

Please sign in to comment.