Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions instill/clients/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Callable, List, Optional

from google.protobuf import field_mask_pb2, timestamp_pb2
from google.protobuf.json_format import MessageToDict
from google.protobuf.struct_pb2 import Struct

import instill.protogen.common.healthcheck.v1beta.healthcheck_pb2 as healthcheck
Expand Down Expand Up @@ -571,7 +572,7 @@ def trigger(
pipeline_id: str,
data: List[dict],
async_enabled: bool = False,
) -> pipeline_interface.TriggerNamespacePipelineResponse:
) -> dict:
request = pipeline_interface.TriggerNamespacePipelineRequest(
namespace_id=namespace_id,
pipeline_id=pipeline_id,
Expand All @@ -582,17 +583,19 @@ def trigger(
request.data.append(trigger_data)

if async_enabled:
return RequestFactory(
resp = RequestFactory(
method=self.host.async_client.TriggerNamespacePipeline,
request=request,
metadata=self.host.metadata + self.metadata,
).send_async()
return MessageToDict(resp)

return RequestFactory(
resp = RequestFactory(
method=self.host.client.TriggerNamespacePipeline,
request=request,
metadata=self.host.metadata + self.metadata,
).send_sync()
return MessageToDict(resp)

@grpc_handler
def trigger_with_stream(
Expand Down
Loading