Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-46927][PYTHON] Make assertDataFrameEqual work properly without PyArrow #44960

Closed
wants to merge 1 commit into from

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Jan 31, 2024

What changes were proposed in this pull request?

This PR proposes to fix assertDataFrameEqual to work properly without PyArrow

Why are the changes needed?

The current way does not work properly without PyArrow.

Does this PR introduce any user-facing change?

assertDataFrameEqual will raise proper error without PyArrow.

Before

>>> from pyspark.testing.utils import assertDataFrameEqual
>>> dict1 = {"a": 1, "b": 2}
>>> dict2 = {"a": 1, "b": 2}
>>> assertDataFrameEqual(dict1, dict2)
AttributeError: 'dict' object has no attribute 'schema'

After

>>> from pyspark.testing.utils import assertDataFrameEqual
>>> dict1 = {"a": 1, "b": 2}
>>> dict2 = {"a": 1, "b": 2}
>>> assertDataFrameEqual(dict1, dict2)
pyspark.errors.exceptions.base.PySparkAssertionError: [INVALID_TYPE_DF_EQUALITY_ARG] Expected type Union[DataFrame, ps.DataFrame, List[Row]] for `actual` but got type <class 'dict'>.

How was this patch tested?

UT

Was this patch authored or co-authored using generative AI tooling?

No.

@HyukjinKwon
Copy link
Member

Merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants