Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Serialization for user-facing types #20

Closed
2 tasks
WinPlay02 opened this issue Dec 2, 2023 · 1 comment · Fixed by #29
Closed
2 tasks

JSON Serialization for user-facing types #20

WinPlay02 opened this issue Dec 2, 2023 · 1 comment · Fixed by #29
Assignees
Labels
enhancement 💡 New feature or request released Included in a release

Comments

@WinPlay02
Copy link
Contributor

WinPlay02 commented Dec 2, 2023

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:

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.

@WinPlay02 WinPlay02 added the enhancement 💡 New feature or request label Dec 2, 2023
lars-reimann pushed a commit that referenced this issue Dec 9, 2023
Closes #20 

### Summary of Changes

- added SafeDSEncoder that is used for custom types (tables, images)
- don't crash when unknown types are attempted to be sent, instead send
a "\<Not Displayable\>" placeholder value
- added encoding tests + not displayable to existing message exchange

---------

Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
@WinPlay02 WinPlay02 self-assigned this Dec 15, 2023
lars-reimann pushed a commit that referenced this issue Jan 26, 2024
## [0.5.0](v0.4.0...v0.5.0) (2024-01-26)

### Features

* added json serializer that encodes tables and images ([#29](#29)) ([054cca4](054cca4)), closes [#20](#20)
* Memoization ([#38](#38)) ([2a26b48](2a26b48))
* Replace flask with quart ([#43](#43)) ([5520b68](5520b68)), closes [#42](#42)
* support placeholder queries that only request a subset of data ([#39](#39)) ([dae57dc](dae57dc))
* update to safe-ds 0.17.1 + server refactor ([#37](#37)) ([1bcad07](1bcad07))

### Bug Fixes

* allow multiple connections to work with the runner ([#31](#31)) ([64685a3](64685a3))
@lars-reimann
Copy link
Member

🎉 This issue has been resolved in version 0.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request released Included in a release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants