Skip to content

Commit 13e976a

Browse files
committed
Added a test for Styler.bar with pyarrow
1 parent 33e6035 commit 13e976a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/io/formats/style/test_bar.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import numpy as np
22
import pytest
3+
import io
34

45
from pandas import (
56
NA,
67
DataFrame,
8+
read_csv,
79
)
810

911
pytest.importorskip("jinja2")
@@ -341,3 +343,15 @@ def test_styler_bar_with_NA_values():
341343
html_output2 = df2.style.bar(align="left", axis=None).to_html()
342344
assert expected_substring in html_output1
343345
assert expected_substring in html_output2
346+
347+
348+
def test_style_bar_with_pyarrow_NA_values():
349+
data = '''name,age,test1,test2,teacher
350+
Adam,15,95.0,80,Ashby
351+
Bob,16,81.0,82,Ashby
352+
Dave,16,89.0,84,Jones
353+
Fred,15,,88,Jones'''
354+
df = read_csv(io.StringIO(data), dtype_backend="pyarrow")
355+
expected_substring = "style type="
356+
html_output = df.style.bar(subset="test1").to_html()
357+
assert expected_substring in html_output

0 commit comments

Comments
 (0)