Skip to content

Commit

Permalink
ALS-4978: Fix issue with empty variant filters showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Dec 6, 2023
1 parent cef3e28 commit 8fe8024
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import edu.harvard.hms.dbmi.avillach.hpds.data.query.Query;

import java.util.*;
import java.util.stream.Collectors;

public class DistributableQuery {

Expand Down Expand Up @@ -30,7 +31,9 @@ public Map<String, String[]> getCategoryFilters() {
}

public void setVariantInfoFilters(Collection<Query.VariantInfoFilter> variantInfoFilters) {
this.variantInfoFilters = variantInfoFilters != null ? new ArrayList<>(variantInfoFilters) : new ArrayList<>();
this.variantInfoFilters = variantInfoFilters.stream()
.filter(variantInfoFilter -> !variantInfoFilter.categoryVariantInfoFilters.isEmpty() || !variantInfoFilter.numericVariantInfoFilters.isEmpty())
.collect(Collectors.toList());
}
public List<Query.VariantInfoFilter> getVariantInfoFilters() {
return new ArrayList<>(variantInfoFilters);
Expand Down

0 comments on commit 8fe8024

Please sign in to comment.