-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Revert: REF: do length-checks in boilerplate decorator #34137
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
Hello @charlesdong1991! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-05-15 09:02:38 UTC |
pandas/core/arrays/timedeltas.py
Outdated
@@ -460,6 +460,10 @@ def __mul__(self, other): | |||
if not hasattr(other, "dtype"): | |||
# list, tuple | |||
other = np.array(other) | |||
if len(other) != len(self) and not is_timedelta64_dtype(other): |
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.
other -> other.dtype
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.
done, thanks!
small request, otherwise LGTM |
Can you add test(s) for the behavior that was broken in #34081 |
emm, something might have changed alongside, now after this revert pr, >>> pd.Index([('a', 'b'), ('b', 'c'), ('c', 'a')]) == ('c', 'a')
array([False, False, False]) it returns all False. @jbrockmendel any idea which PR recently merged could influence this? |
emm, not sure how on earth i could run get i could create a new issue to address this if you think is necessary. |
@charlesdong1991 I was also quite sure that I saw the correct behaviour in one of my environments, but also don't know where anymore. Now, looking at it on 1.0.3, the problem is that it is creating a MultiIndex, and not a plain index with tuples in it. Ensuring we get an Index, I actually get the correct behaviour:
(and this example also actually fails on master) |
yeah, indeed, the issue i saw is that in such case, it automatically recognises as a MI, not Index. @jorisvandenbossche thanks very much, I will add |
LGTM |
thanks @charlesdong1991 can you open a new issue to re-implement this (e.g. essentially a cleanup to revert the revert with appropriate changes). |
closes #34123
As discussed in #34123
let's revert this PR34081 first since it has potentially big impact on some cases in ops.
cc @jbrockmendel @jorisvandenbossche