fix: guard potential null derefs and remove dead branches#42358
Conversation
Code Review Agent Run #ec0c8aActionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- databricks: bind connect_args before the optional extra block in validate_parameters so it can't be referenced unbound when extra is empty - query_cache_manager: drop redundant None checks inside the truthy cache_value block (is_cached, cache_dttm) - query_context_factory: make the None-safety of filter_to_remove explicit before is_adhoc_column - presto: initialize unnested_rows before the expand loop so it is always bound
90b725f to
7f4d017
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42358 +/- ##
==========================================
- Coverage 65.27% 65.27% -0.01%
==========================================
Files 2794 2794
Lines 157520 157522 +2
Branches 36038 36038
==========================================
+ Hits 102815 102816 +1
- Misses 52729 52730 +1
Partials 1976 1976
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #b58dfcActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Small robustness/cleanup pass in a few backend paths surfaced by static analysis:
validate_parameters:connect_argswas only bound inside theif extra := json.loads(...)block, so an emptyextraraisedUnboundLocalErroratconnect_args.get("http_path"). Now initialized to{}up front.if cache_value := ...blockcache_valueis always truthy, sois_cached = cache_value is not Noneand theelse Nonebranch ofcache_dttmwere redundant/dead. Simplified.filter_to_removeexplicit beforeis_adhoc_column.expand_data:unnested_rowswas only assigned inside a conditional; initialized before the loop so it's always bound.TESTING INSTRUCTIONS
No behavior change except the databricks fix (empty
extrano longer raises). Covered by existing db_engine_specs and query-context unit tests.ADDITIONAL INFORMATION