Skip to content

Commit 0b08e42

Browse files
authored
missing fields AE fix (#322)
1 parent 59a68a4 commit 0b08e42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

convokit/model/corpus.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,9 +1548,10 @@ def from_pandas(
15481548
df["id"] = df.index
15491549

15501550
# checking if dataframes contain their respective required columns
1551+
missing_fields = pd.Index(columns).difference(utterances_df.columns)
15511552
assert (
1552-
pd.Series(columns).isin(utterances_df.columns).all()
1553-
), "Utterances dataframe must contain all primary data fields"
1553+
len(missing_fields) == 0
1554+
), f"Utterances dataframe is missing the following required fields: {list(missing_fields)}"
15541555

15551556
utterance_meta_cols = extract_meta_from_df(utterances_df)
15561557

0 commit comments

Comments
 (0)