Skip to content

Commit 033ca6c

Browse files
authored
fix(vdp): allow empty input for recipe parameter (#229)
Because - some users might start to use new raw recipe parameter This commit - make new and old recipe parameters both work
1 parent 2220438 commit 033ca6c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

instill/clients/pipeline.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pylint: disable=no-member,wrong-import-position,too-many-lines,no-name-in-module
2-
from typing import Callable, List
2+
from typing import Callable, List, Optional
33

44
from google.protobuf import field_mask_pb2
55
from google.protobuf.struct_pb2 import Struct
@@ -237,7 +237,7 @@ def create_pipeline(
237237
namespace_id: str,
238238
pipeline_id: str,
239239
description: str,
240-
recipe: dict,
240+
recipe: Optional[dict] = None,
241241
raw_recipe: str = "",
242242
async_enabled: bool = False,
243243
) -> pipeline_interface.CreateNamespacePipelineResponse:
@@ -246,6 +246,8 @@ def create_pipeline(
246246
description=description,
247247
raw_recipe=raw_recipe,
248248
)
249+
if recipe is None:
250+
recipe = {}
249251
pipeline.recipe.update(recipe)
250252

251253
if async_enabled:

0 commit comments

Comments
 (0)