Skip to content

Conversation

@mjgaughan
Copy link
Contributor

Description

This change updates the AssertionError that fails when users import utterances with missing fields. Previously, the AE just told the user that SOME fields were missing without specifying which fields were missing. This change provides the users with a list of missing fields upon AE failure, implemented by slightly changing the assertion itself.

Motivation and Context

It provides users with specific information to aid correct usage of the program. It addresses Issue #275 and is a feature enhancement.

How has this been tested?

Pre-commit formatting. Neglected some integration testing given that it's a small change on an error message. Happy to revisit testing if maintainers think that it warrants more scrutiny.

pd.Series(columns).isin(utterances_df.columns).all()
), "Utterances dataframe must contain all primary data fields"
len(missing_fields) == 0
), f"Utterances dataframe is missing the following required fields: {missing_fields}"
Copy link
Collaborator

@ethanxia4 ethanxia4 Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use list(missing_fields) in assert error for slightly more readable formatting, other than that works great

@mjgaughan
Copy link
Contributor Author

@ethanxia4 just updated w/ list(missing_fields); lmk if there's anything else! thanks

@ethanxia4
Copy link
Collaborator

looks good!

@ethanxia4 ethanxia4 merged commit 0b08e42 into CornellNLP:master Oct 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants