Skip to content

Commit

Permalink
tab_dict initialization bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SongminYu committed Jan 22, 2024
1 parent edcc367 commit 291fc8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tab2dict/tab_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def __init__(
super().__init__()
self.tdict_type = tdict_type
self.key_cols = key_cols
if tdict_type == "Relation":
self.key_cols = key_cols[:-1]
self._data = tdict_data

def __len__(self):
Expand Down Expand Up @@ -57,6 +55,8 @@ def from_dataframe(
df=df,
value_column_name=value_column_name,
)
if tdict_type == "Relation":
del key_cols[-1]
return cls(tdict_type=tdict_type, key_cols=key_cols, tdict_data=tdict_data)

@classmethod
Expand Down

0 comments on commit 291fc8b

Please sign in to comment.