code: def create_dataframe_msg(df: Data, id: int = 1) -> ForwardMsg:
      """Create a mock legacy_data_frame ForwardMsg."""
      msg = ForwardMsg()
      msg.metadata.delta_path[:] = make_delta_path(
          RootContainer.SIDEBAR, (), id
      )
      arrow.marshall(msg.delta.new_element.arrow_data_frame, df)
      return msg
  
imports: from streamlit.cursor import make_delta_path
  from streamlit.elements import arrow
  from streamlit.elements.arrow import Data
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.proto.RootContainer_pb2 import RootContainer
label_desc: Use image node_id 1 for calling a global function with example usage: create_dataframe_msg(df, id) and returns: msg