E5DB ENH: Add use_nullable_dtypes for read_html by phofl · Pull Request #50286 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
phofl committed Dec 23, 2022
commit c7fb7dc5f104a69059ab3c71ef1bb82325b9f3bc
8 changes: 4 additions & 4 deletions pandas/tests/io/test_html.py
4431
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ def test_to_html_compat(self):
res = self.read_html(out, attrs={"class": "dataframe"}, index_col=0)[0]
tm.assert_frame_equal(res, df)

@pytest.mark.parametrize("nullable_backend", ["pandas", "pyarrow"])
@pytest.mark.parametrize("dtype_backend", ["pandas", "pyarrow"])
@pytest.mark.parametrize("storage", ["python", "pyarrow"])
def test_use_nullable_dtypes(self, storage, nullable_backend):
def test_use_nullable_dtypes(self, storage, dtype_backend):
# GH#50286
df = DataFrame(
{
Expand All @@ -166,7 +166,7 @@ def test_use_nullable_dtypes(self, storage, nullable_backend):

out = df.to_html(index=False)
with pd.option_context("mode.string_storage", storage):
with pd.option_context("mode.nullable_backend", nullable_backend):
with pd.option_context("mode.dtype_backend", dtype_backend):
result = self.read_html(out, use_nullable_dtypes=True)[0]

expected = DataFrame(
Expand All @@ -182,7 +182,7 @@ def test_use_nullable_dtypes(self, storage, nullable_backend):
}
)

if nullable_backend == "pyarrow":
if dtype_backend == "pyarrow":
import pyarrow as pa

from pandas.arrays import ArrowExtensionArray
Expand Down
0