Skip to content

Commit 8f94eb0

Browse files
Rwm 90 (#81)
* fix json output handler * bump version
1 parent 217644b commit 8f94eb0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

workflow/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version_info__ = (0, 0, 46)
15+
__version_info__ = (0, 0, 47)
1616
__version__ = ".".join(map(str, __version_info__))

workflow/rai.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,15 @@ def output = json_string[...]
318318
"""
319319
if not rsp.results:
320320
return {}
321-
pa_table = rsp.results[0]['table']
322-
data = pa_table.to_pydict()
323-
return json.loads(data["v1"][0])
321+
output_result = {}
322+
for result in rsp.results:
323+
if result['relationId'] == "/:output/String":
324+
pa_table = result['table']
325+
output_result = pa_table.to_pydict()
326+
break
327+
if not output_result:
328+
return {}
329+
return json.loads(output_result["v1"][0])
324330

325331

326332
def _parse_string(rsp: api.TransactionAsyncResponse) -> str:

0 commit comments

Comments
 (0)