Getting an error attachment_filename does not exist in my docker environment

Solution
return send_file (io.BytesIO(buf_str.read().encode("utf-8")), mimetype="text/csv", download_name="data.csv" )
@app.route('/download')
def dwnlnd()
    jsnx = session['mydata']
    df = pd.DataFrame.from_dict(jsnx)
    caldf = df.to_csv(index=False, header=True)
    buf_str = io.StringIO(caldf)
    return send_file (io.BytesIO(buf_str.read().encode("utf-8")), mimetype="text/csv", download_name="data.csv" )