Repository navigation
Conversation
superset/daos/tag.py imported current_user_can_modify_object from superset.commands.tag.utils, which has never defined or re-exported it - the function only exists in superset.commands.utils. This broke app boot entirely, since superset.commands.utils itself imports TagDAO, so any request through ChartRestApi -> commands/chart/create.py -> commands/utils.py -> daos/tag.py hit the bad import at module load time. Importing it directly from commands.utils at module level would create a circular import (commands.utils -> daos.tag -> commands.utils), so the import is deferred to call time in create_tag_relationship, the one place daos/tag.py needs it - matching the existing deferred-import pattern used elsewhere in this codebase for the same reason. Introduced by #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Code Review Agent Run #2fa328Actionable 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 #43467 +/- ##
========================================
Coverage 78.86% 78.87%
========================================
Files 2876 2877 +1
Lines 164650 164853 +203
Branches 38020 38063 +43
========================================
+ Hits 129855 130031 +176
- Misses 32352 32372 +20
- 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:
|
|
Closing in favor of #43466, same fix landed there first — daos/tag.py's import of current_user_can_modify_object needed to move to commands.utils either way. Thanks for jumping on this one! |
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
villebro noted on #43390 that these system-generated tags appear to be unused. Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags (ChartList, DashboardList, SavedQueryList, the chart PropertiesModal, the dashboard Header), so nothing ever surfaced them to a user. What remained was pure write-side overhead: 13 SQLAlchemy event listeners across 5 models firing on every chart/ dashboard/query/dataset save and every favorite/unfavorite, plus a whole performance-optimization mixin (CustomTagsOptimizationMixin, DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip the resulting noise back out of dashboard-list responses. This removes the generation: - superset/tags/models.py: drop ObjectUpdater's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation entirely. Keeps after_delete (tagged_object cleanup applies to every tag, custom included, and nothing else removes those rows since tagged_object.object_id has no FK - see its column comment). - superset/tags/core.py: only registers the delete-cleanup listeners now. - superset/common/tags.py + the `sync_tags` CLI command: removed (the backfill path for the generation this removes). - superset/views/custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags, and the schema/API plumbing built around them: removed - nothing left to optimize away once implicit tags stop accumulating. Kept for backward compatibility, since MCP's list_tags/get_tag_info tools document these tag types and upgraded deployments may already have rows of these types: the TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags. Docstrings updated to say these are legacy/no longer generated rather than actively implicit. Also fixes a real, currently-broken import in superset/daos/tag.py (current_user_can_modify_object doesn't live in superset.commands.tag.utils, only in superset.commands.utils) that otherwise blocks every test in this area from running at all. Filed and fixed separately as #43467; this commit will collapse away on rebase once that merges. Follow-up to #43390. Co-Authored-By: Claude Sonnet 5 <[email protected]>
SUMMARY
superset/daos/tag.pyimportscurrent_user_can_modify_objectfromsuperset.commands.tag.utils, which has never defined or re-exported it — the function only exists insuperset.commands.utils. This breaks Flask app boot entirely:superset.commands.utilsitself importsTagDAO, so any request path throughChartRestApi→commands/chart/create.py→commands/utils.py→daos/tag.pyhits the bad import at module load time.Importing it directly from
commands.utilsat module level creates a circular import (commands.utils→daos.tag→commands.utils), so the import is deferred to call time insidecreate_tag_relationship, the one placedaos/tag.pyneeds it — matching the existing deferred-import pattern already used elsewhere in this codebase for the same reason.Introduced by #43390.
TESTING INSTRUCTIONS
pytest tests/unit_tests/tags/ tests/unit_tests/commands/test_utils.py— updated the two mocks intests/unit_tests/tags/commands/update_test.pythat patched the (never-correct)superset.daos.tag.current_user_can_modify_objectpath to patch the real source,superset.commands.utils.current_user_can_modify_object, instead.Also ran the full
tests/unit_tests/suite to confirm nothing else silently depended on the broken import.ADDITIONAL INFORMATION