Nipun Claude commited on
Commit
318ac03
·
1 Parent(s): b024b50

Fix dataframe CSV download functionality

Browse files

- Simplified st.dataframe to use built-in download feature properly
- Added hide_index=True parameter to enable CSV download button
- Removed custom download implementation in favor of native functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. app.py +6 -15
app.py CHANGED
@@ -481,21 +481,12 @@ def show_custom_response(response):
481
  </div>
482
  """, unsafe_allow_html=True)
483
 
484
- # Display dataframe with download option
485
- st.dataframe(content, use_container_width=True)
486
-
487
- # Add download button for CSV
488
- import io
489
- csv_buffer = io.StringIO()
490
- content.to_csv(csv_buffer, index=False)
491
- csv_data = csv_buffer.getvalue()
492
-
493
- st.download_button(
494
- label="📥 Download as CSV",
495
- data=csv_data,
496
- file_name=f"vayuchat_data_{datetime.now().strftime('%Y%m%d_%H%M%S')}.csv",
497
- mime="text/csv",
498
- use_container_width=True
499
  )
500
 
501
  # Show generated code with Streamlit expander
 
481
  </div>
482
  """, unsafe_allow_html=True)
483
 
484
+ # Display dataframe with built-in download functionality
485
+ st.dataframe(
486
+ content,
487
+ use_container_width=True,
488
+ hide_index=True,
489
+ column_config=None
 
 
 
 
 
 
 
 
 
490
  )
491
 
492
  # Show generated code with Streamlit expander