Skip to content

chore(tags): stop auto-generating type:/editor:/favorited_by: tags - #43471

Merged
rusackas merged 11 commits into
masterfrom
chore/remove-implicit-tag-generation
Oct 21, 2026
Merged

rusackas merged 11 commits into
masterfrom
chore/remove-implicit-tag-generation

Conversation

@rusackas

@rusackas rusackas commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

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 chart PropertiesModal, the dashboard Header, and features/tags/tags.ts's fetchAllTags/fetchTags all filter to TagType.custom only. Nothing in the UI ever surfaced a type:/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 tag editor:alice") had no UI path to actually do that.

What remained was pure write-side overhead: with TAGGING_SYSTEM enabled, 13 SQLAlchemy event listeners across 5 models (chart/dashboard/query/dataset/favorite) fired on every insert/update/delete, writing Tag/TaggedObject rows 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's editor:/type: generation (after_insert/after_update) and FavStarUpdater's favorited_by: generation, entirely.
  • superset/tags/core.py: only registers the delete-cleanup listeners now (see below).
  • superset/common/tags.py and the sync_tags CLI command: the backfill path for the generation this removes.

What's kept, on purpose:

  • custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY (default False), and Dashboard.custom_tags, so deployments that already enabled the flag to hide legacy implicit tags keep that filtering.
  • ObjectUpdater.after_delete — cleans up tagged_object rows for every tag on a deleted object, custom tags included. tagged_object.object_id carries 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).
  • The TagType enum values, the custom_tag API filter, and bulk-delete protection for non-custom tags — for backward compatibility with upgraded deployments that already have type:/editor:/favorited_by: rows, and because MCP's list_tags/get_tag_info tools 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.py from the just-merged #43390 (current_user_can_modify_object doesn't live in superset.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.
  • Full pytest tests/unit_tests/ run: 13172 passed (the only failures are pre-existing, unrelated to this change — a missing optional pymysql dependency and a freezegun version quirk in files this PR doesn't touch).
  • Manual: with TAGGING_SYSTEM enabled, create/edit/delete a chart, dashboard, saved query, and dataset, and favorite/unfavorite one — confirm no type:/editor:/favorited_by: tags appear in the tag table anymore, while manually adding a custom tag and then deleting the tagged object still cleans up its tagged_object row.

ADDITIONAL INFORMATION

@bito-code-review

bito-code-review Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #cf379a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 21 · Commit Range: d305cd9..009847e
    • superset/app.py
    • superset/cli/update.py
    • superset/common/tags.py
    • superset/config.py
    • superset/daos/tag.py
    • superset/dashboards/api.py
    • superset/dashboards/schemas.py
    • superset/mcp_service/tag/tool/get_tag_info.py
    • superset/mcp_service/tag/tool/list_tags.py
    • superset/models/dashboard.py
    • superset/tags/core.py
    • superset/tags/models.py
    • superset/views/custom_tags_api_mixin.py
    • tests/integration_tests/dashboards/api_tests.py
    • tests/integration_tests/superset_test_config.py
    • tests/integration_tests/tagging_tests.py
    • tests/integration_tests/tags/dao_tests.py
    • tests/integration_tests/tasks/async_queries_tests.py
    • tests/unit_tests/dashboards/api_test.py
    • tests/unit_tests/tags/commands/update_test.py
    • tests/unit_tests/views/test_custom_tags_api_mixin.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/resources/openapi.json - 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

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added api Related to the REST API doc Namespace | Anything related to documentation preset-io labels Aug 24, 2026
@netlify

netlify Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 3825737
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6abf94abda2c7f000807257e
😎 Deploy Preview https://deploy-preview-43471--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread superset/tags/core.py Resolved
@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue regarding the non-idempotent registration of the SavedQuery listener is correct. Because sync_config_to_db() can be called multiple times, registering the listener directly leads to duplicate callbacks, which are not fully cleaned up by clear_sqla_event_listeners().

To resolve this, you should register and remove the SavedQuery listener using the same declaration-based helper used for other listeners. Since the relevant code is not fully visible in the provided diff, please ensure you update the registration logic in superset/app.py or the corresponding core tagging module to use the centralized register_sqla_event_listeners helper.

Regarding other comments on this PR, there are no additional review comments in the provided pr_comments.csv file.

@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.02%. Comparing base (7ff5709) to head (228d73b).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
superset/tags/core.py 66.66% 2 Missing ⚠️
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     
Flag Coverage Δ
hive 34.92% <75.00%> (+0.02%) ⬆️
mysql 52.87% <75.00%> (+0.01%) ⬆️
postgres 52.88% <75.00%> (+0.01%) ⬆️
presto 36.64% <75.00%> (-0.01%) ⬇️
python 87.27% <75.00%> (+0.07%) ⬆️
sqlite 52.64% <75.00%> (+0.01%) ⬆️
unit 81.51% <25.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from 009847e to f638a55 Compare August 24, 2026 20:51
@bito-code-review

bito-code-review Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c4c797

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset/models/dashboard.py - 1
    • Dead code removal unverified · Line 194-203
      The diff removes `custom_tags` relationship (lines 194-203) but this code is absent from the current file. This indicates the PR base branch may be out of sync with target, or the change was already applied. Ensure the base branch contains the `custom_tags` definition before merging this removal.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • tests/integration_tests/superset_test_config.py - 1
Review Details
  • Files reviewed - 19 · Commit Range: ae18388..f638a55
    • superset/app.py
    • superset/cli/update.py
    • superset/common/tags.py
    • superset/config.py
    • superset/dashboards/api.py
    • superset/dashboards/schemas.py
    • superset/mcp_service/tag/tool/get_tag_info.py
    • superset/mcp_service/tag/tool/list_tags.py
    • superset/models/dashboard.py
    • superset/tags/core.py
    • superset/tags/models.py
    • superset/views/custom_tags_api_mixin.py
    • tests/integration_tests/dashboards/api_tests.py
    • tests/integration_tests/superset_test_config.py
    • tests/integration_tests/tagging_tests.py
    • tests/integration_tests/tags/dao_tests.py
    • tests/integration_tests/tasks/async_queries_tests.py
    • tests/unit_tests/dashboards/api_test.py
    • tests/unit_tests/views/test_custom_tags_api_mixin.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/resources/openapi.json - 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

AI Code Review powered by Bito Logo

Comment thread superset/tags/core.py Resolved
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Sep 3, 2026
@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from f638a55 to e6129b0 Compare September 4, 2026 02:04
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Sep 4, 2026
@bito-code-review

bito-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #8d3c16

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset/tags/models.py - 1
    • Orphaned favorited_by rows · Line 343-379
      Removing `FavStarUpdater.after_delete` drops the only cleanup of legacy `favorited_by:{user_id}` tagged_object rows on unfavorite (previously registered via `sqla.event.listen(FavStar, "after_delete", ...)` in `core.py`). No other path removes these associations, so pre-migration favorites leave stale tags. If intentional, document it; otherwise keep a delete listener.
  • superset/tags/core.py - 1
    • Listener catalog inconsistency · Line 76-77
      The SavedQuery `after_delete` listener is registered directly via `sqla.event.listen`/`remove`, while the dataset/chart/dashboard delete listeners go through the typed `DeleteListenerDeclaration` catalog. Since `SavedQuery` is not a purge root, this has no current functional impact, but it diverges from the catalog pattern in the same functions and risks being missed if `SavedQuery` is later added to `purge_policy_registry`. Consider adding it to `_tag_delete_listener_declarations()` for uniform management.
Review Details
  • Files reviewed - 19 · Commit Range: 6932253..e6129b0
    • superset/app.py
    • superset/cli/update.py
    • superset/common/tags.py
    • superset/config.py
    • superset/dashboards/api.py
    • superset/dashboards/schemas.py
    • superset/mcp_service/tag/tool/get_tag_info.py
    • superset/mcp_service/tag/tool/list_tags.py
    • superset/models/dashboard.py
    • superset/tags/core.py
    • superset/tags/models.py
    • superset/views/custom_tags_api_mixin.py
    • tests/integration_tests/dashboards/api_tests.py
    • tests/integration_tests/superset_test_config.py
    • tests/integration_tests/tagging_tests.py
    • tests/integration_tests/tags/dao_tests.py
    • tests/integration_tests/tasks/async_queries_tests.py
    • tests/unit_tests/dashboards/api_test.py
    • tests/unit_tests/views/test_custom_tags_api_mixin.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/resources/openapi.json - 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

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Sep 5, 2026
Comment thread superset/dashboards/api.py Resolved
rusackas added a commit that referenced this pull request Sep 5, 2026
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]>
@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from e6129b0 to 9f9fc9c Compare September 5, 2026 14:33
@github-actions github-actions Bot removed api Related to the REST API requires:rebase Requires rebasing on top of current master labels Sep 5, 2026
@bito-code-review

