-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(import): Ensure import exceptions are logged #32410
base: master
Are you sure you want to change the base?
Conversation
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment
|
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.
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Fix Detected |
---|---|---|
Incorrect log level for critical errors ▹ view |
Files scanned
File Path | Reviewed |
---|---|
superset/commands/importers/v1/init.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Documentation ✅ Logging ✅ Error Handling ✅ Readability ✅ Design ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
@@ -104,6 +107,8 @@ def validate(self) -> None: # noqa: F811 | |||
self._prevent_overwrite_existing_model(exceptions) | |||
|
|||
if exceptions: | |||
for ex in exceptions: | |||
logger.warning("Import Error: %s",ex) |
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.
Incorrect log level for critical errors 
Tell me more
What is the issue?
Using warning level for import validation errors that lead to command failure
Why this matters
Warning level suggests the error is not severe, but these validation errors cause command failure and should be treated as errors
Suggested change ∙ Feature Preview
Use error level logging instead:
logger.error("Import validation error: %s", ex)
💬 Chat with Korbit by mentioning @korbit-ai.
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.
These are not critical errors in terms of the superset app itself.
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.
This is still under error
label so Korbit is correct, imo.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #32410 +/- ##
===========================================
+ Coverage 60.48% 83.46% +22.97%
===========================================
Files 1931 546 -1385
Lines 76236 39106 -37130
Branches 8568 0 -8568
===========================================
- Hits 46114 32638 -13476
+ Misses 28017 6468 -21549
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
61f3477
to
4beaf46
Compare
Thanks @withnale for raising PR following your issue! I left 2 reviews |
@@ -104,6 +107,8 @@ def validate(self) -> None: # noqa: F811 | |||
self._prevent_overwrite_existing_model(exceptions) | |||
|
|||
if exceptions: | |||
for ex in exceptions: | |||
logger.warning("Import Error: %s", ex) | |||
raise CommandInvalidError( |
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.
L112 already raised the exceptions and surely logged by the logger. You're not seeing the exceptions?
SUMMARY
Closes #32411
This is a partial fix to issue #32411 which provides explicit logging for each import error that occurs.
At present, if there is an import error occurs there is very little information to work with. If the import is being performed in the UI then the following error will appear...
In the logs, only the following error will be generated:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION