Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei1949 committed Jun 3, 2024
1 parent 3099f0a commit 4dc785b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,7 @@ public Result<String> updateProcedure(

private byte[] encodeString(String jsonStr, int lastByte) {
byte[] bytes = new byte[jsonStr.length() + 1];
// copy string to byte array
for (int i = 0; i < jsonStr.length(); i++) {
bytes[i] = (byte) jsonStr.charAt(i);
}
System.arraycopy(jsonStr.getBytes(), 0, bytes, 0, jsonStr.length());
bytes[jsonStr.length()] = (byte) lastByte;
return bytes;
}
Expand Down
8 changes: 4 additions & 4 deletions flex/interactive/sdk/python/interactive_sdk/client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from pydantic import Field, StrictStr

from interactive_sdk.client.status import Status
from interactive_sdk.openapi.api.admin_service_graph_management_api import (
AdminServiceGraphManagementApi,
)
Expand Down Expand Up @@ -523,11 +524,10 @@ def call_procedure(
)
result = CollectiveResults()
if response.status_code == 200:
byte_data = response.data.encode('utf-8')
result.ParseFromString(byte_data)
return Result.from_response(response)
result.ParseFromString(response.data)
return Result.ok(result)
else:
return Result.from_response(result)
return Result(Status.from_response(response), result)
except Exception as e:
return Result.from_exception(e)

Expand Down
2 changes: 2 additions & 0 deletions flex/tests/interactive/test_call_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def callProcedureWithJsonFormat(self, graph_id : str):
if not resp.is_ok():
print("call sample_app failed: ", resp.get_status_message())
exit(1)
res = resp.get_value()
print("call sample_app result: ", res)
self.call_cypher_queries()

def callProcedureWithEncoder(self, graph_id : str):
Expand Down

0 comments on commit 4dc785b

Please sign in to comment.