Repository navigation
chore(tags): stop auto-generating type:/editor:/favorited_by: tags - #43471
Conversation
Code Review Agent Run #cf379aActionable 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 |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The flagged issue regarding the non-idempotent registration of the To resolve this, you should register and remove the Regarding other comments on this PR, there are no additional review comments in the provided |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #43471 +/- ##
==========================================
+ Coverage 83.98% 84.02% +0.03%
==========================================
Files 3055 3054 -1
Lines 201048 200822 -226
Branches 46967 46956 -11
==========================================
- Hits 168855 168745 -110
+ Misses 28948 28833 -115
+ Partials 3245 3244 -1
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:
|
009847e to
f638a55
Compare
Code Review Agent Run #c4c797Actionable Suggestions - 0Additional Suggestions - 1
Filtered 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 |
f638a55 to
e6129b0
Compare
Code Review Agent Run #8d3c16Actionable Suggestions - 0Additional Suggestions - 2
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 |
sadpandajoe noted on #43471 that removing DASHBOARD_LIST_CUSTOM_TAGS_ONLY made the dashboard list API always serialize the unfiltered Dashboard.tags relationship. Upgraded deployments can still carry legacy type:/editor:/ favorited_by: tag rows even though generation stopped, so this restored their old payload size despite the release note claiming every returned tag is custom. Restores the custom_tags filtered relationship, the DASHBOARD_LIST_CUSTOM_TAGS_ONLY config flag, and CustomTagsOptimizationMixin so that path keeps working for deployments with legacy rows. Only the implicit-tag generation itself (the actual point of this PR) stays removed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
e6129b0 to
9f9fc9c
Compare
Code Review Agent Run #a3a9ecActionable Suggestions - 0Additional Suggestions - 5
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 |
sadpandajoe noted on #43471 that removing DASHBOARD_LIST_CUSTOM_TAGS_ONLY made the dashboard list API always serialize the unfiltered Dashboard.tags relationship. Upgraded deployments can still carry legacy type:/editor:/ favorited_by: tag rows even though generation stopped, so this restored their old payload size despite the release note claiming every returned tag is custom. Restores the custom_tags filtered relationship, the DASHBOARD_LIST_CUSTOM_TAGS_ONLY config flag, and CustomTagsOptimizationMixin so that path keeps working for deployments with legacy rows. Only the implicit-tag generation itself (the actual point of this PR) stays removed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
2b14237 to
bbd7f06
Compare
e936079 to
8a9030c
Compare
sadpandajoe noted on #43471 that removing DASHBOARD_LIST_CUSTOM_TAGS_ONLY made the dashboard list API always serialize the unfiltered Dashboard.tags relationship. Upgraded deployments can still carry legacy type:/editor:/ favorited_by: tag rows even though generation stopped, so this restored their old payload size despite the release note claiming every returned tag is custom. Restores the custom_tags filtered relationship, the DASHBOARD_LIST_CUSTOM_TAGS_ONLY config flag, and CustomTagsOptimizationMixin so that path keeps working for deployments with legacy rows. Only the implicit-tag generation itself (the actual point of this PR) stays removed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Code Review Agent Run #2865b0Actionable Suggestions - 0Additional Suggestions - 2
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 |
sadpandajoe noted on #43471 that removing DASHBOARD_LIST_CUSTOM_TAGS_ONLY made the dashboard list API always serialize the unfiltered Dashboard.tags relationship. Upgraded deployments can still carry legacy type:/editor:/ favorited_by: tag rows even though generation stopped, so this restored their old payload size despite the release note claiming every returned tag is custom. Restores the custom_tags filtered relationship, the DASHBOARD_LIST_CUSTOM_TAGS_ONLY config flag, and CustomTagsOptimizationMixin so that path keeps working for deployments with legacy rows. Only the implicit-tag generation itself (the actual point of this PR) stays removed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
8a9030c to
3825737
Compare
There was a problem hiding this comment.
Code Review Agent Run #1b1640
Actionable Suggestions - 1
-
superset/tags/core.py - 1
- Duplicated idempotency guard · Line 76-77
Additional Suggestions - 3
-
tests/integration_tests/tags/dao_tests.py - 2
-
Test misses soft-delete path · Line 376-379This test hard-deletes via `db.session.delete(dashboard)`, which fires the `after_delete` listener. But production dashboard deletion routes through `DashboardDAO.delete()` → soft delete (`SOFT_DELETE=True` in config.py:724), which never fires `after_delete`, so `tagged_object` rows are NOT cleaned up on normal delete. The test passes while the production path it claims to guard leaves orphans. Use the DAO path or scope the claim to hard-delete/purge.
-
Type annotation mismatch · Line 359-359`insert_tag` declares `tag_type: str`, but this new call passes `TagType.custom` (an enum). Existing callers pass strings like `"custom"`. The `Tag.type` column is `Enum(TagType)` so both work, but the annotation is now misleading. Align the annotation or the argument.
-
-
superset/tags/core.py - 1
-
Positional magic indices · Line 72-74`declarations[0..2]` encode dataset/chart/dashboard by position; only the trailing comments disambiguate them, and those comments can silently diverge if `_tag_delete_listener_declarations` is reordered (e.g. when a fourth declaration is added). Unpacking into named locals (`dataset_decl, chart_decl, dashboard_decl = declarations`) makes the mapping structural. Same pattern at lines 88-90 in `clear_sqla_event_listeners`.
-
Review Details
-
Files reviewed - 11 · Commit Range:
6e0a21c..3825737- superset/app.py
- superset/cli/update.py
- superset/common/tags.py
- superset/mcp_service/tag/tool/get_tag_info.py
- superset/mcp_service/tag/tool/list_tags.py
- superset/tags/core.py
- superset/tags/models.py
- tests/integration_tests/charts/api_tests.py
- tests/integration_tests/dashboards/api_tests.py
- tests/integration_tests/tagging_tests.py
- tests/integration_tests/tags/dao_tests.py
-
Files skipped - 1
- UPDATING.md - Reason: Filter setting
-
Tools
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers an incremental AI Review. -
/review full- Manually triggers a full AI Review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].
Documentation & Help
Code Review Agent Run #093ebcActionable 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 |
CodeAnt PR Risk: Low Risk
Assessed commit: |
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]>
Guard sqla.event.listen/remove for the SavedQuery after_delete listener with sa.event.contains(), matching the pattern register_delete_listener already uses, so repeated register_sqla_event_listeners() calls don't stack duplicate cleanup callbacks. Co-Authored-By: Claude Opus 4.8 <[email protected]>
sadpandajoe noted on #43471 that removing DASHBOARD_LIST_CUSTOM_TAGS_ONLY made the dashboard list API always serialize the unfiltered Dashboard.tags relationship. Upgraded deployments can still carry legacy type:/editor:/ favorited_by: tag rows even though generation stopped, so this restored their old payload size despite the release note claiming every returned tag is custom. Restores the custom_tags filtered relationship, the DASHBOARD_LIST_CUSTOM_TAGS_ONLY config flag, and CustomTagsOptimizationMixin so that path keeps working for deployments with legacy rows. Only the implicit-tag generation itself (the actual point of this PR) stays removed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The spec regeneration in CI still emits the dashboard custom_tags field, so keep it in sync with master. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Chart API test expected the now-removed implicit tags; the stale AssertionError left a test chart undeleted, cascading off-by-one count failures into later tests in the same class run. Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]>
DASHBOARD_LIST_CUSTOM_TAGS_ONLY and its dashboard-list filtering were restored (not removed) to keep legacy implicit tags out of list responses for deployments that already opted in. Also update the now-stale "Implicit tags accrue" bullet from the TAGGING_SYSTEM default-on note to point at the removal. Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>
The bullet still described tag-creation listeners checking TAGGING_SYSTEM at fire time, but those listeners were removed entirely; only the unconditional deletion-cleanup listeners remain. Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]>
…e_listener Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nt drifting legacy tags Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
pytest.mark.parametrize is not supported on unittest.TestCase methods. Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Evan Rusackas <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fc1268d to
228d73b
Compare
|
@aminghadersohi good catch, the description now has a "What's kept" section for |
SUMMARY
On #43390, villebro noted that these system-generated tags appear to be unused, and suggested considering removing them entirely.
Confirmed: every tags list and filter in the frontend explicitly excludes non-custom tags —
ChartList,DashboardList,SavedQueryList, the chartPropertiesModal, the dashboardHeader, andfeatures/tags/tags.ts'sfetchAllTags/fetchTagsall filter toTagType.customonly. Nothing in the UI ever surfaced atype:/editor:/favorited_by:tag or let a user search/filter by one — the docstring's own promise ("user alice can find all their objects by querying for the tageditor:alice") had no UI path to actually do that.What remained was pure write-side overhead: with
TAGGING_SYSTEMenabled, 13 SQLAlchemy event listeners across 5 models (chart/dashboard/query/dataset/favorite) fired on every insert/update/delete, writingTag/TaggedObjectrows nobody ever read. There was even a whole performance-optimization mixin (CustomTagsOptimizationMixin,DASHBOARD_LIST_CUSTOM_TAGS_ONLY) that existed purely to strip this noise back out of dashboard-list API responses — evidence this was a known cost nobody had gotten around to addressing at the source.What this removes:
superset/tags/models.py:ObjectUpdater'seditor:/type:generation (after_insert/after_update) andFavStarUpdater'sfavorited_by:generation, entirely.superset/tags/core.py: only registers the delete-cleanup listeners now (see below).superset/common/tags.pyand thesync_tagsCLI command: the backfill path for the generation this removes.What's kept, on purpose:
custom_tags_api_mixin.py,DASHBOARD_LIST_CUSTOM_TAGS_ONLY(defaultFalse), andDashboard.custom_tags, so deployments that already enabled the flag to hide legacy implicit tags keep that filtering.ObjectUpdater.after_delete— cleans uptagged_objectrows for every tag on a deleted object, custom tags included.tagged_object.object_idcarries no foreign key (see its column comment), so this is the only thing that prevents orphaned rows when a chart/dashboard/query/dataset is hard-deleted — not part of the removed generation, added a regression test for it (test_tagged_object_cleanup_on_dashboard_delete).TagTypeenum values, thecustom_tagAPI filter, and bulk-delete protection for non-custom tags — for backward compatibility with upgraded deployments that already havetype:/editor:/favorited_by:rows, and because MCP'slist_tags/get_tag_infotools document and support filtering by these tag types. Docstrings updated to say these are legacy/no longer generated rather than actively implicit.Unrelated but blocking: this branch also carries #43467 as its first commit — a genuinely broken import in
superset/daos/tag.pyfrom the just-merged #43390 (current_user_can_modify_objectdoesn't live insuperset.commands.tag.utils) that otherwise breaks Flask app boot entirely and blocks every test in this area. Filed separately since it's unrelated; this branch will drop that commit on its own once #43467 merges and this rebases.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — internal cleanup, no UI changes (the UI never showed these tags to begin with).
TESTING INSTRUCTIONS
pytest tests/unit_tests/tags/ tests/unit_tests/commands/test_utils.py tests/unit_tests/initialization_test.py tests/unit_tests/dashboards/api_test.py— updated/removed tests for the removed generation and mixin.pytest tests/integration_tests/tags/dao_tests.py::TestTagsDAO::test_tagged_object_cleanup_on_dashboard_delete— new regression test for the preserved delete-cleanup behavior.pytest tests/unit_tests/run: 13172 passed (the only failures are pre-existing, unrelated to this change — a missing optionalpymysqldependency and afreezegunversion quirk in files this PR doesn't touch).TAGGING_SYSTEMenabled, create/edit/delete a chart, dashboard, saved query, and dataset, and favorite/unfavorite one — confirm notype:/editor:/favorited_by:tags appear in thetagtable anymore, while manually adding a custom tag and then deleting the tagged object still cleans up itstagged_objectrow.ADDITIONAL INFORMATION