code: def test_update_command_failed_validation(
      session_with_data: Session, mocker: MockFixture
  ):
      from superset.commands.tag.create import (
          CreateCustomTagWithRelationshipsCommand,
      )
      from superset.commands.tag.exceptions import TagInvalidError
      from superset.commands.tag.update import UpdateTagCommand
      from superset.daos.tag import TagDAO
      from superset.models.dashboard import Dashboard
      from superset.models.slice import Slice
      from superset.tags.models import ObjectType
  
      dashboard = session_with_data.query(Dashboard).first()
      chart = session_with_data.query(Slice).first()
      objects_to_tag = [
          (ObjectType.chart, chart.id),
      ]
  
      mocker.patch(
          "superset.security.SupersetSecurityManager.is_admin",
          return_value=True,
      )
      mocker.patch(
          "superset.daos.chart.ChartDAO.find_by_id", return_value=chart
      )
      mocker.patch(
          "superset.daos.dashboard.DashboardDAO.find_by_id",
          return_value=dashboard,
      )
  
      CreateCustomTagWithRelationshipsCommand(
          data={"name": "test_tag", "objects_to_tag": objects_to_tag}
      ).run()
  
      tag_to_update = TagDAO.find_by_name("test_tag")
  
      objects_to_tag = [
          (0, dashboard.id),  # type: ignore
      ]
  
      with pytest.raises(TagInvalidError):
          UpdateTagCommand(
              tag_to_update.id,
              {
                  "name": "new_name",
                  "description": "new_description",
                  "objects_to_tag": objects_to_tag,
              },
          ).run()
  
file_path: superset/tests/unit_tests/tags/commands/update_test.py
imports: import pytest
  from pytest_mock import MockFixture
  from sqlalchemy.orm.session import Session
  from superset.utils.core import DatasourceType
label_desc: Use image node_id 4 for calling a global function with example usage: test_update_command_failed_validation(session_with_data, mocker) without return types