Skip to content

WITH clause fails to parse, despite being mentioned in DeepWiki docs #102

Description

@prrao87

Summary

Running a query that uses a WITH clause causes a parse error, even though the docs say it’s supported.

Example

import pyarrow as pa
from lance_graph import GraphConfig, CypherQuery

people = pa.table({"id": [1, 2]})
follows = pa.table({"src": [1], "dst": [2]})
cfg = (
    GraphConfig.builder()
    .with_node_label("Person", "id")
    .with_relationship("FOLLOWS", "src", "dst")
    .build()
)
datasets = {"Person": people, "FOLLOWS": follows}

query = """
MATCH (a:Person)-[:FOLLOWS]->(b:Person)
WITH b, count(a.id) AS n
RETURN b.id, n
"""
CypherQuery(query).with_config(cfg).execute(datasets)

Expected

Query executes, returning counts per b.

Actual

  • ValueError: Cypher parse error ... input: WITH b, count(...)

Proposal

Rewriting without WITH works, but loses some expressiveness. But WITH does help a lot of Cypher beginners write queries as they're learning, so it's a useful add.

Environment

The following environment was used to test this:

lance-graph 0.4.0
Python 3.13
macOS Tahoe 26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions