def METHOD_NAME(
    self,
    body: "SupportsStr",
    *,  # keyword-only args:
    icon: Optional[str] = None,
) -> "DeltaGenerator":
    """Display warning message.
    Parameters
    ----------
    body : str
        The warning text to display.
    icon : str or None
        An optional, keyword-only argument that specifies an emoji to use as
        the icon for the alert. Shortcodes are not allowed, please use a
        single character instead. E.g. "🚨", "🔥", "🤖", etc.
        Defaults to None, which means no icon is displayed.
    Example
    -------
    >>> import streamlit as st
    >>>
    >>> st.warning('This is a warning', icon="⚠️")
    """
    alert_proto = AlertProto()
    alert_proto.body = clean_text(body)
    alert_proto.icon = validate_emoji(icon)
    alert_proto.format = AlertProto.WARNING
    return self.dg._enqueue("alert", alert_proto)