CCockrum commited on
Commit
a832ee9
·
verified ·
1 Parent(s): 4c9126e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -81,7 +81,12 @@ st.markdown("""
81
  margin-top: 1.5rem;
82
  font-weight: 600;
83
  }
84
-
 
 
 
 
 
85
 
86
  </style>
87
  """, unsafe_allow_html=True)
@@ -209,14 +214,15 @@ if fetch_data:
209
  metadata_df = pd.DataFrame(items)
210
 
211
  # Define custom completeness check
 
212
  def is_incomplete(value):
213
  return pd.isna(value) or value in ["", "N/A", "null", None]
214
 
215
- # Create mask for incomplete rows
216
- incomplete_mask = metadata_df.applymap(is_incomplete).any(axis=1)
217
  incomplete_count = incomplete_mask.sum()
218
 
219
- # Fill in the Quick Stats placeholder
220
  if not metadata_df.empty:
221
  stats_html = f"""
222
  <div class="sidebar-stats">
@@ -228,6 +234,7 @@ if fetch_data:
228
  stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
229
 
230
 
 
231
  st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
232
 
233
  # Utility functions for deeper metadata quality analysis
 
81
  margin-top: 1.5rem;
82
  font-weight: 600;
83
  }
84
+ .sidebar-contrast-block {
85
+ background-color: #2b2b2b !important; /* Slightly lighter than #1A1A1A */
86
+ padding: 1.25rem;
87
+ border-radius: 10px;
88
+ margin-top: 1.5rem;
89
+ }
90
 
91
  </style>
92
  """, unsafe_allow_html=True)
 
214
  metadata_df = pd.DataFrame(items)
215
 
216
  # Define custom completeness check
217
+ # Define completeness logic
218
  def is_incomplete(value):
219
  return pd.isna(value) or value in ["", "N/A", "null", None]
220
 
221
+ # New way to calculate incomplete record mask
222
+ incomplete_mask = metadata_df.apply(lambda row: row.map(is_incomplete), axis=1).any(axis=1)
223
  incomplete_count = incomplete_mask.sum()
224
 
225
+ # Display in sidebar
226
  if not metadata_df.empty:
227
  stats_html = f"""
228
  <div class="sidebar-stats">
 
234
  stats_placeholder.markdown(stats_html, unsafe_allow_html=True)
235
 
236
 
237
+
238
  st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
239
 
240
  # Utility functions for deeper metadata quality analysis