Skip to content

Commit d305c8e

Browse files
committed
remove nest_lists deprecation behavior
1 parent c9f0476 commit d305c8e

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/nested_pandas/nestedframe/core.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from __future__ import annotations
33

44
from collections import defaultdict
5-
from collections.abc import Callable, Sequence
5+
from collections.abc import Callable
66
from typing import Literal
77

88
import numpy as np
@@ -537,18 +537,6 @@ def nest_lists(self, columns: list[str], name: str) -> NestedFrame:
537537
2 3 6 [{e: 7}; …] (3 rows)
538538
"""
539539

540-
# Check if `name` is actually a list and `columns` is a string
541-
if isinstance(name, Sequence) and not isinstance(name, str) and isinstance(columns, str):
542-
warnings.warn(
543-
"DeprecationWarning: The argument order for `nest_lists` has changed: "
544-
"`nest_lists(name, columns)` is now `nest_lists(columns, name)`. "
545-
"Please update your code.",
546-
DeprecationWarning,
547-
stacklevel=2,
548-
)
549-
# Swap the arguments
550-
name, columns = columns, name
551-
552540
return NestedFrame.from_lists(self.copy(), list_columns=columns, name=name)
553541

554542
@classmethod

tests/nested_pandas/nestedframe/test_nestedframe.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,10 +2144,6 @@ def test_nest_lists():
21442144
with pytest.raises(ValueError):
21452145
ndf.nest_lists(columns=["c", "d"], name="nested")
21462146

2147-
# Test nest_lists ordering deprecation warning
2148-
with pytest.warns(DeprecationWarning):
2149-
res = ndf.nest_lists("nested", ["c", "b"])
2150-
21512147

21522148
def test_nestlists_nonunique_index():
21532149
"""Test that nest_lists works with a non-unique index."""

0 commit comments

Comments
 (0)