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

TST: div/truediv with PyArrow duration types #54315

Closed
phofl opened this issue Jul 30, 2023 · 9 comments · Fixed by #54327 or #58188
Closed

TST: div/truediv with PyArrow duration types #54315

phofl opened this issue Jul 30, 2023 · 9 comments · Fixed by #54327 or #58188
Assignees
Labels
Arrow pyarrow functionality good first issue Timedelta Timedelta data type

Comments

@phofl
Copy link
Member

phofl commented Jul 30, 2023

Looks like they implemented __truediv__ for more types.

https://github.com/pandas-dev/pandas/actions/runs/5707046701/job/15463354529

@phofl phofl added CI Continuous Integration Dependencies Required and optional dependencies labels Jul 30, 2023
@lithomas1 lithomas1 added this to the 2.1 milestone Jul 31, 2023
@mroeschke mroeschke reopened this Jul 31, 2023
@mroeschke mroeschke changed the title PyArrow nightlies broke CI TST: div/truediv with PyArrow duration types Jul 31, 2023
@mroeschke
Copy link
Member

#54327 doesn't not effectively compare the result to the equivalent numpy operation because pd.Timedelta / pd.NA raises a TypeError. Would be good to have dedicated tests for this

@mroeschke mroeschke added Timedelta Timedelta data type good first issue Arrow pyarrow functionality and removed CI Continuous Integration Dependencies Required and optional dependencies labels Jul 31, 2023
@prasad-yashdeep
Copy link

take

@lithomas1 lithomas1 removed this from the 2.1 milestone Aug 22, 2023
@AdventurousDataScientist

Hi @prasad-yashdeep are you still working on this?

@ccccjone
Copy link
Contributor

take

@droussea2001
Copy link
Contributor

Hello @ccccjone are you still working on it ?

@ccccjone ccccjone removed their assignment Mar 12, 2024
@ccccjone
Copy link
Contributor

Hello @ccccjone are you still working on it ?

Hi @droussea2001, I've unassigned myself from this issue. Please feel free to take it on.

@droussea2001
Copy link
Contributor

Ok thanks !

@droussea2001
Copy link
Contributor

take

@droussea2001
Copy link
Contributor

Hello,

I am a total beginner in open source and I am not sure to understand the issue. :-)

If my understanding is correct the issue appears from the following test functions:

- test_arith_series_with_scalar
- test_arith_frame_with_scalar
- test_arith_series_with_array

"#54327 doesn't not effectively compare the result to the equivalent numpy operation because pd.Timedelta / pd.NA raises a TypeError" because:
_get_arith_xfail_marker set a pytest xfail with a TypeError before the operation (further in floordiv_compat)

So the trick would be to:

  • desactivate the xfail in _get_arith_xfail_marker for specific "COMPAT: Pyarrow supports div with duration #54327 div / truediv operations
  • set a correct exception in the _get_expected_exception function called by check_opname
  • consequently pytest.raises(exc) in _check_op would catch the correct exception

@mroeschke: is it correct ?

Thanks in advance,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality good first issue Timedelta Timedelta data type
Projects
None yet
7 participants