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

Feature request: Better handling for "Missing main pipeline" message #4909

Open
richb-hanover opened this issue Sep 15, 2024 · 0 comments
Open

Comments

@richb-hanover
Copy link
Contributor

richb-hanover commented Sep 15, 2024

What's up?

I was using qStudio 3.10 and made a silly mistake in my query. But the diagnostic message from prqlc was mystifying... The problem is fully described in timestored/qstudio#89. The short description is that after I commented out a line, qStudio then (reasonably) left the line selected. qStudio then handed the commented-out line to prqlc (with Cmd-E) which returned this non-helpful diagnostic:

java.io.IOException: Non-zero exit value for runArgs:[E0001] Error: Missing main pipeline
↳ Hint: Expected a declaration at main

I have already submitted a request to qStudio for a workaround (timestored/qstudio#90)

BUT... I have never been happy with the "Missing main pipeline" message. I see it in the Playground as well. (screenshot below) I don't like it because:

  • It's not helpful for newcomers. "What's the main pipeline? Do I have to make other ones?"
  • It's confusing in the Playground. "Oh no... There isn't any text there, and I have no idea what to do. How do I make a main pipeline?..."
  • It uses prqlc-centric terminology.
  • It doesn't tell what to do to get better

Proposal:

  • If the query is the empty string, the diagnostic message could be something like "No PRQL query entered" (seeing that text in the Playground window below would be completely self-explanatory)
  • If the query is syntactically correct, but doesn't contain from ..., then the message could be, "PRQL queries must begin with 'from'". The squiggly error highlight in the Playground should appear at the end of the input, reminding the person that they still need to type more.
  • If the query is not syntactically correct (say, a statement/function declaration has been partially typed into the Playground), the current parsing/error handling provides good enough messages. Once it becomes valid again, the "PRQL queries must begin with 'from'" message should appear again

This would not have avoided the situation with qStudio, but searching for the reason that from was missing would have been much more fruitful than trying to guess how my "main pipeline" went missing...

Thanks for listening

image
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

No branches or pull requests

1 participant