Skip to content

Commit

Permalink
fix: Incorrect typing in samples/cores/loop_parallism and fixing loop…
Browse files Browse the repository at this point in the history
…_parameter examples (#11062)

* Fixing incorrect typing in loop_parallism example

Signed-off-by: Oswaldo Gomez <oswaldo.gomez@roche.com>

* Fixing samples/core/loop_parameter example

Signed-off-by: Oswaldo Gomez <oswaldo.gomez@roche.com>

---------

Signed-off-by: Oswaldo Gomez <oswaldo.gomez@roche.com>
Co-authored-by: Oswaldo Gomez <oswaldo.gomez@roche.com>
  • Loading branch information
papagala and Oswaldo Gomez authored Aug 2, 2024
1 parent ff4e918 commit 1612dac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion samples/core/loop_parallelism/loop_parallelism.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from kfp import compiler, dsl

@dsl.component()
def print_op(s: str):
def print_op(s: int):
print(s)

@dsl.pipeline(name='my-pipeline')
Expand Down
6 changes: 2 additions & 4 deletions samples/core/loop_parameter/loop_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ def concat_op(a: str, b: str) -> str:


@dsl.component
def generate_op() -> str:
import json
return json.dumps([{'a': i, 'b': i * 10} for i in range(1, 5)])

def generate_op() -> list:
return [{'a': i, 'b': i * 10} for i in range(1, 5)]

@dsl.pipeline(name='pipeline-with-loop-parameter')
def my_pipeline(
Expand Down

0 comments on commit 1612dac

Please sign in to comment.