Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed May 20, 2023
1 parent a44193f commit fad7075
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/flytekit-papermill/tests/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ def _get_nb_path(name: str, suffix: str = "", abs: bool = True, ext: str = ".ipy
outputs=kwtypes(square=float),
)

nb_sub_task = NotebookTask(
name="test",
notebook_path=_get_nb_path(nb_name, abs=False),
inputs=kwtypes(a=float),
outputs=kwtypes(square=float),
output_notebooks=False,
)


def test_notebook_task_simple():
serialization_settings = flytekit.configuration.SerializationSettings(
Expand Down Expand Up @@ -176,16 +184,8 @@ def create_sd() -> StructuredDataset:


def test_map_over_notebook_task():
nb_task = NotebookTask(
name="test",
notebook_path=_get_nb_path(nb_name, abs=False),
inputs=kwtypes(a=float),
outputs=kwtypes(square=float),
output_notebooks=False,
)

@workflow
def wf(a: float) -> typing.List[float]:
return map_task(nb_task)(a=[a, a, a])
return map_task(nb_sub_task)(a=[a, a])

assert wf(a=3.14) == [9.8596, 9.8596, 9.8596]
assert wf(a=3.14) == [9.8596, 9.8596]

0 comments on commit fad7075

Please sign in to comment.