bito-code-review Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a3a9ec

Actionable Suggestions - 0
Additional Suggestions - 5
  • superset/tags/core.py - 2
    • Orphaned favorited_by tag rows · Line 128-129
      Removing `FavStarUpdater.after_delete` drops cleanup of `favorited_by:` `tagged_object` rows. `TagType`'s docstring says existing favorited_by rows are preserved and still recognized in upgraded deployments, so un-favoriting (FavStar row deletion) now leaves orphaned tag rows. Consider retaining a FavStar delete cleanup for legacy rows.
    • Catalog bypass for SavedQuery · Line 76-77
      SavedQuery's `after_delete` is registered manually while dataset/chart/dashboard go through `register_delete_listener(declarations[N])`. This bypasses the `_DELETE_LISTENERS` catalog, so `declared_delete_listeners()`/`listener_responsibilities()` won't include SavedQuery. No functional impact today (SavedQuery isn't a purge model), but it's an inconsistency worth aligning.
  • tests/integration_tests/tags/dao_tests.py - 1
    • Test misses soft-delete path · Line 376-379
      This test hard-deletes via `db.session.delete(dashboard)`, which fires the `after_delete` listener. But production deletes dashboards through `DashboardDAO.delete`, which routes to `soft_delete` (Dashboard has `SoftDeleteMixin`, `SOFT_DELETE` defaults True) and only sets `deleted_at` — it never dispatches `after_delete`. So the regression guard passes while the real path leaves orphaned `tagged_object` rows. Consider exercising the real production delete path (e.g., `DashboardDAO.delete([dashboard])`, importing it) or moving the tagged_object cleanup to a soft-delete hook so the test reflects actual behavior.
  • tests/integration_tests/dashboards/api_tests.py - 1
    • Unique tag name collision · Line 4667-4667
      `Tag.name` is `unique=True`, and `tests/integration_tests/tags/api_tests.py::test_get_list_tag_filtered` (line 230) also creates a `type:dashboard` tag that it never deletes. Both files share the same persistent sqlite test DB, so if the tags test runs first, this `db.session.flush()` raises an IntegrityError. Use a distinct name to avoid ordering-dependent flakiness.
  • superset/tags/models.py - 1
    • Type annotation mismatch · Line 168-168
      `QueryUpdater.after_delete` is registered on `SavedQuery` (see `register_sqla_event_listeners` in `core.py`), but the `target` annotation here says `Query`. `Query` and `SavedQuery` are distinct classes in `sql_lab.py`. Update the annotation to `SavedQuery` so the listener contract matches its actual target.
Review Details
  • Files reviewed - 10 · Commit Range: 5f43f23..9f9fc9c
    • 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/dashboards/api_tests.py
    • tests/integration_tests/tagging_tests.py
    • tests/integration_tests/tags/dao_tests.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/resources/openapi.json - 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

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added requires:rebase Requires rebasing on top of current master and removed doc Namespace | Anything related to documentation labels Sep 6, 2026
rusackas added a commit that referenced this pull request Sep 11, 2026
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]>
@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from 2b14237 to bbd7f06 Compare September 11, 2026 05:54
@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from e936079 to 8a9030c Compare September 23, 2026 20:26
rusackas added a commit that referenced this pull request Sep 23, 2026
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]>
@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #2865b0

