Update app.py
Browse files
app.py
CHANGED
|
@@ -464,6 +464,9 @@ def main():
|
|
| 464 |
if 'recurrence' not in df.columns:
|
| 465 |
df['recurrence'] = [{} for _ in range(len(df))]
|
| 466 |
|
|
|
|
|
|
|
|
|
|
| 467 |
# Filters
|
| 468 |
col1, col2, col3 = st.columns(3)
|
| 469 |
with col1:
|
|
@@ -517,17 +520,18 @@ def main():
|
|
| 517 |
""", unsafe_allow_html=True)
|
| 518 |
|
| 519 |
# Recurrence Details
|
| 520 |
-
|
|
|
|
| 521 |
with st.expander("π Recurrence Details"):
|
| 522 |
-
st.write(f"**Type:** {
|
| 523 |
-
st.write(f"**Start Date:** {
|
| 524 |
-
if
|
| 525 |
-
st.write(f"**End Date:** {
|
| 526 |
else:
|
| 527 |
-
st.write(f"**Occurrences:** {
|
| 528 |
|
| 529 |
# Attachments
|
| 530 |
-
attachments = row
|
| 531 |
if attachments:
|
| 532 |
with st.expander(f"π Attachments ({len(attachments)})"):
|
| 533 |
for att in attachments:
|
|
|
|
| 464 |
if 'recurrence' not in df.columns:
|
| 465 |
df['recurrence'] = [{} for _ in range(len(df))]
|
| 466 |
|
| 467 |
+
# Convert NaN values to empty dictionaries
|
| 468 |
+
df['recurrence'] = df['recurrence'].apply(lambda x: x if isinstance(x, dict) else {})
|
| 469 |
+
|
| 470 |
# Filters
|
| 471 |
col1, col2, col3 = st.columns(3)
|
| 472 |
with col1:
|
|
|
|
| 520 |
""", unsafe_allow_html=True)
|
| 521 |
|
| 522 |
# Recurrence Details
|
| 523 |
+
recurrence = row.get('recurrence', {}) # Safely get recurrence
|
| 524 |
+
if recurrence.get('type') != "None":
|
| 525 |
with st.expander("π Recurrence Details"):
|
| 526 |
+
st.write(f"**Type:** {recurrence['type']}")
|
| 527 |
+
st.write(f"**Start Date:** {recurrence['original_date']}")
|
| 528 |
+
if recurrence.get('end_date'):
|
| 529 |
+
st.write(f"**End Date:** {recurrence['end_date']}")
|
| 530 |
else:
|
| 531 |
+
st.write(f"**Occurrences:** {recurrence.get('num_occurrences', 'N/A')}")
|
| 532 |
|
| 533 |
# Attachments
|
| 534 |
+
attachments = row.get('attachments', []) # Safely get attachments
|
| 535 |
if attachments:
|
| 536 |
with st.expander(f"π Attachments ({len(attachments)})"):
|
| 537 |
for att in attachments:
|