Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def random_date():
|
|
| 10 |
return (start_date + timedelta(days=random_days)).strftime("%Y-%m-%d")
|
| 11 |
|
| 12 |
# Function to load and cache the product catalog
|
| 13 |
-
@st.
|
| 14 |
def load_catalog():
|
| 15 |
products = {
|
| 16 |
# Products and categories as defined previously...
|
|
@@ -19,7 +19,7 @@ def load_catalog():
|
|
| 19 |
return pd.DataFrame(products)
|
| 20 |
|
| 21 |
# Cached function for filtering the catalog
|
| 22 |
-
@st.
|
| 23 |
def filter_catalog(catalog, category=None, cyber_approved=None, accessibility_approved=None, privacy_approved=None, search_query=None):
|
| 24 |
filtered = catalog
|
| 25 |
if category:
|
|
@@ -37,6 +37,18 @@ def filter_catalog(catalog, category=None, cyber_approved=None, accessibility_ap
|
|
| 37 |
# Load the catalog
|
| 38 |
catalog = load_catalog()
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Streamlit app layout
|
| 41 |
st.title("Enterprise Software Product Catalog")
|
| 42 |
st.write("This is the source of truth for app approval statuses within the enterprise.")
|
|
|
|
| 10 |
return (start_date + timedelta(days=random_days)).strftime("%Y-%m-%d")
|
| 11 |
|
| 12 |
# Function to load and cache the product catalog
|
| 13 |
+
@st.cache_data
|
| 14 |
def load_catalog():
|
| 15 |
products = {
|
| 16 |
# Products and categories as defined previously...
|
|
|
|
| 19 |
return pd.DataFrame(products)
|
| 20 |
|
| 21 |
# Cached function for filtering the catalog
|
| 22 |
+
@st.cache_data
|
| 23 |
def filter_catalog(catalog, category=None, cyber_approved=None, accessibility_approved=None, privacy_approved=None, search_query=None):
|
| 24 |
filtered = catalog
|
| 25 |
if category:
|
|
|
|
| 37 |
# Load the catalog
|
| 38 |
catalog = load_catalog()
|
| 39 |
|
| 40 |
+
|
| 41 |
+
# Assuming load_catalog is defined and loads data correctly
|
| 42 |
+
catalog = load_catalog()
|
| 43 |
+
|
| 44 |
+
# Quick check to ensure 'Category' column exists
|
| 45 |
+
if 'Category' not in catalog.columns:
|
| 46 |
+
st.error("The 'Category' column is missing from the DataFrame.")
|
| 47 |
+
else:
|
| 48 |
+
category = st.sidebar.multiselect("Filter by Category", options=catalog["Category"].unique())
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
# Streamlit app layout
|
| 53 |
st.title("Enterprise Software Product Catalog")
|
| 54 |
st.write("This is the source of truth for app approval statuses within the enterprise.")
|