From 0ed3a2d50acdfe144336b6f232e7943292c0e628 Mon Sep 17 00:00:00 2001 From: Ovler Date: Wed, 20 Nov 2024 03:53:59 -0500 Subject: [PATCH] fix: add error handling for empty metadata fetch in Streamlit display yzqzss, bad! --- src/ia_collection_analyzer/streamlit.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ia_collection_analyzer/streamlit.py b/src/ia_collection_analyzer/streamlit.py index e73aa05f..4b691876 100644 --- a/src/ia_collection_analyzer/streamlit.py +++ b/src/ia_collection_analyzer/streamlit.py @@ -42,6 +42,9 @@ ) items = fetch_metadata(collection_id) items_pd = pd.DataFrame(items) + if items_pd.empty: + st.error("Failed to fetch metadata for the collection. Please check the collection ID.") + st.stop() data_transform_text = st.text("cleaning data...") # drop columns with 80%+ nan