Skip to content

Commit 8b9b8d9

Browse files
author
khushthecoder
committed
fix: guard heatmap non-unique index test against single-row DataFrames
When the frequency DataFrame has only one row (e.g., due to sample query filtering), the "contig" column is unique, so passing index="contig" does not raise ValueError. Only assert the error when the contig values are actually non-unique. This fixes a flaky test failure in test_gene_cnv_frequencies_with_str_cohorts_and_sample_query.
1 parent a78e8b4 commit 8b9b8d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/anoph/test_frq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def check_plot_frequencies_heatmap(api, frq_df):
1616
# Test index parameter - if None, should use dataframe index.
1717
fig = api.plot_frequencies_heatmap(frq_df, show=False, index=None, max_len=None)
1818

19-
if "contig" in list(frq_df.columns):
19+
if "contig" in list(frq_df.columns) and not frq_df["contig"].is_unique:
2020
# Not unique.
2121
with pytest.raises(ValueError):
2222
api.plot_frequencies_heatmap(

0 commit comments

Comments
 (0)