-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
STYLE: turn off PLW2901 (but keep some changes) #52262
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
Changes from 2 commits
61fad93
fc7a8d8
7bbbdb5
fb81fc0
33b6b7f
73218fa
d561fbe
f30d802
7807b06
56ed5aa
a7749e9
c0f4be5
5d3ca8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1379,10 +1379,10 @@ def relabel_result( | |
# mean 1.5 | ||
# mean 1.5 | ||
if reorder_mask: | ||
fun = [ | ||
fun_name = [ | ||
com.get_callable_name(f) if not isinstance(f, str) else f for f in fun | ||
] | ||
col_idx_order = Index(s.index).get_indexer(fun) | ||
col_idx_order = Index(s.index).get_indexer(fun_name) | ||
s = s[col_idx_order] | ||
|
||
# assign the new user-provided "named aggregation" as index names, and reindex | ||
|
@@ -1421,14 +1421,16 @@ def _managle_lambda_list(aggfuncs: Sequence[Any]) -> Sequence[Any]: | |
if len(aggfuncs) <= 1: | ||
# don't mangle for .agg([lambda x: .]) | ||
return aggfuncs | ||
i = 0 | ||
|
||
mangled_aggfuncs = [] | ||
for aggfunc in aggfuncs: | ||
if com.get_callable_name(aggfunc) == "<lambda>": | ||
aggfunc = partial(aggfunc) | ||
aggfunc.__name__ = f"<lambda_{i}>" | ||
i += 1 | ||
mangled_aggfuncs.append(aggfunc) | ||
for idx, aggfunc in enumerate(aggfuncs): | ||
if not com.get_callable_name(aggfunc) == "<lambda>": | ||
mangled_aggfuncs.append(aggfunc) | ||
continue | ||
|
||
partial_aggfunc = partial(aggfunc) | ||
partial_aggfunc.__name__ = f"<lambda_{idx}>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, I don't think the logic is right here, please try to keep the logic the same as the original There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original one was:
I removed the variable |
||
mangled_aggfuncs.append(partial_aggfunc) | ||
|
||
return mangled_aggfuncs | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1099,7 +1099,7 @@ def _range_from_fields( | |
freqstr = freq.freqstr | ||
year, quarter = _make_field_arrays(year, quarter) | ||
for y, q in zip(year, quarter): | ||
y, m = parsing.quarter_to_myear(y, q, freqstr) | ||
_, m = parsing.quarter_to_myear(y, q, freqstr) | ||
val = libperiod.period_ordinal(y, m, 1, 1, 1, 1, 0, 0, base) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this doesn't look right There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad, indeed the variable |
||
ordinals.append(val) | ||
else: | ||
|
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.
not sure we can do this,
fun
is still used below