Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of returning the textOutputOrError only, this enhancement separated the Error, Output and return value from the executed python script.
In the event of an error in the Python script, the returned map contains:
errorType
: Specifies the type of the error (e.g., ValueError, TypeError, etc.).errorMessage
: Provides a detailed error message.traceback
: Offers a traceback of the error, aiding in debugging.In the event of the Python script finish execution successfully, the returned map contains:
output
: Any print statements or other outputs produced by the Python script.returnValueJson
: This key doesn't directly represent the raw return value from the Python script. Instead, it contains a serialized version of the value(s) assigned to theresult
variable within the executed Python script.serialize_to_json
function in script.py. By default, it supports basic data types like integers, floats, strings, lists, dictionaries, booleans, and None. If a value doesn't match these types, it's converted to its string representation.Customization: Users have the flexibility to modify the script.py to suit their needs:
text_thread_run
function.The script.py is modified for this enhancement accordingly: