Skip to content

BUG: This fixes #55009 (raw=True caused apply method of DataFrame to ignore passed arguments) #55089

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 9 commits into from
Sep 13, 2023

Conversation

martin-sicho
Copy link
Contributor

@martin-sicho martin-sicho commented Sep 11, 2023

This should fix #55009. I documented the fix and also added some code to the tests that should pick it up next time.

Unfortunately, I was not able to run the tests manually yet with this error:

ImportError while loading conftest.
__init__.py:46: in <module>
    from pandas.core.api import (
core/api.py:1: in <module>
    from pandas._libs import (
_libs/__init__.py:16: in <module>
    import pandas._libs.pandas_parser  # noqa: E501 # isort: skip # type: ignore[reportUnusedImport]
E   ModuleNotFoundError: No module named 'pandas._libs.pandas_parser'

I probably do not have something properly installed. So let me know if I should run them in addition to what is done on the CI pipelines.

Checklist

@mroeschke mroeschke added the Apply Apply, Aggregate, Transform, Map label Sep 11, 2023
@mroeschke
Copy link
Member

pre-commit.ci autofix

@mroeschke mroeschke merged commit 4e28925 into pandas-dev:main Sep 13, 2023
@mroeschke
Copy link
Member

Thanks @martin-sicho

@mroeschke mroeschke added this to the 2.2 milestone Sep 13, 2023
hedeershowk pushed a commit to hedeershowk/pandas that referenced this pull request Sep 20, 2023
… `DataFrame` to ignore passed arguments) (pandas-dev#55089)

* fixes pandas-dev#55009

* update documentation

* write documentation

* add test

* change formatting

* cite DataDrame directly in docs

Co-authored-by: Matthew Roeschke <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
hedeershowk pushed a commit to hedeershowk/pandas that referenced this pull request Sep 20, 2023
… `DataFrame` to ignore passed arguments) (pandas-dev#55089)

* fixes pandas-dev#55009

* update documentation

* write documentation

* add test

* change formatting

* cite DataDrame directly in docs

Co-authored-by: Matthew Roeschke <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@auderson
Copy link
Contributor

@​mroeschke Hi, could you please consider making this fix available sooner, perhaps in the next patch release? I believe that using .apply with raw=True is a commonly used pattern. If this fix is to be included in version 2.2 which is scheduled for December, it could potentially affect the usability of pandas 2.1.x for some users.

mroeschke added a commit that referenced this pull request Sep 27, 2023
* add pyarrow autogenerated prefix

* whats new bug fix

* test with no head and pyarrow

* only test pyarrow

* BUG: This fixes #55009 (`raw=True` caused `apply` method of `DataFrame` to ignore passed arguments) (#55089)

* fixes #55009

* update documentation

* write documentation

* add test

* change formatting

* cite DataDrame directly in docs

Co-authored-by: Matthew Roeschke <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* PR review feedback

* Update doc/source/whatsnew/v2.2.0.rst

Co-authored-by: Matthew Roeschke <[email protected]>

* alphabetical whatsnew

---------

Co-authored-by: Martin Šícho <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: The DataFrame.apply method does not use the extra argument list when raw=True
3 participants