browsergym-workarena 0.4.3__py3-none-any.whl → 0.4.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- __version__ = "0.4.3"
1
+ __version__ = "0.4.4"
2
2
 
3
3
  import inspect
4
4
  from logging import warning
@@ -0,0 +1,66 @@
1
+ from .utils import table_api_call
2
+
3
+
4
+ def set_sys_property(instance, property_name: str, value: str):
5
+ """
6
+ Set a sys_property in the instance.
7
+
8
+ Parameters:
9
+ -----------
10
+ instance: SNowInstance
11
+ The instance to set the property in
12
+ property_name: str
13
+ The name of the property to set
14
+ value: str
15
+ The value to set for the property
16
+
17
+ """
18
+
19
+ property = table_api_call(
20
+ instance=instance,
21
+ table="sys_properties",
22
+ params={"sysparm_query": f"name={property_name}", "sysparm_fields": "sys_id"},
23
+ )["result"]
24
+
25
+ if not property:
26
+ property_sysid = ""
27
+ method = "POST"
28
+ else:
29
+ property_sysid = "/" + property[0]["sys_id"]
30
+ method = "PUT"
31
+
32
+ property = table_api_call(
33
+ instance=instance,
34
+ table=f"sys_properties{property_sysid}",
35
+ method=method,
36
+ json={"name": property_name, "value": value},
37
+ )
38
+
39
+ # Verify that the property was updated
40
+ assert property["result"]["value"] == value, f"Error setting {property_name}."
41
+
42
+
43
+ def get_sys_property(instance, property_name: str) -> str:
44
+ """
45
+ Get a sys_property from the instance.
46
+
47
+ Parameters:
48
+ -----------
49
+ instance: SNowInstance
50
+ The instance to get the property from
51
+ property_name: str
52
+ The name of the property to get
53
+
54
+ Returns:
55
+ --------
56
+ str
57
+ The value of the property
58
+
59
+ """
60
+ property_value = table_api_call(
61
+ instance=instance,
62
+ table="sys_properties",
63
+ params={"sysparm_query": f"name={property_name}", "sysparm_fields": "value"},
64
+ )["result"][0]["value"]
65
+
66
+ return property_value
@@ -1,4 +1,6 @@
1
1
  from importlib import resources
2
+ from json import load as json_load
3
+ from os.path import exists
2
4
 
3
5
  from ..workarena import data_files
4
6
  from ..workarena.tasks import utils
@@ -224,4 +226,4 @@ EXPECTED_REQUEST_ITEM_FORM_FIELDS_PATH = str(
224
226
 
225
227
  # Report date filter patch flag
226
228
  REPORT_PATCH_FLAG = "WORKARENA_DATE_FILTER_PATCH"
227
- REPORT_DATE_FILTER = "2025-07-15"
229
+ REPORT_FILTER_PROPERTY = "workarena.report.filter.config"