class_docstr: Base class for to create DBClients for engines supported by SQLAlchemy.
class_docstr_tok: ["Base","class","for","to","create","DBClients","for","engines","supported","by","SQLAlchemy","."]
code: def build_engine_url(  # noqa: D
      dialect: str,
      database: str,
      username: str,
      password: Optional[str],
      host: str,
      port: Optional[int] = None,
      query: Optional[Mapping[str, Union[str, Sequence[str]]]] = None,
      driver: Optional[str] = None,
  ) -> sqlalchemy.engine.url.URL:
      return sqlalchemy.engine.url.URL.create(
          f"{dialect}+{driver}" if driver else f"{dialect}",
          username=username,
          password=password,
          host=host,
          port=port,
          database=database,
          **({"query": query} if query is not None else {}),
      )
  
imports: from __future__ import annotations
  import logging
  import time
  from abc import ABC
  from contextlib import contextmanager
  from typing import Iterator, Mapping, Optional, Sequence, Set, Union
  import pandas
  import sqlalchemy
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.sql.sql_bind_parameters import SqlBindParameters
  from metricflow.sql_request.sql_request_attributes import SqlJsonTag, SqlRequestTagSet
  from metricflow.test.fixtures.sql_clients.base_sql_client_implementation import BaseSqlClientImplementation
label_desc: Use image node_id 2 for calling the SqlAlchemySqlClient obj's underlying member method code with example usage: obj.build_engine_url(dialect, database, username, password, host, port, query, driver) and returns: sqlalchemy