justinmclean opened a new issue, #8350:
URL: https://github.com/apache/gravitino/issues/8350
### What would you like to be improved?
In
common/src/main/java/org/apache/gravitino/dto/responses/PartitionStatisticsListResponse.java
check if each partition statistic is not null.
Here's a test to help:
```
@Test
void testPartitionStatisticsListResponseNullElement() {
AuditDTO audit =
AuditDTO.builder().withCreator("user1").withCreateTime(Instant.now()).build();
StatisticDTO statistic =
StatisticDTO.builder().withName("stat").withAudit(audit).withValue(Optional.empty()).build();
PartitionStatisticsDTO valid =
PartitionStatisticsDTO.of("p1", new StatisticDTO[] {statistic});
PartitionStatisticsDTO[] stats = new PartitionStatisticsDTO[] {valid,
null};
PartitionStatisticsListResponse response = new
PartitionStatisticsListResponse(stats);
assertThrows(IllegalArgumentException.class, response::validate);
}
```
### How should we improve?
Add precondition
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]