-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Description
Bug description
Error when removing all tagged objects from a tag and saving
Setup: Clean installation (only example data loaded)
Tagging System: Enabled
Steps to reproduce
Ensure Tagging System is enabled.
Create a new tag.
Tag multiple objects of the same type (e.g., multiple saved queries).
Go to the created tag → Edit.
Remove all tagged objects from this tag.
Click Save.
Expected behavior
The tag should update successfully, saving the removal of all associated objects without errors.
Actual behavior
An error occurs upon saving, and the tag update fails.
The UI shows:
Error Updating Tag
However, removing one item, and clicking save works
Screenshots/recordings
No response
Superset version
5.0.0
Python version
3.9
Node version
16
Browser
Chrome
Additional context
The backend logs include the following traceback:
superset_app | 2025-11-11 12:23:52,866:ERROR:flask_appbuilder.api:()
superset_app | Traceback (most recent call last):
superset_app | File "/app/superset/utils/decorators.py", line 259, in wrapped
superset_app | result = func(*args, **kwargs)
superset_app | File "/app/superset/commands/tag/update.py", line 49, in run
superset_app | db.session.add(self._model)
superset_app | File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2648, in add
superset_app | self._save_or_update_state(state)
superset_app | File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2678, in _save_or_update_state
superset_app | self.save_or_update_impl(st)
superset_app | File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 3289, in _save_or_update_impl
superset_app | self._update_impl(state)
superset_app | File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 3259, in _update_impl
superset_app | raise sa_exc.InvalidRequestError(
superset_app | sqlalchemy.exc.InvalidRequestError: Instance '<TaggedObject at 0x7486d46ff6d0>' has been deleted. Use the make_transient() function to send this object back to the transient state.
superset_app | The above exception was the direct cause of the following exception:
superset_app | sqlalchemy.exc.SQLAlchemyError: ()
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.