docstr: Add a user agent to be used in the requests.
  Trim whitespace from connect_args to avoid databricks driver errors
docstr_tok: ["Add","a","user","agent","to","be","used","in","the","requests",".","Trim","whitespace","from","connect_args","to","avoid","databricks","driver","errors"]
code: def get_extra_params(database: Database) -> dict[str, Any]:
      """
      Add a user agent to be used in the requests.
      Trim whitespace from connect_args to avoid databricks driver errors
      """
      extra: dict[str, Any] = BaseEngineSpec.get_extra_params(database)
      engine_params: dict[str, Any] = extra.setdefault(
          "engine_params", {}
      )
      connect_args: dict[str, Any] = engine_params.setdefault(
          "connect_args", {}
      )
  
      connect_args.setdefault(
          "http_headers", [("User-Agent", USER_AGENT)]
      )
      connect_args.setdefault("_user_agent_entry", USER_AGENT)
  
      # trim whitespace from http_path to avoid databricks errors on connecting
      if http_path := connect_args.get("http_path"):
          connect_args["http_path"] = http_path.strip()
  
      return extra
  
imports: from __future__ import annotations
  import json
  from datetime import datetime
  from typing import Any, TYPE_CHECKING, TypedDict
  from apispec import APISpec
  from apispec.ext.marshmallow import MarshmallowPlugin
  from flask_babel import gettext
  from marshmallow import fields, Schema
  from marshmallow.validate import Range
  from sqlalchemy.engine.reflection import Inspector
  from sqlalchemy.engine.url import URL
  from superset.constants import TimeGrain, USER_AGENT
  from superset.databases.utils import make_url_safe
  from superset.db_engine_specs.base import BaseEngineSpec, BasicParametersMixin
  from superset.db_engine_specs.hive import HiveEngineSpec
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.utils.network import is_hostname_valid, is_port_open
label_desc: Use image node_id 1 for calling the DatabricksNativeEngineSpec obj's underlying member method code with example usage: obj.get_extra_params(database) and returns: extra