def METHOD_NAME(
    querystring: str, filename: Optional[str] = None
) -> pandas.DataFrame:
    """
    Query the exoplanet archive, optionally save results to disk, and return the
    result as a pandas dataframe.
    Args:
        querystring (str):
            Exact query string to use. Do not include format (csv will be specified).
            See: https://exoplanetarchive.ipac.caltech.edu/docs/TAP/usingTAP.html
            for details. A valid string is: "select+*+from+pscomppars"
        filename (str):
            Full path to save file.  If None (default) results are not written to disk.
            Data will be written in pickle format.
    Returns:
        pandas.DataFrame:
            Result of query
    """
    query = (
        """https://exoplanetarchive.ipac.caltech.edu/TAP/sync?"""
        """query={}&format=csv"""
    ).format(querystring)
    r = requests.get(query)
    data = pandas.read_csv(BytesIO(r.content))
    if filename is not None:
        data.to_pickle(filename)
    return data