Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

issue 367 - Draft entity query error #371

Merged
merged 10 commits into from
Jan 27, 2023
Merged

issue 367 - Draft entity query error #371

merged 10 commits into from
Jan 27, 2023

Conversation

ryegros
Copy link
Contributor

@ryegros ryegros commented Jan 2, 2023

Refers to #367 . Changes a query parser behaviour when dealing with entity without alias inside expression in "select" clause.

@gregorwolf
Copy link
Contributor

Hi @ryegros,

thank you very much for your contribution. Could we use the existing, draft enabled Entity TypeChecksWithDraft instead of adding two new entities?

Best Regards
Gregor

@ryegros
Copy link
Contributor Author

ryegros commented Jan 26, 2023

Hi @gregorwolf.

Sorry for delay, I was quite busy since the begin of year and had no time to answer.

I did some changes today to be less invasive on current data model test-cases.

Unfortunately, I was only able to reproduce the issue with two draft entities, so a created the TypeChecksSibling entity making reference to the existing entity TypeChecks (also needs to annotate TypeChecksWithDraft with '@cds.redirection.target' on service file).

It takes me some extra time because I had to deal with another error while making the changes, it seems that expand an entity that have virtual fields leads to another exception at:

[node_modules/@sap/cds/libx/_runtime/db/expand/expandCQNToJoin.js:677]
const cols = column.expand.filter(c => !c.expand && !(c.ref[0] in DRAFT_COLUMNS_MAP)).map(c => c.ref[0])
Seems like virtual fields don’t have a “ref” attribute, generating an exception.

But I think that this is a question for another issue, maybe at standard lib @sap/cds and also I’m not sure if it's a bug, feature or expected behavior. So, I used the "($select='field')" on expand odata query in the test case to avoid the virtual attribute.

Is there anything else that I can do to help, on this issue?

Best Regards
Rafael Yegros.

@gregorwolf
Copy link
Contributor

Hi Rafael,

looks a lot better. I think we can also get rid of the Supplier entity or?

rbhuva and others added 2 commits January 27, 2023 17:37
* chore(deps): bump moment from 2.29.1 to 2.29.4

* chore(deps): bump moment from 2.29.1 to 2.29.4

---------

Co-authored-by: Rajdeep Bhuva <[email protected]>
@gregorwolf gregorwolf self-requested a review January 27, 2023 16:43
@gregorwolf gregorwolf merged commit d649a57 into sapmentors:main Jan 27, 2023
@gregorwolf
Copy link
Contributor

Thank you.

@ryegros
Copy link
Contributor Author

ryegros commented Jan 27, 2023

Yes... sorry, I removed the entity itself but forgot to remove the annotations references to the entity.

Glad to help.

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

Successfully merging this pull request may close these issues.

None yet

3 participants