Skip to content

Commit a834090

Browse files
Added message for associations tab with one column in TableReport (#2094)
Co-authored-by: Jérôme Dockès <jerome@dockes.org>
1 parent a30dd5f commit a834090

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Changes
2525
- An unnecessary warning that was raised when passing a numpy array to the
2626
TableVectorizer has been removed. :pr:`1908` by
2727
:user:`Sandrine Henry <sandrineh>`.
28+
- Improving the association tab error message when only one column is present
29+
:pr:`2094` by :user:`Alicja Kosak <AlicjaKo>`.
2830

2931
Bugfixes
3032
--------

skrub/_reporting/_data/templates/column-associations.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@
7979
In this case, one of them may be redundant and for some models (such as linear models) it might be beneficial to remove it.
8080
</div>
8181

82+
{% elif summary['n_columns'] == 1 %}
83+
No associations were computed because the dataframe has only one column.
8284
{% else %}
8385
No strong associations between any pair of columns were identified by a quick screening of a subsample of the dataframe.
8486
{% endif %}
87+
8588
</article>

skrub/_reporting/tests/test_table_report.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ def test_single_column_report(df_module):
443443
col_name = sbd.name(single_col)
444444
html = report.html()
445445
assert col_name in html
446+
assert (
447+
"No associations were computed because the dataframe has only one "
448+
"column." in html
449+
)
446450

447451

448452
def test_error_make_table():

0 commit comments

Comments
 (0)