Jiang Copilot commited on
Commit
352b367
·
unverified ·
1 Parent(s): 7747dc2

Update logging_helper.py

Browse files

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Files changed (1) hide show
  1. logging_helper.py +4 -2
logging_helper.py CHANGED
@@ -358,8 +358,10 @@ class LoggingHelper:
358
  print(f"[refresh] Filtering logs from {from_date} to {to_date}")
359
  # 创建日期范围过滤条件
360
  filter_condition = pd.Series([True] * len(df), index=df.index)
361
- filter_condition = filter_condition & (df["timestamp"] >= from_date)
362
- filter_condition = filter_condition & (df["timestamp"] < to_date)
 
 
363
  df = df[filter_condition]
364
  # 按timestamp降序排序(最新日志在前)
365
  df = df.sort_values(by="timestamp", ascending=False)
 
358
  print(f"[refresh] Filtering logs from {from_date} to {to_date}")
359
  # 创建日期范围过滤条件
360
  filter_condition = pd.Series([True] * len(df), index=df.index)
361
+ if from_timestamp is not None:
362
+ filter_condition = filter_condition & (df["timestamp"] >= from_timestamp)
363
+ if to_timestamp is not None:
364
+ filter_condition = filter_condition & (df["timestamp"] < to_timestamp)
365
  df = df[filter_condition]
366
  # 按timestamp降序排序(最新日志在前)
367
  df = df.sort_values(by="timestamp", ascending=False)