def METHOD_NAME(
    self,
    query: str,
    params: Optional[Dict[str, Any]] = None,
    database: Optional[str] = None,
    custom_error: bool = True,
) -> DataFrame:
    if params is None:
        params = {}
    if database is None:
        database = self._database
    self._verify_connectivity()
    with self._driver.session(database=database) as session:
        try:
            result = session.run(query, params)
        except Exception as e:
            if custom_error:
                self.handle_driver_exception(session, e)
            else:
                raise e
        # Though pandas support may be experimental in the `neo4j` package, it should always
        # be supported in the `graphdatascience` package.
        warnings.filterwarnings(
            "ignore",
            message=r"^pandas support is experimental and might be changed or removed in future versions$",
        )
        df = result.to_df()
        notifications = result.consume().notifications
        if notifications:
            for notification in notifications:
                self._forward_cypher_warnings(notification)
        return df