Repository navigation
feat(config): node_table and rel_table builder methods - #5
Merged
Merged
Conversation
GraphConfigBuilder gains node_table(label, primary_key) and rel_table(type, from_table, to_table, src, dst), named after Kuzu's node and rel tables. A relationship table always names the node tables at both ends, so labels can be inferred and alternation planned without a separate endpoints call. with_node_label, with_relationship and with_relationship_endpoints remain as deprecated aliases (a DeprecationWarning in Python). Tests, examples, benchmarks and docs use the new methods.
prrao87
force-pushed
the
feat/node-rel-tables
branch
from
October 24, 2026 15:47
8ce4e3d to
a030166
Compare
prrao87
marked this pull request as ready for review
October 24, 2026 16:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The config builder's names didn't match each other or what they configure:
with_node_labelfor nodes,with_relationshipfor edges, and a separatewith_relationship_endpointscall for the node tables at each end. Each label and each relationship type maps to one dataset, the same model as Kuzu's and Ladybug's node and rel tables, so the builder now uses their names. A relationship table also always names its two endpoint tables. Label inference and relationship-type alternation need those, and leaving them out let a mislabeled query join edge ids against the wrong node table without an error.What changed
node_table(label, primary_key)replaceswith_node_label(label, id_field).rel_table(rel_type, from_table, to_table, src, dst)replaceswith_relationship(rel_type, source_field, target_field, source_label=None, target_label=None). The endpoint tables are required, andbuild()fails if either one isn't a defined node table.with_node_label,with_relationshipandwith_relationship_endpointskeep working, unchanged, as deprecated aliases. In Python they raise aDeprecationWarningthat names the replacement; in Rust they are#[deprecated]. They're meant to be removed in a later release, after 0.2.0 ships with both.with_relationship_endpointsnow point atrel_table'sfrom_tableandto_table.Rewriting about 300 call sites was mostly mechanical. A script added the endpoints, using the chain's single node table where it had one. For the 40 calls in configs with several node tables, the endpoints were chosen from what each relationship means (for example,
WORKS_FORfrom Person to Company).Validation
cargo test --workspacepasses 584 tests (three new ones: endpoints recorded, undefined endpoint table rejected, deprecated methods still work).cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --checkare clean, so no remaining call reaches a deprecated method without an explicitallow.DeprecationWarninginto an error, so no test calls the old names unknowingly. ruff and pyright are clean.ci/check_wheel.py, so the wheel build and wheel tests run here too.mainafter docs: state goals and scope, show the ldbc benchmark, move builds to uv #4 with no conflicts; the checks above were rerun on the rebased branch.uv run --with lance-csr python examples/basic_cypher.pyfails withAttributeError: ... no attribute 'node_table'until the next release ships.🤖 Generated with Claude Code