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

Replace general exceptions with a specific ones #3337

Closed
suhaibmujahid opened this issue Mar 8, 2023 · 5 comments · Fixed by #3339
Closed

Replace general exceptions with a specific ones #3337

suhaibmujahid opened this issue Mar 8, 2023 · 5 comments · Fixed by #3339
Labels
good-first-bug Good for newcomers

Comments

@suhaibmujahid
Copy link
Member

More details here: https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/broad-exception-raised.html

Example of a general exception that should be replaced:

raise Exception(f"Unexpected feature type for: {full_feature_name}")

The goal is to replace all general exceptions, not only in the model.py file.

@suhaibmujahid suhaibmujahid added the good-first-bug Good for newcomers label Mar 8, 2023
@prernadabi23
Copy link
Contributor

@suhaibmujahid Please assign this issue to me, I would like to work on it.

@Emeka-Onwuepe
Copy link
Contributor

@suhaibmujahid I am a bit curious, the get_feature_names method in the Model Class will always return an empty list. Is this the ideal implementation?

@suhaibmujahid
Copy link
Member Author

@suhaibmujahid Please assign this issue to me, I would like to work on it.

You do not need to ask. Please start by reading #1092

@suhaibmujahid I am a bit curious, the get_feature_names method in the Model Class will always return an empty list. Is this the ideal implementation?

The get_feature_names() will not be called directly; it is a placeholder that will be overridden. Alternatively, returning an empty list could be replaced by raisingNotImplementedError.

However, this question is off-topic. For simmiler questions, you could open a new issue, use Discussions or chat with us in the bugbug Matrix room.

@Emeka-Onwuepe
Copy link
Contributor

Thanks for the reply and the corrections are duly noted.

@Munaelekwa
Copy link

#3343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-bug Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants