Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v12 - Array.Empty<T> translates to ObjectName[] instead of json [] #1598

Closed
krukowskid opened this issue May 24, 2024 · 3 comments · Fixed by #1610
Closed

v12 - Array.Empty<T> translates to ObjectName[] instead of json [] #1598

krukowskid opened this issue May 24, 2024 · 3 comments · Fixed by #1610
Labels

Comments

@krukowskid
Copy link

Describe the bug
I am trying to upgrade Gremlinq from 11.2.5 to 12.6.4, however I've run into an issue which I am not sure if it's expected behavior. After migration to v12, all queries that are using Array.Empty<T>() started to fail.

.By(nameof(InvitationDbQueryResponse.Departments), i => i.Coalesce(_ => _.OutE<For>().InV<Department>(),
                                                              _ => _.Constant(Array.Empty<Department>()))))

After investigation I have found out that in v12.x it converts Array.Empty<Department>() to object name like Namespace.Department[] instead of json [] which causes query error. Is it some misconfiguration on my side, an issue, or is it by design and the only way to fix it is to modify each query to use .Fold()?

Expected behavior
It should resolve _.Constant(Array.Empty<Department> to __.constant([])

Version information
11.2.5 -> 12.6.4

Minimal working example

.AddGremlinq(setup => setup
        .UseCosmosDb<Vertex, Edge>()
        .UseNewtonsoftJson())
_g.V<Company>(companyId).Project(p => p.ToDynamic().By("objects", i => i.Coalesce(_ => _.Constant(Array.Empty<string>()),
                                                                              _ => _.Constant(Array.Empty<string>()))));
@danielcweber danielcweber added Issue template ignored The issue template was ignored. labels May 27, 2024
Copy link
Contributor

Hello @krukowskid,
it seems that you ignored significant parts of the issue template. Please reconsider.

Copy link
Contributor

Hello @krukowskid,
thanks for your interest in ExRam.Gremlinq. The issue was labelled "Repro repository missing" because although the issue template asks for either "a link to GitHub repository containing a minimal executable project structure that exposes the unexpected behaviour" or "a pull request to ExRam.Gremlinq that adds a failing unit test to the ExRam.Gremlinq tests asserting the expected behaviour", it seems you provided neither. Most problems already solve themselves when isolated and if they don't, you will have made it easier for the maintainer of this project to investigate a possible bug.

@danielcweber
Copy link
Contributor

Fixed by #1610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants