Skip to content

TST: Add tests for old issues 2 #41493

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 13 commits into from
May 19, 2021
Merged

Conversation

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label May 15, 2021
@mroeschke mroeschke added this to the 1.3 milestone May 16, 2021
@simonjayhawkins
Copy link
Member

This does not yet close #14564, #14564 (comment)?

should maybe change that one to an xref

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

i would split #14564 patches to a separate PR (as per comment) and question above.

@pytest.mark.parametrize(
"dtype, expected_data, expected_index, axis, expected_dtype",
[
["datetime64[ns]", [], [], 1, "float64"],
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this expected float64?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point; I think this should be datetime64[ns]. Opened up #41544 related to this bug.

).stack()
result = df.to_json()
expected = (
"{\"(Timestamp('2017-01-20 00:00:00'), 'foo')\":true,"
Copy link
Contributor

Choose a reason for hiding this comment

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

woa, this is the expected?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe so; yes.

The result is similar to #15273 (comment) except I think it's correct that we retain the timestamp like object instead of converting to epoch timestamp

@jreback jreback added Groupby IO JSON read_json, to_json, json_normalize Nuisance Columns Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels May 17, 2021
@mroeschke
Copy link
Member Author

This does not yet close #14564, #14564 (comment)?

Sorry my comment was a little unclear. Our aggregation ops now support returning datetime64[ns] now so returning NaT should be expected here as mentioned in the original issue

  1. Empty frame with datetime values

df = DataFrame(columns=['a', 'b'], dtype='datetime64')
df.quantile(0.5, numeric_only=False)

On 0.18.1 / master, it gives a series of NaNs, where this should be NaTs:

In [13]: df.quantile(0.5, numeric_only=False)
Out[13]:
a NaN
b NaN
Name: 0.5, dtype: float64

@jreback jreback merged commit a246270 into pandas-dev:master May 19, 2021
@jreback
Copy link
Contributor

jreback commented May 19, 2021

thanks @mroeschke

@mroeschke mroeschke deleted the testing/old_issues2 branch May 19, 2021 17:25
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Groupby IO JSON read_json, to_json, json_normalize Nuisance Columns Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply Reshaping Concat, Merge/Join, Stack/Unstack, Explode Testing pandas testing functions or related to the test suite
Projects
None yet
4 participants