Skip to content

fix(query): ask for a label when a node pattern has none - #188

Merged
prrao87 merged 1 commit into
mainfrom
docs/unlabeled-node-error
Nov 21, 2026
Merged

prrao87 merged 1 commit into
mainfrom
docs/unlabeled-node-error

Conversation

@prrao87

@prrao87 prrao87 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Why

A node pattern with no label, and nothing to infer one from, is rejected. The rule was only stated in the graph schema page, and the error named a label the user never wrote:

Query planning error: Node label 'Node' doesn't exist

Node is the planner's internal default for unlabeled nodes, so searching the docs for the message found nothing. Closes #181.

What changed

  • The error now says what to do. Both places that reject an unknown label (the logical planner for RETURN n, and the scan planner for property reads, filters and counts) share one message:

    Query Before After
    MATCH (n) RETURN n Node label 'Node' doesn't exist A node pattern has no label and no relationship to infer one from: add a label, e.g. `(n:Person)`
    MATCH (n) RETURN n.name Node label 'Node' not found in catalog. Ensure the label is registered in your GraphConfig with .node_table() same as above
  • Unknown labels the user did write still name the label, with a hint that isn't Python-specific (.node_table() doesn't exist in the TypeScript package).

  • The Cypher guide explains, under Supported Cypher, that every node needs a label from the pattern or from a relationship mapping, quotes the new error, and links to "Labels in patterns".

One edge: a pattern that literally writes (n:Node) with no Node table now gets the "needs a label" message, since the planner can't tell it apart from the default. That seemed an acceptable trade for the common case.

Validation

  • cargo test -p lance-csr: passes, with a new planner test for MATCH (n) RETURN n.
  • cargo clippy -p lance-csr --all-targets -- -D warnings: clean.
  • make test in python/: 1744 passed, 1 skipped, including a new test for three unlabeled queries on both join and CSR engines.
  • make lint, zensical build --strict, typos: clean.
  • Node.js tests weren't run locally; no TypeScript code or tests match on these messages. CI pending.

🤖 Generated with Claude Code

A node pattern with no label and no relationship to infer one from
failed with "Node label 'Node' doesn't exist", naming an internal
default the user never wrote. Say what to do instead, and document
the rule and the message in the Cypher guide.

Closes #181
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: c4f6c46
Status: ✅  Deploy successful!
Preview URL: https://d37ab5c7.lance-csr.pages.dev
Branch Preview URL: https://docs-unlabeled-node-error.lance-csr.pages.dev

View logs

@prrao87
prrao87 marked this pull request as ready for review November 21, 2026 20:28
@prrao87
prrao87 merged commit 5c874f5 into main Nov 21, 2026
10 checks passed
@prrao87
prrao87 deleted the docs/unlabeled-node-error branch November 21, 2026 20:28
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.

Document that unlabeled nodes need a label, and the error you get

1 participant