Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- `python/python/tests/` stores functional tests; mirror new features with targeted cases here and in the corresponding Rust module.
- `examples/` demonstrates Cypher usage; update or add examples when introducing new public APIs.
- `docs/` is the Zensical documentation site (configured by `zensical.toml`); follow `docs/AGENTS.md`.
- Keep the docs in step with the code. Any substantial code change (a new or changed Python method, parameter, return type, exception or Cypher feature, or a change in behaviour users can observe) updates the affected guide pages in the same pull request. The Python API reference (`docs/api-reference.md`) is generated from the docstrings and type hints of the public classes in `python/python/lance_csr/`, so a Python API change updates those docstrings, checked against the behaviour in `crates/lance-csr-python/src/`. A change to a DataFusion extension (an extension node or operator, an optimizer rule, a planner rewrite, or the CSR and node indexes) updates `docs/internals/`. Document Python behaviour there, not in Rust `///` comments on the bindings. Then run `uv run --project docs --locked zensical build --strict` and `uvx typos@1.26.0 .` (the spell check CI runs).
- Keep the docs in step with the code. Any substantial code change (a new or changed Python method, parameter, return type, exception or Cypher feature, or a change in behaviour users can observe) updates the affected guide pages in the same pull request. The Python API reference (`docs/api-reference.md`) is generated from the docstrings and type hints of the public classes in `python/python/lance_csr/`, so a Python API change updates those docstrings, checked against the behaviour in `crates/lance-csr-python/src/`. A change to a DataFusion extension (an extension node or operator, an optimizer rule, a planner rewrite, or the CSR and node indexes) updates `docs/internals/`. Document Python behaviour there, not in Rust `///` comments on the bindings. Then run `uv run --project docs --locked zensical build --strict` and `uvx typos@1.51.1 .` (the spell check CI runs).

## Build, Test, and Development Commands
- `cargo test --workspace` (from the repository root) runs the Rust tests; building needs `protoc`.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ cd python && make test && make lint
When you change user-facing behaviour or the Python API, update the affected guide pages and the docstrings
of the Python classes in `python/python/lance_csr/` (which generate `docs/api-reference.md`) in the same
pull request, then run
`uv run --project docs --locked zensical build --strict` and `uvx typos@1.26.0 .`.
`uv run --project docs --locked zensical build --strict` and `uvx typos@1.51.1 .`.

## Report a bug or suggest an improvement

Expand Down
7 changes: 6 additions & 1 deletion docs/cypher.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,12 @@ other characters, or that matches a keyword. Inside a quoted name, two backticks
doesn't change the case rules above.

```python
engine.execute(
device_config = GraphConfig.builder().node_table("Device Type", "asset id").build()
devices = {
"Device Type": pa.table({"asset id": ["a-1", "b-2"], "status": ["active", "retired"]})
}
device_engine = CypherEngine(device_config, devices)
device_engine.execute(
"MATCH (x:`Device Type`) WHERE x.`asset id` IN $keys RETURN x.`asset id` AS `asset id`",
{"keys": ["a-1"]},
).to_pylist() # [{'asset id': 'a-1'}]
Expand Down
9 changes: 7 additions & 2 deletions docs/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,17 @@ Cypher's backticks work too. The direct `graph_table('...')` call takes Cypher t
is a string.

```python
engine.execute("""
device_config = GraphConfig.builder().node_table("Device Type", "asset id").build()
devices = {
"Device Type": pa.table({"asset id": ["a-1", "b-2"], "status": ["active", "retired"]})
}
device_engine = SqlEngine(devices, device_config)
device_engine.execute("""
SELECT g."asset id" FROM GRAPH_TABLE (
MATCH (x:"Device Type") WHERE x.status = 'active'
COLUMNS (x."asset id" AS "asset id")
) g
""")
""").to_pylist() # [{'asset id': 'a-1'}]
```

To run Cypher and SQL over the same data, build the `CypherEngine` and share its snapshot. Nothing is rebuilt, and
Expand Down