Spaces:
Sleeping
Sleeping
Update anlytics
Browse files- clients.py +8 -0
clients.py
CHANGED
@@ -387,6 +387,14 @@ def fetch_analytics_data(host, start_date=None, end_date=None):
|
|
387 |
|
388 |
df = pd.DataFrame(records)
|
389 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
# Filter by date range if specified
|
391 |
if start_date:
|
392 |
df = df[df['timestamp'] >= pd.to_datetime(start_date)]
|
|
|
387 |
|
388 |
df = pd.DataFrame(records)
|
389 |
|
390 |
+
# Debug: Display the DataFrame structure
|
391 |
+
st.write("Fetched DataFrame structure:", df.head())
|
392 |
+
|
393 |
+
# Check if DataFrame is empty
|
394 |
+
if df.empty:
|
395 |
+
st.warning("No data available for the specified date range.")
|
396 |
+
return df
|
397 |
+
|
398 |
# Filter by date range if specified
|
399 |
if start_date:
|
400 |
df = df[df['timestamp'] >= pd.to_datetime(start_date)]
|