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

ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date) #52952

Merged
merged 9 commits into from
Apr 28, 2023

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added Error Reporting Incorrect or improved errors from pandas Arrow pyarrow functionality labels Apr 27, 2023
@mroeschke mroeschke added this to the 2.0.2 milestone Apr 27, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

looks fine, just wondering if there's a workaround which the error message could suggest? like, "convert to ??? first"?

@mroeschke
Copy link
Member Author

Good idea. I'll clarify that users should convert to timestamp type first

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @mroeschke

@mroeschke mroeschke merged commit d607694 into pandas-dev:main Apr 28, 2023
@mroeschke mroeschke deleted the err/arrow/to_pydatetime_date branch April 28, 2023 21:54
@lumberbot-app
Copy link

lumberbot-app bot commented Apr 28, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.0.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 d6076947c1839469714009e8c92a6edd191db983
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #52952: ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date)'
  1. Push to a named branch:
git push YOURFORK 2.0.x:auto-backport-of-pr-52952-on-2.0.x
  1. Create a PR against branch 2.0.x, I would have named this PR:

"Backport PR #52952 on branch 2.0.x (ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date))"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

mroeschke added a commit to mroeschke/pandas that referenced this pull request Apr 28, 2023
mroeschke added a commit that referenced this pull request Apr 29, 2023
…ime and ArrowDtype(pa.date) (#52989)

* Backport PR #52952: ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date)

* Update pandas/tests/extension/test_arrow.py
NumanIjaz pushed a commit to NumanIjaz/pandas that referenced this pull request May 1, 2023
…a.date) (pandas-dev#52952)

* ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date)

* Update pandas/tests/extension/test_arrow.py

* Add warning

* fix error message

* Suggest to convert to pyarrow timestamp type first
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 7, 2023
…a.date) (pandas-dev#52952)

* ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date)

* Update pandas/tests/extension/test_arrow.py

* Add warning

* fix error message

* Suggest to convert to pyarrow timestamp type first
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
…a.date) (pandas-dev#52952)

* ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date)

* Update pandas/tests/extension/test_arrow.py

* Add warning

* fix error message

* Suggest to convert to pyarrow timestamp type first
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
…a.date) (pandas-dev#52952)

* ERR: Raise a better error message with to_pydatetime and ArrowDtype(pa.date)

* Update pandas/tests/extension/test_arrow.py

* Add warning

* fix error message

* Suggest to convert to pyarrow timestamp type first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: to_pydatetime() -> 'pyarrow.lib.DataType' object has no attribute 'unit'
2 participants