Skip to content

Commit

Permalink
Fix arithmetic division by zero in the DatasetTestReport API (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
DementevNikita committed Jun 10, 2022
1 parent d9e3c91 commit acca082
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

@Mapper(config = MapperConfig.class, uses = OffsetDateTimeMapper.class)
public interface DataQualityMapper {
@Mapping(target = "score", expression = "java( (int)(100 * report.getSuccessTotal() / report.getTotal()) )")
@Mapping(
target = "score",
expression = "java( report.getTotal() != 0 ? (int)(100 * report.getSuccessTotal() / report.getTotal()) : 0 )"
)
DataSetTestReport mapDatasetTestReport(final DatasetTestReportDto report);
}
2 changes: 2 additions & 0 deletions odd-platform-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ management:
health:
ldap:
enabled: false
redis:
enabled: false

logging:
level:
Expand Down

0 comments on commit acca082

Please sign in to comment.