Skip to content

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

@richb-hanover

Description

@richb-hanover

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions