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

feat(hogql): errors for large full select queries #15957

Merged
merged 7 commits into from
Jun 9, 2023

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Jun 8, 2023

Problem

The full HogQL insight editor does not show errors as well as the inline filter editors.

Changes

Support passing error information from HogQLMetadata now.

2023-06-08 14 46 10

Also cleaned up the location information with antlr syntax errors.

How did you test this code?

See the gif

@mariusandra mariusandra requested a review from Twixes June 8, 2023 15:06
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Works great, but one one I have is that it shouldn't be possible to "Update"/run the query if's got a syntax error.

Comment on lines 21 to 22
const [monaco, setMonaco] = useState(null as Monaco | null)
const [editor, setEditor] = useState(null as importedEditor.IStandaloneCodeEditor | null)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Since these come as a package together, I propose just one useState of type [Monaco, importedEditor.IStandaloneCodeEditor] | null

@@ -129,6 +129,7 @@ export const commonConfig = {
'process.env.NODE_ENV': isDev ? '"development"' : '"production"',
},
loader: {
'.ttf': 'file',
Copy link
Member

Choose a reason for hiding this comment

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

What's this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got an error when importing from monaco otherwise :/

@mariusandra
Copy link
Collaborator Author

Will this do?

2023-06-09 15 58 29

I'm not exposing the "validating..." to the user through a spinner cause I think it'd be flash and annoying. However because of that I'm also not disabling the button when it's loading, and there's a chance someone can still submit an invalid query if they're really fast. But then we show the error below, so 🤷‍♂️

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

That's great

@Twixes Twixes merged commit 3f1fab0 into master Jun 9, 2023
@Twixes Twixes deleted the hogql-select-async-errors branch June 9, 2023 17:05
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.

2 participants