Skip to content

TST: GH 27185 Test to check df with timedelta & Int NA sums correctly #47354

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 3 commits into from
Jun 23, 2022

Conversation

aamnv
Copy link
Contributor

@aamnv aamnv commented Jun 14, 2022

Open to feedback on how to improve the PR - not sure if this is exactly what the original issue was looking for.

df = DataFrame(
{
"A": Series([1, 2, None], dtype="timedelta64[ns]"),
"B": Series([1, 2, None], dtype="Int64"),
Copy link
Member

Choose a reason for hiding this comment

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

Could you use NaT and NA instead of None?

)

result = df.sum()
assert result["A"] == Timedelta(3, "ns")
Copy link
Member

Choose a reason for hiding this comment

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

Please check the whole result object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed new commit w/ the changes requested - let me know what you think!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey @phofl just checking in to see if there's anything I should update in the PR?

@datapythonista datapythonista added Testing pandas testing functions or related to the test suite Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Timedelta Timedelta data type labels Jun 16, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jun 23, 2022
@mroeschke mroeschke merged commit bc40a4a into pandas-dev:main Jun 23, 2022
@mroeschke
Copy link
Member

Thanks @aamnv

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
…pandas-dev#47354)

* TST: GH 27185 Adding test to check df with timedelta and int obj sums as expected

* TST: updating the test with nan NaT and check whole object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Testing pandas testing functions or related to the test suite Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame.sum() with mix of timedelta and IntegerNA returns NA for IntNA
4 participants