Actionable Suggestions - 0
Additional Suggestions - 2
  • tests/integration_tests/tags/dao_tests.py - 1
    • Missing test cleanup · Line 340-382
      This new test has no try/finally: if `assert tagged_object_count() == 0` fails, the dashboard (slug `tag-cleanup-test`) and tag (`cleanup_test_tag`) stay in the DB. Both columns are unique, so the next run raises IntegrityError and the suite becomes non-idempotent after any failure. Add a `finally` that deletes both.
  • tests/integration_tests/dashboards/api_tests.py - 1
    • Setup outside cleanup · Line 6366-6382
      The tag setup (`editor:admin`, `type:dashboard`, `critical`) runs before the `try`, so if `db.session.commit()` at line 6382 raises (e.g. `Tag.name` unique violation from a prior orphan), the `finally` never runs and the tags leak. Consider moving setup inside the try or adding a setup cleanup.
Review Details
  • Files reviewed - 11 · Commit Range: e62cf4e..8a9030c
    • 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

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 2, 2026
rusackas added a commit that referenced this pull request Oct 2, 2026
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]>
@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from 8a9030c to 3825737 Compare October 2, 2026 11:25
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Oct 2, 2026

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #1b1640

Actionable Suggestions - 1
  • superset/tags/core.py - 1
Additional Suggestions - 3
  • tests/integration_tests/tags/dao_tests.py - 2
    • Test misses soft-delete path · Line 376-379
      This 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

AI Code Review powered by Bito Logo

Comment thread superset/tags/core.py Resolved
@bito-code-review

bito-code-review Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #093ebc

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 3825737..39eb1b1
    • superset/tags/core.py
  • Files skipped - 0
  • 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

AI Code Review powered by Bito Logo

@aminghadersohi
aminghadersohi self-requested a review October 12, 2026 23:43

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description's "What this removes" list is stale: DASHBOARD_LIST_CUSTOM_TAGS_ONLY, Dashboard.custom_tags and superset/views/custom_tags_api_mixin.py are all present at head, restored by e47998b and 37a2efb.

Comment thread UPDATING.md Resolved
Comment thread superset/tags/core.py Resolved
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge; SavedQuery cleanup uses the same declaration-based registration as the other deletion listeners.

Assessed commit: 228d73b93010

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 20, 2026
rusackas and others added 11 commits October 20, 2026 15:54
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]>
@rusackas
rusackas force-pushed the chore/remove-implicit-tag-generation branch from fc1268d to 228d73b Compare October 20, 2026 23:11
@rusackas

Copy link
Copy Markdown
Member Author

@aminghadersohi good catch, the description now has a "What's kept" section for custom_tags_api_mixin.py, DASHBOARD_LIST_CUSTOM_TAGS_ONLY and Dashboard.custom_tags, and the stale "removes" bullets are gone.

@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Oct 21, 2026

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@rusackas
rusackas merged commit b6ef0bf into master Oct 21, 2026
75 of 77 checks passed
@rusackas
rusackas deleted the chore/remove-implicit-tag-generation branch October 21, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants