Repository navigation
fix(tags): fix broken import in daos/tag.py - #43466
Conversation
current_user_can_modify_object moved out of superset.commands.tag.utils, but daos/tag.py's own import wasn't updated, breaking app boot (ChartRestApi et al. import this module transitively). Re-point the import at its new location, lazily inside the function to avoid a circular import between daos.tag and commands.utils (the latter imports TagDAO from the former).
Code Review Agent Run #3b3d0fActionable Suggestions - 0Review 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43466 +/- ##
========================================
Coverage 78.86% 78.87%
========================================
Files 2876 2877 +1
Lines 164623 164853 +230
Branches 38019 38063 +44
========================================
+ Hits 129835 130031 +196
- Misses 32345 32372 +27
- Partials 2443 2450 +7
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:
|
SUMMARY
superset/daos/tag.pyimportscurrent_user_can_modify_objectfromsuperset.commands.tag.utils, but that function was relocated tosuperset.commands.utilsin #43389, which merged shortly after #43390 added this import. Neither PR could see the other's in-flight change, and there was no textual conflict, so both merged clean. The result:daos/tag.py(and everything importing it, including chart/dataset/etc. REST APIs) fails at import time on currentmaster.The fix re-points the import at its new home. It's done as a lazy, function-local import rather than a top-level one, since
superset.commands.utilsitself importsTagDAOfromsuperset.daos.tag— a top-level import in both directions would be circular.Also updates two existing tests in
tests/unit_tests/tags/commands/update_test.pythat patched the old module-level attribute (superset.daos.tag.current_user_can_modify_object); with the import now local to the function, the patch target moves to where the function actually lives (superset.commands.utils.current_user_can_modify_object).TESTING INSTRUCTIONS
pytest tests/unit_tests/tags/ tests/unit_tests/commands/ tests/unit_tests/semantic_layers/ tests/unit_tests/daos/— 1474 passed. Also verifiedcreate_app()completes without the priorImportError(confirmed the error reproduces onmasterbefore this fix, and is gone after).ADDITIONAL INFORMATION