Repository navigation
refactor(config)!: make graph config mappings private - #70
Merged
Merged
Conversation
GraphConfig's node and relationship mappings are now private, so keys are always normalized through GraphConfigBuilder. Deserialization also goes through the builder, so a loaded config is validated like a built one. The serialized format is unchanged.
Deploying lance-csr with
|
| Latest commit: |
d6de91f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://217fce81.lance-csr.pages.dev |
| Branch Preview URL: | https://fix-private-config-mappings.lance-csr.pages.dev |
prrao87
marked this pull request as ready for review
October 28, 2026 14:43
prrao87
added a commit
that referenced
this pull request
Oct 28, 2026
0.4.0 rather than 0.3.2: #70 made the graph config mappings private, a breaking change. Also refresh the version in the three lockfiles, which bump-my-version does not update.
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
GraphConfigkeys its node and relationship mappings by lowercase label so lookups are case-insensitive. The mapping fields were public, so code outsideGraphConfigBuildercould insert a key like"Person"and lookups would silently miss it. Deserialization had the same gap: a saved config was loaded without normalizing or validating its keys.Closes #23. The issue's second half, type checking comparisons and arithmetic in semantic analysis, already landed with the 0.3.0 integration in
crates/lance-csr/src/semantic/types.rs. A mismatch inWHEREorRETURNraises aValueErrorthat names the expression and both operand types, it has tests, and the error table indocs/cypher.mdalready describes it. This PR doesn't change it.What changed
node_mappingsandrelationship_mappingsonGraphConfigare private. Reads go throughget_node_mapping,get_relationship_mapping,iter_node_mappingsanditer_relationship_mappings, which every caller in the workspace and the Python bindings already used.GraphConfignow deserializes throughGraphConfigBuilder::build(), so a loaded config is validated like a built one. The serialized format is unchanged.Breaking change for Rust users: code that writes to the mapping fields directly no longer compiles and should use the builder instead. A deserialized config that
build()would reject now fails to load: one with an unnormalized key, or a relationship whose endpoint label has no node mapping. Because of this, the next release should be a minor version bump. The Python API is unaffected.Validation
cargo fmt --all -- --checkpasses.cargo clippy --workspace --all-targets -- -D warningspasses.cargo test --workspacepasses, including a new round-trip test that also checks an unnormalized key is rejected on load.uvx typos@1.26.0passes on the changed files.make test) was not run locally. The bindings compile under clippy and don't touch the fields. CI is pending.🤖 Generated with Claude Code