Skip to content

Commit dd9c8f9

Browse files
committed
Remove unnecessary original_on variable
https://claude.ai/code/session_01F7cbsuGUbfDoW1oDdiGqf5
1 parent 56812d6 commit dd9c8f9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/nested_pandas/series/packer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def pack_flat(
9393
nested_pandas.series.dtype.NestedDtype : The dtype of the output series.
9494
nested_pandas.series.packer.pack_lists : Pack a dataframe of nested arrays.
9595
"""
96-
original_on = on
9796
if on is not None:
9897
df = df.set_index(on)
9998
# pandas knows when index is pre-sorted, so it would do nothing if it is already sorted
@@ -103,8 +102,8 @@ def pack_flat(
103102
except ValueError:
104103
# Check if the error is due to NaN values and raise a more informative message
105104
if any(sorted_flat.index.get_level_values(i).hasnans for i in range(sorted_flat.index.nlevels)):
106-
if original_on is not None:
107-
cols = [original_on] if isinstance(original_on, str) else list(original_on)
105+
if on is not None:
106+
cols = [on] if isinstance(on, str) else list(on)
108107
raise ValueError(
109108
f"Column(s) {cols} contain NaN values. "
110109
"NaN values are not supported because they cannot be used for grouping rows. "

0 commit comments

Comments
 (0)