Skip to content

chore(tags): TAGGING_SYSTEM to True by default#39888

Draft
sfirke wants to merge 2 commits intoapache:masterfrom
sfirke:set_tagging_to_true
Draft

chore(tags): TAGGING_SYSTEM to True by default#39888
sfirke wants to merge 2 commits intoapache:masterfrom
sfirke:set_tagging_to_true

Conversation

@sfirke
Copy link
Copy Markdown
Member

@sfirke sfirke commented May 5, 2026

SUMMARY

Replacing/continuing #37852, trying setting TAGGING_SYSTEM to True by default.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 5, 2026

Code Review Agent Run #83a85b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: f98a31b..3f2c5d9
    • superset/config.py
    • tests/integration_tests/fixtures/tags.py
  • Files skipped - 2
    • UPDATING.md - Reason: Filter setting
    • docs/static/feature-flags.json - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

@github-actions github-actions Bot added the doc Namespace | Anything related to documentation label May 5, 2026
@dosubot dosubot Bot added the change:backend Requires changing the backend label May 5, 2026
@sfirke sfirke changed the title flip TAGGING_SYSTEM to True by default chore(tags): TAGGING_SYSTEM to True by default May 5, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 3f2c5d9
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69f9ef1ee6ca52000945bbc0
😎 Deploy Preview https://deploy-preview-39888--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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.04%. Comparing base (673634f) to head (3f2c5d9).
⚠️ Report is 13 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (673634f) and HEAD (3f2c5d9). Click for more details.

HEAD has 172 uploads less than BASE
Flag BASE (673634f) HEAD (3f2c5d9)
python 120 4
presto 12 1
hive 12 1
unit 36 2
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39888      +/-   ##
==========================================
- Coverage   64.37%   56.04%   -8.33%     
==========================================
  Files        2569     2569              
  Lines      134745   134745              
  Branches    31278    31278              
==========================================
- Hits        86739    75522   -11217     
- Misses      46508    58570   +12062     
+ Partials     1498      653     -845     
Flag Coverage Δ
hive 39.71% <ø> (+0.03%) ⬆️
mysql ?
postgres ?
presto 41.52% <ø> (+0.09%) ⬆️
python 42.95% <ø> (-18.60%) ⬇️
sqlite ?
unit 100.00% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

Comment thread superset/config.py
"SSH_TUNNELING": False,
# Enables the tagging system for organizing assets
# @lifecycle: testing
"TAGGING_SYSTEM": True,
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.

Suggestion: Setting TAGGING_SYSTEM to enabled by default causes SQLAlchemy tagging listeners to be registered during app initialization, and those listeners continue firing even when tests or runtime code later mock the flag to disabled. This breaks the expected feature-flag contract (disabled mode should not create tags), because listener lifecycle is startup-bound while flag checks are runtime-bound. Keep the default off until listener registration/unregistration is made fully dynamic with flag changes. [logic error]

Severity Level: Major ⚠️
- ❌ Tagging disabled-mode test fails; tags still created.
- ⚠️ Runtime flag toggles cannot disable SQLA tagging listeners.
- ⚠️ TAGGING_SYSTEM feature flag semantics become inconsistent, surprising.
Steps of Reproduction ✅
1. Initialize the integration test application using `create_app` in
`tests/integration_tests/test_app.py:20-32`, which builds the global `app`. During app
initialization, `SupersetApp.sync_config_to_db` in `superset/app.py:161-186` is called by
the initializer, and because `DEFAULT_FEATURE_FLAGS["TAGGING_SYSTEM"]` is set to `True` in
`superset/config.py:669`, the check
`feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM")` at `superset/app.py:183`
returns True and `register_sqla_event_listeners()` is invoked at `superset/app.py:186`.

2. The call to `register_sqla_event_listeners` at `superset/tags/core.py:20-53` registers
SQLAlchemy `after_insert`, `after_update`, and `after_delete` event listeners on
`SqlaTable`, `Slice`, `Dashboard`, `FavStar`, and `SavedQuery` (e.g.
`sqla.event.listen(SqlaTable, "after_insert", DatasetUpdater.after_insert)` at lines
36-52). These listeners do not consult the feature flag; once registered, they fire on
every corresponding SQLA event for the lifetime of the process.

3. Run the integration test `TestTagging.test_tagging_system` defined in
`tests/integration_tests/tagging_tests.py:231-259`. This test is decorated with
`@with_feature_flags(TAGGING_SYSTEM=False)` at
`tests/integration_tests/tagging_tests.py:231`, which uses the helper `with_feature_flags`
in `tests/integration_tests/conftest.py:224-243` to patch
`feature_flag_manager.get_feature_flags` so that it returns `TAGGING_SYSTEM=False` during
the test, but it does not unregister or modify any already-registered SQLAlchemy
listeners.

4. Inside `test_tagging_system`, the test clears the `TaggedObject` table, then creates
and commits a `SqlaTable`, `Slice`, `Dashboard`, `SavedQuery`, and `FavStar` (object
creation and `db.session.commit()` around
`tests/integration_tests/tagging_tests.py:244-259`). These commits trigger the previously
registered listeners from `register_sqla_event_listeners`, which create
`Tag`/`TaggedObject` rows via the updater `after_insert` methods in
`superset/tags/models.py:221-236`. The test then asserts that no tags exist (checking
`self.query_tagged_object_table()` and asserting length 0 at
`tests/integration_tests/tagging_tests.py:238-244`), but the assertion fails because tags
were still created even though `TAGGING_SYSTEM` was mocked to False, demonstrating that
once the feature was enabled at startup, disabling it via the flag no longer prevents
tagging.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset/config.py
**Line:** 669:669
**Comment:**
	*Logic Error: Setting `TAGGING_SYSTEM` to enabled by default causes SQLAlchemy tagging listeners to be registered during app initialization, and those listeners continue firing even when tests or runtime code later mock the flag to disabled. This breaks the expected feature-flag contract (disabled mode should not create tags), because listener lifecycle is startup-bound while flag checks are runtime-bound. Keep the default off until listener registration/unregistration is made fully dynamic with flag changes.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@sfirke sfirke marked this pull request as draft May 5, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:backend Requires changing the backend doc Namespace | Anything related to documentation size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant