def create_parameter_info(metadata: FunctionMetadata) -> list["FunctionParameterInfo"]:
    """
    Creates a list of FunctionParameterInfo objects from the metadata.

    Args:
        metadata: The metadata object containing parameter information.

    Returns:
        A list of FunctionParameterInfo objects.
    """

    from unitycatalog.client.models import FunctionParameterInfo

    parameters = []
    for param_info in metadata.parameters:
        # Remove when Unity Catalog OSS supports VARIANT TYPE
        if param_info["sql_type"] == "VARIANT":
            raise ValueError(
                "Variant type is not supported for function parameters. "
                "Please use a concrete type instead in your function signature. "
                f"Argument {param_info['name']} uses an unsupported type."
            )
        type_json_dict = {
            "name": param_info["name"],
            "type": param_info["base_type_name"].lower(),
            "nullable": param_info["parameter_default"] is not None,
            "metadata": {"comment": param_info["comment"] or ""},
        }
        type_json_str = json.dumps(type_json_dict)

        function_param_info = FunctionParameterInfo(
            name=param_info["name"],
            type_name=param_info["base_type_name"],
            type_text=param_info["sql_type"],
            type_json=type_json_str,
            position=param_info["position"],
            parameter_default=param_info["parameter_default"],
            comment=param_info["comment"],
        )
        parameters.append(function_param_info)
    return parameters

    Creates a list of FunctionParameterInfo objects from the metadata.

    Args:
        metadata: The metadata object containing parameter information.

    Returns:
        A list of FunctionParameterInfo objects.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils_oss.py