code: def insert_saved_query(
      self,
      label: str,
      sql: str,
      db_id: Optional[int] = None,
      created_by=None,
      schema: Optional[str] = "",
      description: Optional[str] = "",
  ) -> SavedQuery:
      database = None
      if db_id:
          database = db.session.query(Database).get(db_id)
      query = SavedQuery(
          database=database,
          created_by=created_by,
          sql=sql,
          label=label,
          schema=schema,
          description=description,
      )
      db.session.add(query)
      db.session.commit()
      return query
  
imports: import json
  from datetime import datetime
  from io import BytesIO
  from typing import Optional
  from zipfile import is_zipfile, ZipFile
  import yaml
  import pytest
  import prison
  from freezegun import freeze_time
  from sqlalchemy.sql import func, and_
  import tests.integration_tests.test_app
  from superset import db
  from superset.models.core import Database
  from superset.models.core import FavStar
  from superset.models.sql_lab import SavedQuery
  from superset.utils.database import get_example_database
  from tests.integration_tests.base_tests import SupersetTestCase
  from tests.integration_tests.fixtures.importexport import database_config, saved_queries_config, saved_queries_metadata_config
label_desc: Use image node_id 1 for calling the TestSavedQueryApi obj's underlying member method code with example usage: obj.insert_saved_query(label, sql, db_id, created_by, schema, description) and returns: query