-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
DEPR/BUG: Do not ignore sort in concat for DatetimeIndex #62843
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
DEPR/BUG: Do not ignore sort in concat for DatetimeIndex #62843
Conversation
|
@jbrockmendel - this is ready for a look. I still need to look more into the internal usages of |
I'm fine with this. Though seeing the increased complexity, I'd also be OK with the previous PR's breaking change approach. |
|
I've reviewed all of pandas' internal usages of |
|
LGTM pending #62954 |
|
thanks @rhshadrach |
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.Continuation of #62752
There are three things I'd like to accomplish here:
sort=Falseget an unsorted result. This is a bug and should be fixed without deprecation.sortdo not get a change in behavior, but will get warned when enforcing the deprecation will change behavior.concatdoes not break user code.It seems (3) will be very hard to ascertain. There are many places where
concatis used without specifyingsortbut (a) the index cannot be Datetime or (b) alignment has already been done sosorthas no impact. I plan to take a deeper look into internal usage to see if this deprecation can impact other parts of the API, I've so far only found one in groupby.shift that I think we can call a bug.To accomplish these, it seems to me that we need to do a somewhat expensive check to see if not sorting impacts the result as otherwise users will get many spurious warnings.