feat: fix schema procedure types and mandatory for Simba BI connector#4186
Open
imilinovic wants to merge 5 commits into
Open
feat: fix schema procedure types and mandatory for Simba BI connector#4186imilinovic wants to merge 5 commits into
imilinovic wants to merge 5 commits into
Conversation
Contributor
Author
Tracking
Standard development
CI Testing Labels
Documentation checklist
|
a312358 to
e44ee5b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the schema.node_type_properties and schema.rel_type_properties query module outputs to better match the Simba BI (PowerBI/Tableau) connector’s expected type strings and to correct mandatory semantics to be constraint-driven rather than sampling-driven.
Changes:
- Adjusts emitted type strings to connector-friendly values (e.g.,
Bool→Boolean,Double→Float,ZonedDateTime→DateTime,Point2d/3d→Point, lists/maps asList[Any]/Map[Any]). - Reworks
mandatoryfor node properties to be derived from existence constraints (label-aware), and sets relationshipmandatoryto alwaysfalse. - Updates/extends E2E tests to reflect the new type strings and
mandatorybehavior, including new constraint-focused test cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
query_modules/schema.cpp |
Updates schema procedure type-string mapping and computes mandatory from existence constraints (nodes) / forces false (rels). |
tests/e2e/query_modules/schema_test.py |
Aligns expectations with new type strings and constraint-based mandatory; adds focused tests for list opacity and existence-constraint semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fa2d6c6 to
e076502
Compare
|
11 tasks
Make schema.node_type_properties / rel_type_properties emit type strings the Simba BI connector (PowerBI/Tableau) recognises, so properties map to proper SQL types instead of degrading to VARCHAR: - Bool -> Boolean, Double -> Float, ZonedDateTime -> DateTime, Point2d/3d -> Point - Int kept (the connector maps "Integer" to VARCHAR despite its docs claiming BIGINT) Fix mandatory semantics: now driven by existence constraints (label-aware) instead of the sampling-ratio heuristic. Relationships always report mandatory=false (no rel-type existence constraints in Memgraph).
Use rfind(':') to locate the label/property delimiter — property paths
can contain '.', so first-colon split was only safe by unstated label
invariant. Move BuildExistenceConstraintsByLabel into anonymous namespace.
Trim TypeOf comments to one line each.
BuildExistenceConstraintsByLabel now catches ImmutableObjectException and degrades to an empty map on virtual graphs, instead of widening the mgp_list_all_* C-API contract to silently return empty. Adds e2e coverage: virtual-graph invocation, multi-label negative case, constraint with no matching nodes, sample x constraint interaction, and a drift sentinel asserting that rel-type existence constraints are still rejected at parse time.
11a6821 to
a7bcb82
Compare
The sentinel asserted that the parser still rejects rel-type existence constraints — a meta-check against the language layer rather than the schema procedure itself. It provides no signal about RelTypeProperties correctness, so remove it and keep the hardcoded mandatory=false explained by a one-line comment.
The previous comment claimed labels cannot contain ':', justifying rfind. That's false — both labels and property names can contain ':' via backticked Cypher identifiers (CypherLexer.g4:178). The producer doesn't escape, so the format is genuinely ambiguous in that edge case; rfind is just a tie-break.
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.



Make schema.node_type_properties / rel_type_properties emit type strings the Simba BI connector (PowerBI/Tableau) recognises, so properties map to proper SQL types instead of degrading to VARCHAR:
Fix mandatory semantics: now driven by existence constraints (label-aware) instead of the sampling-ratio heuristic. Relationships always report mandatory=false (no rel-type existence constraints in Memgraph).
Breaking
propertyTypesstrings rename:Bool→Boolean,Double→Float,ZonedDateTime→DateTime,Point2d/Point3d→Point. Consumers that pattern-matched the old strings must update.mandatorysemantics change without a column rename: same field, new meaning. Code that relied on sample-coveragemandatory(e.g.truewhenever every sampled node carried the property) will now seefalseunless an existence constraint is declared. Relationships always reportfalse.