Skip to content

CLN: remove unnecessary Series._convert calls #32949

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
Apr 10, 2020

Conversation

jbrockmendel
Copy link
Member

cc @WillAyd my confidence on the correctness here is only "pretty sure", so could use an extra set of eyes.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Definitely a more logical way to do things

@@ -1342,14 +1342,10 @@ def first_not_none(values):

# values are not series or array-like but scalars
else:
# only coerce dates if we find at least 1 datetime
should_coerce = any(isinstance(x, Timestamp) for x in values)
Copy link
Member

Choose a reason for hiding this comment

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

Does this change behaviour?

@@ -386,7 +386,7 @@ def _wrap_aggregated_output(
result = self._wrap_series_output(
output=output, index=self.grouper.result_index
)
return self._reindex_output(result)._convert(datetime=True)
return self._reindex_output(result)
Copy link
Member

Choose a reason for hiding this comment

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

Do you have an explanation of why this is not needed anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, just an observation that we dont have any tests that break without it.

@jreback jreback added Clean Dtype Conversions Unexpected or buggy dtype conversions labels Mar 24, 2020
@jreback jreback added this to the 1.1 milestone Mar 24, 2020
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.

this is all fine. these were put in years ago when we didn't coerce back to datetimes for example oftentimes.

@jreback
Copy link
Contributor

jreback commented Mar 26, 2020

@jorisvandenbossche

@jorisvandenbossche
Copy link
Member

Brock, can you respond to my comments?

@jreback
Copy link
Contributor

jreback commented Apr 7, 2020

can you merge master, this looks ok. I guess @jorisvandenbossche has some comments

@jreback
Copy link
Contributor

jreback commented Apr 10, 2020

this is fine

@jreback jreback merged commit be86b65 into pandas-dev:master Apr 10, 2020
@jbrockmendel jbrockmendel deleted the cln-_convert branch April 10, 2020 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants