Skip to content

Commit 4de8e17

Browse files
committed
[py] Change Pipeline.input_json to return completion token.
We used to drop the token returned by push_to_pipeline on the floor. Instead, we now return it to the user so they can wait for the token asynchronously. Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
1 parent 259083b commit 4de8e17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/feldera/pipeline.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def input_json(
167167
update_format: str = "raw",
168168
force: bool = False,
169169
wait: bool = True,
170-
):
170+
) -> str:
171171
"""
172172
Push this JSON data to the specified table of the pipeline.
173173
@@ -182,6 +182,8 @@ def input_json(
182182
:param force: `True` to push data even if the pipeline is paused. `False` by default.
183183
:param wait: If True, blocks until this input has been processed by the pipeline
184184
185+
:returns: The completion token to this input.
186+
185187
:raises ValueError: If the update format is invalid.
186188
:raises FelderaAPIError: If the pipeline is not in a valid state to push data.
187189
:raises RuntimeError: If the pipeline is paused and `force` is not set to `True`.
@@ -195,7 +197,7 @@ def input_json(
195197
raise ValueError("update_format must be one of raw or insert_delete")
196198

197199
array = True if isinstance(data, list) else False
198-
self.client.push_to_pipeline(
200+
return self.client.push_to_pipeline(
199201
self.name,
200202
table_name,
201203
"json",

0 commit comments

Comments
 (0)