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]>
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
|
485 |
-
st.dataframe(
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
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
|