-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Brock, can you respond to my comments? |
can you merge master, this looks ok. I guess @jorisvandenbossche has some comments |
this is fine |
cc @WillAyd my confidence on the correctness here is only "pretty sure", so could use an extra set of eyes.