Skip to content

Commit 88bce00

Browse files
committed
Property to retrieve report filter
1 parent 5f841c9 commit 88bce00

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/browsergym/workarena/instance.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import json
12
import os
23
import requests
34
import re
45

56
from playwright.sync_api import sync_playwright
67
from typing import Optional
78

8-
from .config import SNOW_BROWSER_TIMEOUT
9+
from .config import SNOW_BROWSER_TIMEOUT, REPORT_FILTER_PROPERTY
910

1011

1112
class SNowInstance:
@@ -124,3 +125,25 @@ def release_version(self) -> str:
124125
browser.close()
125126

126127
return release_info
128+
129+
@property
130+
def report_filter_config(self) -> dict:
131+
"""
132+
Get the report filter configuration from the ServiceNow instance.
133+
134+
Returns:
135+
--------
136+
dict
137+
The report filter configuration, or an empty dictionary if not found.
138+
139+
"""
140+
from .api.system_properties import (
141+
get_sys_property,
142+
) # Import here to avoid circular import issues
143+
144+
try:
145+
config = get_sys_property(self, REPORT_FILTER_PROPERTY)
146+
config = json.loads(config)
147+
return config
148+
except Exception:
149+
return None

0 commit comments

Comments
 (0)