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
fix: proper error messages if autosummary fails to import module #9555
Closed
Closed
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a189f8f
fix: proper errors for autosummary
Pro ae86f28
fix: remove list duplicates and add additional errors
Pro c62ad04
Remove double-stringify
Pro 7b3570b
Remove double-stringify
Pro c5cd8ae
fix: minor code cleanup
Pro 08fea4b
fix: correct conversion to string exception
Pro 23e3d7c
Fix typo
Pro b6cc528
fix: simplify getting error strings
Pro File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this change is strange because
last_errors
should be a part of the return value. I understand using argument gives us compatibility. But...BTW, it should be annotated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also thought the same, but that would probably break backwards compatibility? Or should I change last_errors to be a retun value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two ideas:
import_by_name
that also returns list of errors. It will be named as different name.raise_error
toimport_by_name
. And it raises a custom exception that contains list of errors.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, raise_error would not work that well since we need to collect all errors during the various import methods there are.
Having another version of the import_by_name is IMHO also not such an ideal solution, since then we would need to duplicate code, not only for the
import_by_name
but also for the sub-methods such as_import_by_name
which is called inside ofimport_by_name