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

Serialize objects when not traces #331

Closed

Conversation

gingerwizard
Copy link
Collaborator

With #329 we changed the converted for complex types like Tuple and Arrays to raw.JSONMessage. This allows the trace view to work.

However, this means JSON messages e.g. in logs, are rendered incorrectly.
image

We ideally want to conditionally encode to JSON string based on the preferedVisualizationType i.e. use json.RawMessage for traces but string elsewhere.

I couldn't see how to do this in the server side. This attempts to do it sub-optimally in the client.

@@ -73,6 +73,8 @@ const CHEditorByType = (props: CHQueryEditorProps) => {
export const CHQueryEditor = (props: CHQueryEditorProps) => {
const { query, onChange, onRunQuery } = props;

query.selectedFormat = query.selectedFormat ?? Format.AUTO;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes another bug, where AUTO is not set.

@gingerwizard
Copy link
Collaborator Author

Closed by #332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants