Skip to content

WARN: PerformanceWarning for non-pyarrow fallback #46732

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

Merged
merged 15 commits into from
Apr 18, 2022

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Apr 10, 2022

@mroeschke mroeschke added Warnings Warnings that appear or should be added to pandas Arrow pyarrow functionality labels Apr 10, 2022
@mroeschke mroeschke added this to the 1.5 milestone Apr 10, 2022
@@ -95,6 +95,7 @@ Other enhancements
- :meth:`pd.concat` now raises when ``levels`` is given but ``keys`` is None (:issue:`46653`)
- :meth:`pd.concat` now raises when ``levels`` contains duplicate values (:issue:`46653`)
- Added ``numeric_only`` argument to :meth:`DataFrame.corr`, :meth:`DataFrame.corrwith`, and :meth:`DataFrame.cov` (:issue:`46560`)
- A :class:`errors.PerformanceWarning` is now thrown when using with ``string[pyarrow]`` dtype with methods that don't dispatch to ``pyarrow.compute`` methods (:issue:`42613`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"when using with" is awkward. supposed to be "when using XYZ with"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, changed

@@ -331,6 +333,7 @@ def _maybe_convert_setitem_value(self, value):

def isin(self, values):
if pa_version_under2p0:
fallback_performancewarning(version="2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check that we are producing this in tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this now with tm.assert_produces_warning

@mroeschke mroeschke marked this pull request as draft April 10, 2022 22:04
@mroeschke mroeschke marked this pull request as ready for review April 11, 2022 02:01
@jreback
Copy link
Contributor

jreback commented Apr 11, 2022

hmm lots of warnings not being caught

pandas/tests/strings/test_find_replace.py::test_contains_moar[string[pyarrow]]
/home/runner/work/pandas/pandas/pandas/tests/strings/test_find_replace.py:182: PerformanceWarning: Falling back on a non-pyarrow code path which may decrease performance. Upgrade to pyarrow >=4 to possibly suppress this warning.
result = s.str.contains("a")

@pep8speaks
Copy link

pep8speaks commented Apr 12, 2022

Hello @mroeschke! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-04-14 01:47:43 UTC

@jreback jreback merged commit 6d16567 into pandas-dev:main Apr 18, 2022
@mroeschke mroeschke deleted the performancewarn/pyarrow branch April 18, 2022 22:33
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PyArrow StringDtype / StringArray fallback policy
4 participants