diff --git a/api/api_v1/endpoints/query.py b/api/api_v1/endpoints/query.py index 42a694c..d5a4efb 100644 --- a/api/api_v1/endpoints/query.py +++ b/api/api_v1/endpoints/query.py @@ -94,8 +94,11 @@ async def event_model_export(request: Request, event_name = item['event_name'] df = await ckdb.query_dataframe(sql) if 'date' in df: - df.sort_values('date',inplace=True) - df['date'] = df['date'].dt.tz_localize(None) + df.sort_values('date', inplace=True) + try: + df['date'] = df['date'].dt.tz_localize(None) + except: + pass excels.append((df, event_name)) df_to_stream = DfToStream(*excels) with df_to_stream as d: