1111from skrub import TableReport , ToDatetime , datasets
1212from skrub import _dataframe as sbd
1313from skrub ._reporting ._sample_table import make_table
14+ from skrub .conftest import polars_installed_without_pyarrow
1415
1516
1617def get_report_id (html ):
1718 return re .search (r'<skrub-table-report.*?id="report_([a-z0-9]+)"' , html ).group (1 )
1819
1920
20- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
21+ @polars_installed_without_pyarrow
2122def test_report (air_quality ):
2223 col_filt = {
2324 "first_2" : {
@@ -65,13 +66,13 @@ def test_report(air_quality):
6566 assert len (all_report_ids ) == len (set (all_report_ids ))
6667
6768
68- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
69+ @polars_installed_without_pyarrow
6970def test_few_columns (df_module , check_polars_numpy2 ):
7071 report = TableReport (df_module .example_dataframe )
7172 assert "First 10 columns" not in report .html ()
7273
7374
74- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
75+ @polars_installed_without_pyarrow
7576def test_few_rows (df_module , check_polars_numpy2 ):
7677 df = sbd .slice (df_module .example_dataframe , 2 )
7778 TableReport (df ).html ()
@@ -87,15 +88,15 @@ def test_open(pd_module, browser_mock):
8788 assert b"the title" in browser_mock .content
8889
8990
90- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
91+ @polars_installed_without_pyarrow
9192def test_non_hashable_values (df_module ):
9293 # non-regression test for #1066
9394 df = df_module .make_dataframe (dict (a = [[1 , 2 , 3 ], None , [4 ]]))
9495 html = TableReport (df ).html ()
9596 assert "[1, 2, 3]" in html
9697
9798
98- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
99+ @polars_installed_without_pyarrow
99100def test_nat (df_module ):
100101 # non-regression for:
101102 # https://github.com/skrub-data/skrub/issues/1111
@@ -114,7 +115,7 @@ def test_duplicate_columns(pd_module):
114115 TableReport (df ).html ()
115116
116117
117- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
118+ @polars_installed_without_pyarrow
118119def test_infinite_values (df_module ):
119120 # Non-regression for https://github.com/skrub-data/skrub/issues/1134
120121 # (histogram plot failing with infinite values)
@@ -128,7 +129,7 @@ def test_infinite_values(df_module):
128129 TableReport (df ).html ()
129130
130131
131- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
132+ @polars_installed_without_pyarrow
132133def test_duration (df_module ):
133134 df = df_module .make_dataframe (
134135 {"a" : [datetime .timedelta (days = 2 ), datetime .timedelta (days = 3 )]}
@@ -187,7 +188,7 @@ def test_write_html_with_not_utf8_encoding(tmp_path, pd_module):
187188 assert "</html>" not in saved_content
188189
189190
190- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
191+ @polars_installed_without_pyarrow
191192def test_verbosity_parameter (df_module , capsys ):
192193 df = df_module .make_dataframe (
193194 dict (
@@ -210,7 +211,7 @@ def test_verbosity_parameter(df_module, capsys):
210211 assert capsys .readouterr ().err != ""
211212
212213
213- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
214+ @polars_installed_without_pyarrow
214215def test_write_to_stderr (df_module , capsys ):
215216 df = df_module .make_dataframe (
216217 dict (
@@ -231,7 +232,7 @@ def test_write_to_stderr(df_module, capsys):
231232 assert re .search (pattern , captured .err )
232233
233234
234- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
235+ @polars_installed_without_pyarrow
235236def test_max_plot_columns_parameter (df_module ):
236237 df = df_module .make_dataframe (
237238 {f"col_{ i } " : [i + j for j in range (3 )] for i in range (10 )}
@@ -291,7 +292,7 @@ def test_error_input_type():
291292 TableReport (df )
292293
293294
294- @pytest . mark . skipif ( _PYARROW_INSTALLED = False , reason = "requires pyarrow to be installed" )
295+ @polars_installed_without_pyarrow
295296def test_single_column_report (df_module ):
296297 # Check that single column report works
297298 single_col = df_module .example_column
0 commit comments