lance-format / lance-format/lance-graph

feat: Allow trailing semicolons in query to be more in line with other graph systems

Open
#101 3 comments 0 reactions 1 assignee View on GitHub

@aheev is already working on this.

Since Feb 2, 2026.

Dominant language
Rust
Stars
179
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Summary

For users coming from Graph databases that have CLIs or Cypher query editors (e.g., Neo4j, Kuzu, Ladybug), queries that end with ; fail to parse, even though the rest of the query is perfectly valid. Cypher parsers in well-known graph databases often allows trailing semicolons to indicate the end of a query.

Example

import pyarrow as pa
from lance_graph import GraphConfig, CypherQuery

people = pa.table({"id": [1]})
cfg = GraphConfig.builder().with_node_label("Person", "id").build()
datasets = {"Person": people}

CypherQuery("MATCH (p:Person) RETURN p.id LIMIT 1;").with_config(cfg).execute(datasets)
Traceback (most recent call last):
  File "/Users/prrao/code/graph-benchmark/lance_graph/tt.py", line 8, in <module>
    CypherQuery("MATCH (p:Person) RETURN p.id LIMIT 1;").with_config(cfg).execute(datasets)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Cypher parse error at position 36: Unexpected input after query: ;
Expected

Query executes (same behavior as without semicolon).

Actual

ValueError: Cypher parse error ... Unexpected input after query: ;

Proposal

Simple regex match and removal could work.

The user's expectation (coming from other systems) may be to mark the end of the query block with a semicolon.

However, in the future, if multiple query executions via a single call are supported that use a semicolon to separate intent. If this is intended to be supported in the future, then the regex approach may not work.

In such a case, it might make sense to handle the semicolon a bit more gracefully (like warning the user that semicolons aren't accepted as part of the query, removing it and continuing to execute it), rather than throwing an outright error.

Environment

The following environment was used to test this:

lance-graph 0.4.0
Python 3.13
macOS Tahoe 26.2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.