code: def session_with_data(session: Session):
      from superset.connectors.sqla.models import SqlaTable, TableColumn
      from superset.models.core import Database
      from superset.models.dashboard import Dashboard
      from superset.models.slice import Slice
      from superset.models.sql_lab import Query, SavedQuery
      from superset.tags.models import Tag
  
      engine = session.get_bind()
      Tag.metadata.create_all(engine)  # pylint: disable=no-member
  
      slice_obj = Slice(
          id=1,
          datasource_id=1,
          datasource_type=DatasourceType.TABLE,
          datasource_name="tmp_perm_table",
          slice_name="slice_name",
      )
  
      db = Database(
          database_name="my_database", sqlalchemy_uri="postgresql://"
      )
  
      columns = [
          TableColumn(column_name="a", type="INTEGER"),
      ]
  
      sqla_table = SqlaTable(
          table_name="my_sqla_table",
          columns=columns,
          metrics=[],
          database=db,
      )
  
      dashboard_obj = Dashboard(
          id=100,
          dashboard_title="test_dashboard",
          slug="test_slug",
          slices=[],
          published=True,
      )
  
      saved_query = SavedQuery(
          label="test_query", database=db, sql="select * from foo"
      )
  
      tag = Tag(name="test_name", description="test_description")
  
      session.add(slice_obj)
      session.add(dashboard_obj)
      session.add(tag)
      session.commit()
      yield session
  
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 1 for calling a global function with example usage: session_with_data(session) without return types