-
Notifications
You must be signed in to change notification settings - Fork 8
fix(explore): return early, if no entities #196
base: main
Are you sure you want to change the base?
Conversation
Test Results366 tests ±0 366 ✅ ±0 8s ⏱️ -1s Results for commit 31f2447. ± Comparison against base commit f284959. This pull request removes 32 and adds 17 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
gateway-service-impl/src/main/java/org/hypertrace/gateway/service/explore/RequestHandler.java
Outdated
Show resolved
Hide resolved
.../main/java/org/hypertrace/gateway/service/common/converters/QueryAndGatewayDtoConverter.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
============================================
- Coverage 81.35% 81.30% -0.05%
Complexity 1371 1371
============================================
Files 126 126
Lines 6200 6205 +5
Branches 524 526 +2
============================================
+ Hits 5044 5045 +1
- Misses 897 899 +2
- Partials 259 261 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ 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.
minor comments
@@ -113,12 +118,18 @@ QueryRequest buildQueryRequest( | |||
attributeMetadataProvider.getAttributesMetadata(requestContext, request.getContext()); | |||
if (hasOnlyAttributeSource(request.getFilter(), AttributeSource.EDS, attributeMetadataMap)) { | |||
entityIds = getEntityIdsToFilterFromSourceEDS(requestContext, request, attributeMetadataMap); | |||
|
|||
if (entityIds.isEmpty()) { |
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.
nit - worth a comment explaining why we shouldn't build a query request in this case
return ExploreResponse.newBuilder(); | ||
} | ||
|
||
QueryRequest queryRequest = maybeQueryRequest.get(); |
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.
nit - prefer .orElseThrow
over .get
(or move code around to avoid the direct access)
No description provided.