Skip to content

Incorrectly raised SchemaError when validating multiindex DataFrame #1134

Answered by cosmicBboy
ErikLundin98 asked this question in Q&A
Discussion options

You must be logged in to vote

So unfortunately pandas 1.3.5 has a bunch of issues with index data types... see this StringDtype xfail test as an example:

def test_index_validation_pandas_string_dtype():
"""Test that pandas string type is correctly validated."""
if pandas_version().release <= (1, 3, 5):
pytest.xfail(
"pd.StringDtype is not supported in the pd.Index in pandas<=1.3.5"
)
schema = DataFrameSchema(
columns={"data": Column(int)},
index=Index(pd.StringDtype(), name="uid"),
)
df = pd.DataFrame(
{"data": range(2)},
index=pd.Index(["one", "two"], dtype=pd.S…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cosmicBboy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1131 on March 22, 2023 14:18.