You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Given a query like g.V<Item>().Where(i => i.SomeProperty.Equals(someConstantGuid.ToString()), the .Debug() output renders g.V().hasLabel('Item').has('SomeProperty',someConstantGuid) without enclosing the Guid in single quotes.
This does not affect actual query execution, only the debug output. When debugging through, it appears that the Guid type falls through to the default case in the switch statement in GroovyWriter::Append, but I don't know whether the root of the issue is there or in the prior transformation to bytecode.
Expected behavior
Expected would be g.V().hasLabel('Item').has('SomeProperty','b7219a3b-783e-4293-b6d2-ba74f9335bff'); actual is g.V().hasLabel('Item').has('SomeProperty',b7219a3b-783e-4293-b6d2-ba74f9335bff). Adding .ToLowercase() after .ToString() produces the expected debug output.
I'm not sure if just quoting the Guid is the right thing to do here. It depends on the purpose of the Debug output. Most (sufficiently simple) queries can be taken verbatim and executed manually on a database in which case the Guid would be taken as a string. Which may or not be fine during subsequent deserialization with Gremlinq. But I feel if it's a Guid, it should show up in the Debug output somehow. The most sensible thing to do is output "UUID.fromString(...)" but that will of course not execute everywhere, which is fine given that it's just debug output.
The Vertex class is not part of your repro, if the respective property is of type Guid please note that AFAIK Guids are not native to CosmsoDb, so using just strings might be a my recommended solution in this case.
I see things are a bit different than I initially understood. The property on the vertex is indeed meant to be a string...so the issue may not affect debug output only. I will have to take a look.
Describe the bug
Given a query like
g.V<Item>().Where(i => i.SomeProperty.Equals(someConstantGuid.ToString())
, the.Debug()
output rendersg.V().hasLabel('Item').has('SomeProperty',someConstantGuid)
without enclosing the Guid in single quotes.This does not affect actual query execution, only the debug output. When debugging through, it appears that the Guid type falls through to the default case in the switch statement in GroovyWriter::Append, but I don't know whether the root of the issue is there or in the prior transformation to bytecode.
Expected behavior
Expected would be
g.V().hasLabel('Item').has('SomeProperty','b7219a3b-783e-4293-b6d2-ba74f9335bff')
; actual isg.V().hasLabel('Item').has('SomeProperty',b7219a3b-783e-4293-b6d2-ba74f9335bff)
. Adding.ToLowercase()
after.ToString()
produces the expected debug output.Version information
Gremlinq version 12.7.2
Minimal working example
https://github.com/cbgrasshopper/GremlinqGuidDebugIssue
The text was updated successfully, but these errors were encountered: