-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem?
The runner needs to know how to serialize certain objects to JSON, as they need to be sent to the VS Code extension.
Currently, these types would be:
-
Table (https://github.com/Safe-DS/Library/blob/main/src/safeds/data/tabular/containers/_table.py)
A JSON representation already exists by callingto_json_file. To use this here, a new method without files would be needed -
Image (https://github.com/Safe-DS/Library/blob/main/src/safeds/data/image/containers/_image.py)
An image can be represented as a byte array by calling_repr_png_. This could be encoded to a string with base64.
Desired solution
As the json.dumps function is used to encode data, a custom JSONEncoder subclass could be used that encodes these additional values and falls back to the default encoder for all other values (like numbers).
The custom encoder can be specified using the cls argument of the json.dumps function.
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
Some types like Tables and Images are useful for inspection purposes.
They should be able to be displayed in the VS Code extension to show information about the data of a pipeline.
Currently, placeholders are sent in the data field of the placeholder_value message.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status