Skip to content

fix: Improve error messages for missing main pipeline#5565

Merged
max-sixty merged 1 commit intoPRQL:mainfrom
max-sixty:4909
Nov 17, 2025
Merged

fix: Improve error messages for missing main pipeline#5565
max-sixty merged 1 commit intoPRQL:mainfrom
max-sixty:4909

Conversation

@max-sixty
Copy link
Copy Markdown
Member

Summary

Replaces the generic "Missing main pipeline" error with context-aware, beginner-friendly messages:

  • Empty queries/comments: No PRQL query entered (self-explanatory, no confusing hints)
  • Queries with declarations but no pipeline: PRQL queries must begin with 'from' with helpful hint

Changes

  • Modified error generation logic in prqlc/prqlc/src/semantic/lowering.rs to detect query context
  • Added comprehensive tests in prqlc/prqlc/tests/integration/error_messages.rs
  • All 573 tests pass ✅

Addresses Issue #4909

✅ Not helpful for newcomers → Uses beginner-friendly language
✅ Confusing in Playground → "No PRQL query entered" is self-explanatory
✅ Uses compiler-centric terminology → Removed "main pipeline" from user-facing errors
✅ Doesn't tell what to do → New hint explains queries must start with from

Test Plan

# Empty query
echo '' | prqlc compile
# Output: [E0001] Error: No PRQL query entered

# Query with declarations but no 'from'
echo 'let x = 5' | prqlc compile  
# Output: [E0001] Error: PRQL queries must begin with 'from'
#         ↳ Hint: A query must start with a 'from' statement to define the main pipeline

Closes #4909

🤖 Generated with Claude Code

Replace the generic "Missing main pipeline" error with context-aware
messages that are more helpful for newcomers:

- "No PRQL query entered" for empty queries/comments
- "PRQL queries must begin with 'from'" for queries with declarations
  but no pipeline

The new messages avoid compiler-centric terminology and provide clear,
actionable guidance.

Fixes PRQL#4909

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit ddd6777 into PRQL:main Nov 17, 2025
36 checks passed
@max-sixty max-sixty deleted the 4909 branch November 17, 2025 22:31
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.

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

1 participant