Skip to content
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ Bugfixes
- An error that could arise when calling ``score`` on a ``SkrubLearner`` that
contains an inner transformer that has a ``score`` method has been fixed.
:pr:`2052` by :user:`Jérôme Dockès <jeromedockes>`.
- An error that could arise when running `TableReport` on dataframes containing
double dollar (`$$`) signs has been fixed.
:pr:`2154` by :user:`Katerina Michenina <Michenina-Lab>,
:user: `<CecilyTS>`,
:user: `Eve Rabin <eve2705>`.

Deprecations
------------
Expand Down
1 change: 1 addition & 0 deletions skrub/_reporting/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"boxplot.flierprops.color": _TEXT_COLOR_PLACEHOLDER,
"boxplot.flierprops.markeredgecolor": _TEXT_COLOR_PLACEHOLDER,
"boxplot.whiskerprops.color": _TEXT_COLOR_PLACEHOLDER,
"text.parse_math": False,
}


Expand Down
23 changes: 23 additions & 0 deletions skrub/tests/test_summarize_dataframe.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move the test case in in skrub/_reporting/tests/test_summarize.py?

something like this would work:

def test_dollar_sign(df_module):
    df = df_module.make_dataframe(
        {
            "text": [
                "hello world",
                "foo bar",
                "this is not latex $$ just a double dollar sign",
            ]
        }
    )
    summarize_dataframe(df, with_plots=True, title=None, verbose=0)

df_module is needed to make sure that the the tests run with both pandas and polars

then this file can be removed

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Minimal reproducer: does skrub crash on string columns containing '$$'?
Run with:
uv run repro_skrub_dollar_sign.py
"""

import pandas as pd

from skrub._reporting._summarize import summarize_dataframe

df = pd.DataFrame(
{
"text": [
"hello world",
"foo bar",
"this is not latex $$ just a double dolar sign",
]
}
)
try:
summarize_dataframe(df, with_plots=True, title=None, verbose=0)
print("PASS: no error")
except ValueError as e:
print(f"FAIL: {e}")
Loading