Spaces:
Running
Running
Jiang
Copilot
commited on
Update logging_helper.py
Browse filesCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- 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 |
-
|
| 362 |
-
|
|
|
|
|
|
|
| 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)
|