code: def _pydantic_column_type(pydantic_type: Any) -> Any:
      """This function enables to support JSON types with SQLModel.
  
      Example::
  
          from sqlmodel import SQLModel
          from sqlalchemy import Column
  
          class TrialConfig(SQLModel, table=False):
              ...
              params: Dict[str, Union[Dict[str, float]] = Field(sa_column=Column(pydantic_column_type[Dict[str, float]))
  
      """
  
      class PydanticJSONType(TypeDecorator, Generic[T]):
          impl = JSON()
  
          def __init__(
              self,
              json_encoder=json,
          ):
              self.json_encoder = json_encoder
              super().__init__()
  
          def bind_processor(self, dialect):
              impl_processor = self.impl.bind_processor(dialect)
              dumps = self.json_encoder.dumps
              if impl_processor:
  
                  def process(value: T):
                      if value is not None:
                          if isinstance(pydantic_type, ModelMetaclass):
                              # This allows to assign non-InDB models and if they're
                              # compatible, they're directly parsed into the InDB
                              # representation, thus hiding the implementation in the
                              # background. However, the InDB model will still be returned
                              value_to_dump = pydantic_type.from_orm(
                                  value
                              )
                          else:
                              value_to_dump = value
                          value = jsonable_encoder(value_to_dump)
                      return impl_processor(value)
  
              else:
  
                  def process(value):
                      if isinstance(pydantic_type, ModelMetaclass):
                          # This allows to assign non-InDB models and if they're
                          # compatible, they're directly parsed into the InDB
                          # representation, thus hiding the implementation in the
                          # background. However, the InDB model will still be returned
                          value_to_dump = pydantic_type.from_orm(value)
                      else:
                          value_to_dump = value
                      return dumps(jsonable_encoder(value_to_dump))
  
              return process
  
          def result_processor(self, dialect, coltype) -> T:
              impl_processor = self.impl.result_processor(
                  dialect, coltype
              )
              if impl_processor:
  
                  def process(value):
                      value = impl_processor(value)
                      if value is None:
                          return None
  
                      data = value
                      # Explicitly use the generic directly, not type(T)
                      return parse_obj_as(pydantic_type, data)
  
              else:
  
                  def process(value):
                      if value is None:
                          return None
  
                      # Explicitly use the generic directly, not type(T)
                      return parse_obj_as(pydantic_type, value)
  
              return process
  
          def compare_values(self, x, y):
              return x == y
  
      return PydanticJSONType
  
imports: import functools
  import json
  import pathlib
  from typing import Any, Dict, Generic, List, Type, TypeVar
  from fastapi import Response, status
  from fastapi.encoders import jsonable_encoder
  from lightning_utilities.core.imports import RequirementCache
  from pydantic import BaseModel, parse_obj_as
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.imports import _is_sqlmodel_available
label_desc: Use image node_id 1 for calling a global function with example usage: _pydantic_column_type(pydantic_type) and returns: PydanticJSONType, process, process, unknown, impl_processor, dumps, parse_obj_as, parse_obj_as, None, None