Skip to content

feat(tags): add favorites filter to Tags list view - #41461

Merged
yousoph merged 1 commit into
apache:masterfrom
preset-io:sc-111747-tags-favorites-filter
Jul 6, 2026
Merged

feat(tags): add favorites filter to Tags list view#41461
yousoph merged 1 commit into
apache:masterfrom
preset-io:sc-111747-tags-favorites-filter

Conversation

@yousoph

@yousoph yousoph commented Jun 26, 2026

Copy link
Copy Markdown
Member

SUMMARY

Adds a "Favorite" filter to the Tags list view, mirroring the pattern (and ordering) already used by the Charts and Dashboards CRUD list views. Users can now filter the Tags list to show only their favorited tags (or only non-favorited).

Frontend

  • ListView/types.ts: added TagIsFav = 'tag_is_favorite' to the ListViewFilterOperator enum.
  • pages/Tags/index.tsx: added a memoized favoritesFilter (Yes/No select, operator: TagIsFav), included in the filters array guarded by userId. The Tags list has no Owner/Certified filters, so it's placed between Name and Modified by — consistent with where Charts/Dashboards put Favorite (after owner-type filters, before "Modified by").

Backend

  • tags/filters.py: new TagFavoriteFilter. Note tag favorites are stored in user_favorite_tag_table (a dedicated M2M table), not in FavStar — so this deliberately does not subclass BaseFavoriteFilter. It builds a subquery of favorited tag ids for the current user (anonymous users pass through unfiltered), mirroring TagDAO.favorited_ids.
  • tags/api.py: registered TagFavoriteFilter under the "id" key in search_filters and added an explicit search_columns list including id.

A companion PR fixes the (separate) bug where the Tags favorite star did not toggle: #41460

TESTING INSTRUCTIONS

  1. Favorite one or more tags in Settings → Tags (requires fix(tags): make favorite star toggle in Tags list view #41460 for the star to toggle in the UI, or favorite via the API).
  2. Use the new Favorite filter → "Yes" shows only favorited tags, "No" shows the rest.

New integration test tests/integration_tests/tags/api_tests.py::test_get_list_tag_filtered_by_favorite asserts tag_is_favorite=True/False returns the correct tags for the current user.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Migration is atomic, supports rollback & is backwards-compatible
  • Confirm DB migration upgrade and downgrade tested
  • Runtime warnings (e.g., Compatibility warnings, Deprecation warnings, Spark workers crashing)

Add a "Favorite" filter to the Tags list view, matching the pattern and
ordering used by the Charts and Dashboards CRUD list views.

Tag favorites live in the dedicated user_favorite_tag_table M2M table (not
in FavStar), so a new TagFavoriteFilter (not a BaseFavoriteFilter subclass)
queries that table for the current user. The filter is registered under the
"id" search key and "id" is added to the API search_columns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the api Related to the REST API label Jun 26, 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 #3d0a91

Actionable Suggestions - 1
  • superset/tags/filters.py - 1
    • Missing unit tests for TagFavoriteFilter · Line 52-74
Filtered by Review Rules

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

  • tests/integration_tests/tags/api_tests.py - 1
Review Details
  • Files reviewed - 5 · Commit Range: c1e764b..c1e764b
    • superset-frontend/src/components/ListView/types.ts
    • superset-frontend/src/pages/Tags/index.tsx
    • superset/tags/api.py
    • superset/tags/filters.py
    • tests/integration_tests/tags/api_tests.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
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - 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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset/tags/filters.py
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.68421% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.51%. Comparing base (98d0ccd) to head (c1e764b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
superset-frontend/src/pages/Tags/index.tsx 0.00% 3 Missing ⚠️
superset/tags/filters.py 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41461      +/-   ##
==========================================
- Coverage   64.52%   64.51%   -0.01%     
==========================================
  Files        2664     2664              
  Lines      146153   146173      +20     
  Branches    33713    33718       +5     
==========================================
+ Hits        94307    94309       +2     
- Misses      50131    50146      +15     
- Partials     1715     1718       +3     
Flag Coverage Δ
hive 39.23% <62.50%> (+<0.01%) ⬆️
javascript 68.95% <0.00%> (-0.02%) ⬇️
mysql 57.97% <87.50%> (+<0.01%) ⬆️
postgres 58.04% <87.50%> (+<0.01%) ⬆️
presto 40.80% <62.50%> (+<0.01%) ⬆️
python 59.47% <87.50%> (-0.01%) ⬇️
sqlite 57.67% <87.50%> (+<0.01%) ⬆️
unit 100.00% <ø> (ø)

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.

@sadpandajoe
sadpandajoe self-requested a review June 29, 2026 17:09

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM — checked TagFavoriteFilter.apply against BaseFavoriteFilter and it's a faithful mirror (tag favorites live in user_favorite_tag_table, not FavStar, so not subclassing is right), and the registration under search_filters["id"] matches how dashboards do it. Integration test covers both directions.

One thing worth being aware of rather than fixing: the new explicit search_columns list narrows what FAB used to derive for the Tag API (e.g. changed_on drops out of searchability). It matches the charts/dashboards convention so I read it as cleanup, but flagging in case anyone was leaning on the old surface.

@yousoph
yousoph merged commit c0b0a2f into apache:master Jul 6, 2026
68 checks passed
@yousoph
yousoph deleted the sc-111747-tags-favorites-filter branch July 6, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants