Conversation
Reached much better compliance with the latest changes:
```
=======================================================
OpenCypher TCK Compliance Report
=======================================================
Total scenarios: 3897
Passed: 1908 (48%)
Failed: 1939 (49%)
Skipped: 50 (1%)
-------------------------------------------------------
By category:
clauses/call 2/ 52 passed (3%)
clauses/create 64/ 78 passed (82%)
clauses/delete 24/ 41 passed (58%)
clauses/match 292/381 passed (76%)
clauses/match-where 25/ 34 passed (73%)
clauses/merge 47/ 75 passed (62%)
clauses/remove 29/ 33 passed (87%)
clauses/return 35/ 63 passed (55%)
clauses/return-orderby 23/ 35 passed (65%)
clauses/return-skip-limit 26/ 31 passed (83%)
clauses/set 30/ 53 passed (56%)
clauses/union 8/ 12 passed (66%)
clauses/unwind 10/ 14 passed (71%)
clauses/with 14/ 29 passed (48%)
clauses/with-orderBy 124/292 passed (42%)
clauses/with-skip-limit 7/ 9 passed (77%)
clauses/with-where 10/ 19 passed (52%)
expressions/aggregation 23/ 35 passed (65%)
expressions/boolean 150/150 passed (100%)
expressions/comparison 36/ 72 passed (50%)
expressions/conditional 13/ 13 passed (100%)
expressions/existentialSubqueries 4/ 10 passed (40%)
expressions/graph 32/ 61 passed (52%)
expressions/list 120/185 passed (64%)
expressions/literals 120/131 passed (91%)
expressions/map 28/ 44 passed (63%)
expressions/mathematical 3/ 6 passed (50%)
expressions/null 44/ 44 passed (100%)
expressions/path 0/ 7 passed (0%)
expressions/pattern 19/ 50 passed (38%)
expressions/precedence 20/121 passed (16%)
expressions/quantifier 478/604 passed (79%)
expressions/string 22/ 32 passed (68%)
expressions/temporal 0/1004 passed (0%)
expressions/typeConversion 19/ 47 passed (40%)
useCases/countingSubgraphMatches 6/ 11 passed (54%)
useCases/triadicSelection 1/ 19 passed (5%)
=======================================================
```
Summary of ChangesHello @lvca, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly advances the OpenCypher compatibility by implementing several key features and refining existing behaviors to align with the Cypher TCK (Transactional Consistency Kit). The changes span across expression evaluation, temporal type handling, Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🧪 CI InsightsHere's what we observed from your CI run for a969961. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
Code Review
This is an impressive and extensive pull request that significantly improves OpenCypher TCK compliance. The changes cover a wide range of areas, including major correctness fixes for temporal types, list operations, three-valued logic, and semantic validation. The implementation of new SET clause features is also a great addition. I have two suggestions for improvement: one is a correctness fix for the new substring function, and the other is a refactoring suggestion to reduce code duplication for temporal type conversion.
| final int start = ((Number) args[1]).intValue(); | ||
| if (start < 0 || start > str.length()) | ||
| return ""; | ||
| if (args.length == 3 && args[2] != null) { | ||
| final int length = ((Number) args[2]).intValue(); | ||
| return str.substring(start, Math.min(start + length, str.length())); | ||
| } | ||
| return str.substring(start); |
There was a problem hiding this comment.
The implementation of substring() does not correctly handle negative start indices. According to the Cypher specification, a negative start value should be treated as an offset from the end of the string. The current implementation returns an empty string for any negative start. Additionally, it does not check for negative length values, which should raise an error.
int start = ((Number) args[1]).intValue();
if (start < 0) {
start = str.length() + start;
}
if (start < 0 || start >= str.length()) {
return "";
}
if (args.length == 3 && args[2] != null) {
final int length = ((Number) args[2]).intValue();
if (length < 0) {
throw new CommandExecutionException("substring() length cannot be negative, but was: " + length);
}
if (length == 0) {
return "";
}
return str.substring(start, Math.min(start + length, str.length()));
}
return str.substring(start);| * Convert ArcadeDB-stored values back to Cypher temporal types for proper comparison. | ||
| * Duration, LocalTime, and Time are stored as Strings because ArcadeDB | ||
| * doesn't have native binary types for them. | ||
| */ | ||
| private static Object convertFromStorage(final Object value) { | ||
| // Handle collections (lists/arrays of temporal values) | ||
| if (value instanceof java.util.Collection<?> collection) { | ||
| final java.util.List<Object> converted = new java.util.ArrayList<>(collection.size()); | ||
| for (final Object item : collection) { | ||
| converted.add(convertFromStorage(item)); | ||
| } | ||
| return converted; | ||
| } | ||
| if (value instanceof Object[] array) { | ||
| final Object[] converted = new Object[array.length]; | ||
| for (int i = 0; i < array.length; i++) { | ||
| converted[i] = convertFromStorage(array[i]); | ||
| } | ||
| return converted; | ||
| } | ||
|
|
||
| // Handle single values | ||
| if (value instanceof LocalDate ld) | ||
| return new CypherDate(ld); | ||
| if (value instanceof LocalDateTime ldt) | ||
| return new CypherLocalDateTime(ldt); | ||
| if (value instanceof String str) { | ||
| // Duration strings start with P (ISO-8601) | ||
| if (str.length() > 1 && str.charAt(0) == 'P') { | ||
| try { | ||
| return CypherDuration.parse(str); | ||
| } catch (final Exception ignored) { | ||
| // Not a valid duration string | ||
| } | ||
| } | ||
| // DateTime strings: contain 'T' with date part before it and timezone/offset | ||
| final int tIdx = str.indexOf('T'); | ||
| if (tIdx >= 4 && tIdx < str.length() - 1 && Character.isDigit(str.charAt(0))) { | ||
| try { | ||
| return CypherDateTime.parse(str); | ||
| } catch (final Exception ignored) { | ||
| // Not a valid datetime string | ||
| } | ||
| } | ||
| // Time strings: HH:MM:SS[.nanos][+/-offset] or HH:MM:SS[.nanos]Z | ||
| if (str.length() >= 8 && str.charAt(2) == ':' && str.charAt(5) == ':') { | ||
| // Check if it has a timezone offset | ||
| final boolean hasOffset = str.contains("+") || str.contains("-") || str.endsWith("Z"); | ||
| if (hasOffset) { | ||
| try { | ||
| return CypherTime.parse(str); | ||
| } catch (final Exception ignored) { | ||
| // Not a valid time string | ||
| } | ||
| } else { | ||
| try { | ||
| return CypherLocalTime.parse(str); | ||
| } catch (final Exception ignored) { | ||
| // Not a valid local time string | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return value; | ||
| } |
There was a problem hiding this comment.
Code Review - OpenCypher TCK ImprovementsI've reviewed PR #3368 which implements improvements to OpenCypher temporal handling and TCK compatibility. Here's my detailed feedback: ✅ Positive Aspects
|
* test: including official opencypher tck
* fix: fixed many issues with opencypher from TCK tests
* fix: fixed broken tests from OpenCyphr TCK
* fix: more opencypher issues from tck tests
* fix: opencypher tck more tests pass now
Reached much better compliance with the latest changes:
```
=======================================================
OpenCypher TCK Compliance Report
=======================================================
Total scenarios: 3897
Passed: 1908 (48%)
Failed: 1939 (49%)
Skipped: 50 (1%)
-------------------------------------------------------
By category:
clauses/call 2/ 52 passed (3%)
clauses/create 64/ 78 passed (82%)
clauses/delete 24/ 41 passed (58%)
clauses/match 292/381 passed (76%)
clauses/match-where 25/ 34 passed (73%)
clauses/merge 47/ 75 passed (62%)
clauses/remove 29/ 33 passed (87%)
clauses/return 35/ 63 passed (55%)
clauses/return-orderby 23/ 35 passed (65%)
clauses/return-skip-limit 26/ 31 passed (83%)
clauses/set 30/ 53 passed (56%)
clauses/union 8/ 12 passed (66%)
clauses/unwind 10/ 14 passed (71%)
clauses/with 14/ 29 passed (48%)
clauses/with-orderBy 124/292 passed (42%)
clauses/with-skip-limit 7/ 9 passed (77%)
clauses/with-where 10/ 19 passed (52%)
expressions/aggregation 23/ 35 passed (65%)
expressions/boolean 150/150 passed (100%)
expressions/comparison 36/ 72 passed (50%)
expressions/conditional 13/ 13 passed (100%)
expressions/existentialSubqueries 4/ 10 passed (40%)
expressions/graph 32/ 61 passed (52%)
expressions/list 120/185 passed (64%)
expressions/literals 120/131 passed (91%)
expressions/map 28/ 44 passed (63%)
expressions/mathematical 3/ 6 passed (50%)
expressions/null 44/ 44 passed (100%)
expressions/path 0/ 7 passed (0%)
expressions/pattern 19/ 50 passed (38%)
expressions/precedence 20/121 passed (16%)
expressions/quantifier 478/604 passed (79%)
expressions/string 22/ 32 passed (68%)
expressions/temporal 0/1004 passed (0%)
expressions/typeConversion 19/ 47 passed (40%)
useCases/countingSubgraphMatches 6/ 11 passed (54%)
useCases/triadicSelection 1/ 19 passed (5%)
=======================================================
```
* fix: opencypher implemented missing temporal functions + precedence
Issue #3357 and #3355
* fix: opencypher implemented more missing functions
Issue #3357 and #3355
* fix: opencypher more code fixed thank to the tck
* fix: OpenCypher fixed temporal functions (from TCK results)
(cherry picked from commit c8b8ce5)
I think I'm done for today with OpenCypher TCK...