class_docstr: Engine spec for Druid.io
class_docstr_tok: ["Engine","spec","for","Druid.io"]
code: def convert_dttm(
      cls,
      target_type: str,
      dttm: datetime,
      db_extra: dict[str, Any] | None = None,
  ) -> str | None:
      sqla_type = cls.get_sqla_column_type(target_type)
  
      if isinstance(sqla_type, types.Date):
          return (
              f"CAST(TIME_PARSE('{dttm.date().isoformat()}') AS DATE)"
          )
      if isinstance(sqla_type, (types.DateTime, types.TIMESTAMP)):
          return (
              f"""TIME_PARSE('{dttm.isoformat(timespec="seconds")}')"""
          )
      return None
  
file_path: superset/superset/db_engine_specs/druid.py
imports: from __future__ import annotations
  import json
  import logging
  from datetime import datetime
  from typing import Any, TYPE_CHECKING
  from sqlalchemy import types
  from superset import is_feature_enabled
  from superset.constants import TimeGrain
  from superset.db_engine_specs.base import BaseEngineSpec
  from superset.db_engine_specs.exceptions import SupersetDBAPIConnectionError
  from superset.exceptions import SupersetException
  from superset.utils import core
label_desc: Use image node_id 3 for calling the DruidEngineSpec obj's underlying member method code with example usage: obj.convert_dttm(cls, target_type, dttm, db_extra) and returns: None, str, dttm, str, str, dttm, str