Skip to content

Commit d73d568

Browse files
committed
properly deprecate fields
1 parent 3cd6faa commit d73d568

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/nested_pandas/series/nestedseries.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import warnings
21
from functools import wraps
32

43
import pandas as pd
@@ -34,15 +33,14 @@ def __init__(self, *args, **kwargs):
3433

3534
@property
3635
@nested_only
36+
@deprecated(
37+
version="0.6.0",
38+
reason="The `fields` property is deprecated and will be removed in version 0.7.0,"
39+
"use `columns` instead.",
40+
)
3741
def fields(self):
3842
"""Returns the fields of the nested series as a list."""
39-
warnings.warn(
40-
"The `fields` property is deprecated and will be removed in a future release. "
41-
"Use the `columns` property instead.",
42-
DeprecationWarning,
43-
stacklevel=2, # Ensures the warning points to the caller
44-
)
45-
return self.nest.fields
43+
return self.columns
4644

4745
@property
4846
@nested_only

0 commit comments

Comments
 (0)