Skip to content

Commit 08572ce

Browse files
committed
Config now loads report filter parameters from file
1 parent 2b793d5 commit 08572ce

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/browsergym/workarena/config.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from importlib import resources
2+
from json import load as json_load
3+
from os.path import exists
24

35
from ..workarena import data_files
46
from ..workarena.tasks import utils
@@ -25,6 +27,10 @@
2527
REPORT_RETRIEVAL_VALUE_CONFIG_PATH = str(
2628
resources.files(data_files).joinpath("task_configs/report_retrieval_value_task.json")
2729
)
30+
# ... data filter for report tasks
31+
REPORT_FILTER_CONFIG_PATH = str(
32+
resources.files(data_files).joinpath("task_configs/report_data_filter_config.json")
33+
)
2834

2935
# Path to knowledge base task configurations
3036
KB_CONFIG_PATH = str(
@@ -224,4 +230,11 @@
224230

225231
# Report date filter patch flag
226232
REPORT_PATCH_FLAG = "WORKARENA_DATE_FILTER_PATCH"
227-
REPORT_DATE_FILTER = "2025-07-15"
233+
if exists(REPORT_FILTER_CONFIG_PATH):
234+
with open(REPORT_FILTER_CONFIG_PATH, "r") as file:
235+
report_filter_config = json_load(file)
236+
REPORT_DATE_FILTER = report_filter_config.get("report_date_filter", None)
237+
REPORT_TIME_FILTER = report_filter_config.get("report_time_filter", None)
238+
else:
239+
REPORT_DATE_FILTER = None
240+
REPORT_TIME_FILTER = None

0 commit comments

Comments
 (0)