Skip to content

Commit 17da75e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into json-fix-normalize
2 parents 3f54cd3 + 094b2c0 commit 17da75e

File tree

12 files changed

+13
-14
lines changed

12 files changed

+13
-14
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repos:
2626
hooks:
2727
- id: codespell
2828
types_or: [python, rst, markdown]
29+
additional_dependencies: [tomli]
2930
- repo: https://github.com/MarcoGorelli/cython-lint
3031
rev: v0.2.1
3132
hooks:

doc/source/user_guide/style.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"source": [
7777
"# Hidden cell to just create the below example: code is covered throughout the guide.\n",
7878
"s = df.style\\\n",
79-
" .hide_columns([('Random', 'Tumour'), ('Random', 'Non-Tumour')])\\\n",
79+
" .hide([('Random', 'Tumour'), ('Random', 'Non-Tumour')], axis='columns')\\\n",
8080
" .format('{:.0f}')\\\n",
8181
" .set_table_styles([{\n",
8282
" 'selector': '',\n",
@@ -1339,7 +1339,7 @@
13391339
" for series in [test1,test2,test3, test4]:\n",
13401340
" s = series.copy()\n",
13411341
" s.name=''\n",
1342-
" row += \"<td>{}</td>\".format(s.to_frame().style.hide_index().bar(align=align, \n",
1342+
" row += \"<td>{}</td>\".format(s.to_frame().style.hide(axis='index').bar(align=align, \n",
13431343
" color=['#d65f5f', '#5fba7d'], \n",
13441344
" width=100).to_html()) #testn['width']\n",
13451345
" row += '</tr>'\n",

doc/source/whatsnew/v1.5.3.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Fixed regressions
1616
- Fixed performance regression in :meth:`Series.isin` when ``values`` is empty (:issue:`49839`)
1717
- Fixed regression in :meth:`DataFrameGroupBy.transform` when used with ``as_index=False`` (:issue:`49834`)
1818
- Enforced reversion of ``color`` as an alias for ``c`` and ``size`` as an alias for ``s`` in function :meth:`DataFrame.plot.scatter` (:issue:`49732`)
19+
- Fixed regression in :meth:`SeriesGroupBy.apply` setting a ``name`` attribute on the result if the result was a :class:`DataFrame` (:issue:`49907`)
1920
-
2021

2122
.. ---------------------------------------------------------------------------

pandas/_testing/asserters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ def assert_series_equal(
877877
)
878878

879879
if check_like:
880-
left, right = left.reindex_like(right), right
880+
left = left.reindex_like(right)
881881

882882
if check_freq and isinstance(left.index, (DatetimeIndex, TimedeltaIndex)):
883883
lidx = left.index
@@ -1159,7 +1159,7 @@ def assert_frame_equal(
11591159
)
11601160

11611161
if check_like:
1162-
left, right = left.reindex_like(right), right
1162+
left = left.reindex_like(right)
11631163

11641164
# compare by blocks
11651165
if by_blocks:

pandas/core/groupby/generic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ def _wrap_applied_output(
401401
not_indexed_same=not_indexed_same,
402402
is_transform=is_transform,
403403
)
404-
result.name = self.obj.name
404+
if isinstance(result, Series):
405+
result.name = self.obj.name
405406
return result
406407
else:
407408
# GH #6265 #24880

pandas/core/indexes/datetimelike.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ def _wrap_range_setop(self, other, res_i8):
446446
new_freq = self.freq
447447
elif isinstance(res_i8, RangeIndex):
448448
new_freq = to_offset(Timedelta(res_i8.step))
449-
res_i8 = res_i8
450449

451450
# TODO(GH#41493): we cannot just do
452451
# type(self._data)(res_i8.values, dtype=self.dtype, freq=new_freq)

pandas/tests/groupby/test_apply.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ def f(piece):
334334
result = grouped.apply(f)
335335

336336
assert isinstance(result, DataFrame)
337+
assert not hasattr(result, "name") # GH49907
337338
tm.assert_index_equal(result.index, ts.index)
338339

339340

pandas/tests/indexes/multi/test_reindex.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def test_reindex_lvl_preserves_type_if_target_is_empty_list_or_array():
9090

9191

9292
def test_reindex_base(idx):
93-
idx = idx
9493
expected = np.arange(idx.size, dtype=np.intp)
9594

9695
actual = idx.get_indexer(idx)

pandas/tests/indexes/multi/test_take.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def test_take(idx):
1818

1919

2020
def test_take_invalid_kwargs(idx):
21-
idx = idx
2221
indices = [1, 2]
2322

2423
msg = r"take\(\) got an unexpected keyword argument 'foo'"

pandas/tests/reshape/merge/test_merge_asof.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def test_basic_left_index(self, trades, asof, quotes):
210210
def test_basic_right_index(self, trades, asof, quotes):
211211

212212
expected = asof
213-
trades = trades
214213
quotes = quotes.set_index("time")
215214

216215
result = merge_asof(

0 commit comments

Comments
 (0)