Skip to content

Commit f8e3f4b

Browse files
committed
Rename to match component name + ruff
1 parent e4b9bc0 commit f8e3f4b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/customize/build_graph/pipeline/pipeline_with_component_notifications.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@
1717
logger.setLevel(logging.INFO)
1818

1919

20-
class BatchComponentResult(DataModel):
20+
class MultiplyComponentResult(DataModel):
2121
result: list[int]
2222

2323

2424
class MultiplicationComponent(Component):
2525
def __init__(self, f: int) -> None:
2626
self.f = f
2727

28-
async def run(self, numbers: list[int]) -> BatchComponentResult:
29-
return BatchComponentResult(result=[])
28+
async def run(self, numbers: list[int]) -> MultiplyComponentResult:
29+
return MultiplyComponentResult(result=[])
3030

3131
async def multiply_number(
32-
self, context_: RunContext, number: int,
32+
self,
33+
context_: RunContext,
34+
number: int,
3335
) -> int:
3436
await context_.notify(
3537
message=f"Processing number {number}",
@@ -42,7 +44,7 @@ async def run_with_context(
4244
context_: RunContext,
4345
numbers: list[int],
4446
**kwargs: Any,
45-
) -> BatchComponentResult:
47+
) -> MultiplyComponentResult:
4648
result = await asyncio.gather(
4749
*[
4850
self.multiply_number(
@@ -52,7 +54,7 @@ async def run_with_context(
5254
for number in numbers
5355
]
5456
)
55-
return BatchComponentResult(result=result)
57+
return MultiplyComponentResult(result=result)
5658

5759

5860
async def event_handler(event: Event) -> None:

0 commit comments

Comments
 (0)