Skip to content

feat: Display query units in Pipeline repr#27

Merged
mingjerli merged 1 commit into
mainfrom
feat/pipeline-repr-with-query-units
Dec 8, 2025
Merged

feat: Display query units in Pipeline repr#27
mingjerli merged 1 commit into
mainfrom
feat/pipeline-repr-with-query-units

Conversation

@mingjerli

Copy link
Copy Markdown
Owner

Summary

Enhances Pipeline __repr__ to display query unit information.

Changes

  • Updated Pipeline __repr__ method to show query units
  • Improves debugging and inspection of Pipeline objects

Related

  • Documentation PR: clgraph-dev/clgraph-docs#12

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Enhance Pipeline.__repr__() to show the internal structure of each query
by displaying its query units (CTEs, subqueries, main query).

Changes:
- Pipeline.__repr__() now extracts and displays unit_ids from query lineage
- Each query shows its components in hierarchical format:
  - `main` - main SELECT statement
  - `cte:name` - Common Table Expressions
  - `subq:N` - Subqueries
- Updated README.md with new repr format examples

Example output:
```
Pipeline(
  query1: CREATE TABLE ... WITH sales AS (...
    cte:sales
    cte:customers
    main
  query2: CREATE TABLE ...
    main
)
```

This makes it much easier to understand query structure at a glance,
especially for complex queries with multiple CTEs and subqueries.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@mingjerli mingjerli merged commit 01750ef into main Dec 8, 2025
3 checks passed
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.

1 participant