Skip to content

Improve error message in check_requires_y_none #31481

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fabridamicelli
Copy link
Contributor

Reference Issues/PRs

What does this implement/fix? Explain your changes.

This PR improves the error message in the function check_requires_y_none adding explicit instructions on how to fix the error when developing a custom estimator. Otherwise the user needs to jump into the source code to understand where the error comes from.

Any other comments?

@fabridamicelli fabridamicelli force-pushed the improve-check-requires-y-none-error-message branch from 65644fe to 4eb56b4 Compare June 4, 2025 14:30
Copy link

github-actions bot commented Jun 4, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 79881ad. Link to the linter CI: here

@adrinjalali
Copy link
Member

Thanks for the PR.

Pretty nice. You can even add new lines before {ve} for better readability and put it at the end of the message.

You should also add a test for this in test_estimator_checks.py.

@fabridamicelli
Copy link
Contributor Author

Thank you for reviewing this.

Pretty nice. You can even add new lines before {ve} for better readability and put it at the end of the message.
Good points. Done.

You should also add a test for this in test_estimator_checks.py.
I extended the test with a case that throws wrong error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants