Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message if columns are not found #637

Closed
lars-reimann opened this issue Apr 22, 2024 · 2 comments · Fixed by #758
Closed

Improve error message if columns are not found #637

lars-reimann opened this issue Apr 22, 2024 · 2 comments · Fixed by #758
Assignees
Labels
enhancement 💡 New feature or request good first issue Good for newcomers released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Apr 22, 2024

Is your feature request related to a problem?

Currently, if multiple columns are missing, it's difficult to associate the columns to the suggestions:

Could not find column(s) 'port_embarked1, fare1'.
Did you mean '['port_embarked', 'name', 'age', 'fare']'?

Desired solution

Instead, write the error message like this:

Could not find column(s):
    - 'port_embarked1': Did you mean ['port_embarked']? 
    - 'fare1': Did you mean ['name', 'age', 'fare']?

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Apr 22, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Library Apr 22, 2024
@lars-reimann lars-reimann added the good first issue Good for newcomers label Apr 24, 2024
@lars-reimann
Copy link
Member Author

Related to #407.

@lars-reimann lars-reimann self-assigned this May 7, 2024
lars-reimann added a commit that referenced this issue May 13, 2024
Closes #407
Closes #637

### Summary of Changes

* New internal function `_check_bounds` to check whether a value is in
some interval or raise an `OutofBoundsError`. Now, bounds only need to
be specified once instead of twice (if + when raising).
* New internal function `_check_columns_exist` to check whether a column
with a given name exists or raise an `ColumnNotFoundError`. Now, we get
consistent error messages with suggestions of similar column names.

---------

Co-authored-by: megalinter-bot <[email protected]>
@github-project-automation github-project-automation bot moved this from Backlog to ✔️ Done in Library May 13, 2024
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request good first issue Good for newcomers released Included in a release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant