Skip to content

Commit 27c9fbe

Browse files
author
miranov25
committed
* adding protection for infinite recursion
1 parent 67e3699 commit 27c9fbe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

UTILS/dfextensions/AliasDataFrame.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ class AliasDataFrame:
7676
on top of a pandas DataFrame, including nested subframes with hierarchical indexing.
7777
"""
7878
def __init__(self, df):
79+
if not isinstance(df, pd.DataFrame):
80+
raise TypeError(
81+
f"AliasDataFrame must be initialized with a pandas.DataFrame. "
82+
f"Received type: {type(df)}"
83+
)
7984
self.df = df
8085
self.aliases = {}
8186
self.alias_dtypes = {}

0 commit comments

Comments
 (0)