-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add datasets from parameters for Query and Update #1714
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1714 +/- ##
=======================================
Coverage 89.86% 89.87%
=======================================
Files 389 389
Lines 37308 37322 +14
Branches 4204 4204
=======================================
+ Hits 33527 33543 +16
+ Misses 2485 2482 -3
- Partials 1296 1297 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much, I have some suggestions for cleaner code etc.
src/engine/Server.cpp
Outdated
} else { | ||
AD_FAIL(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this statically happen?
Otherwise you can replace the else if constexpr
by else static_assert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by doing this statically? The comment is now applied and also a static_assert(std::is_same_v<Operation, Query> || std::is_same_v<Operation, Update>)
at the beginning (which my IDE marked at some time). What would be a good style for doing this (the static_assert
in the else is redundant now)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the redundant static assert in the beginning.
The one in the beginning gives nice documentation + error messages,
And in the if-else it is useful to prevent bugs etc. So I really like the way it is now.
src/engine/Server.cpp
Outdated
return operation.update_; | ||
} else { | ||
AD_FAIL(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
There was one random test failure in a run that was most likely not from this PR: https://github.com/ad-freiburg/qlever/actions/runs/12833696568/job/35789345340?pr=1714 |
Conformance check passed ✅No test result changes. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two and a half very minor comments, this is close to finished now.
static_assert(std::is_same_v<Operation, Query> || | ||
std::is_same_v<Operation, Update>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have something like ad_utility::SameAsAny<Operation, Query, Update>
in the util/TypeTraits.h
header.
const std::string operationStr = [&operation] { | ||
if constexpr (std::is_same_v<Operation, Query>) { | ||
return operation.query_; | ||
} else if constexpr (std::is_same_v<Operation, Update>) { | ||
return operation.update_; | ||
} else { | ||
AD_FAIL(); | ||
static_assert(std::is_same_v<Operation, Update>); | ||
return operation.update_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to copy the (possibly large) string here?
Either return and store a const&
from the lambda, or at least move the string into the following functions (if composeErrorResponseJson requires a string by value).
src/engine/Server.cpp
Outdated
} else { | ||
AD_FAIL(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the redundant static assert in the beginning.
The one in the beginning gives nice documentation + error messages,
And in the if-else it is useful to prevent bugs etc. So I really like the way it is now.
Add support for datasets from parameters for Update and activates it for Query. (It was already present for Query before, but an assert prevented it's usage until now.) This PR also changes most of the dataset from parameter handling that was there before.
Resolves #1712