gooddata-eval 1.68.1.dev3__py3-none-any.whl → 1.68.1.dev4__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.
@@ -77,6 +77,8 @@ def _check_threshold(expected: CatalogMetricAlert, actual_args: dict) -> bool:
77
77
 
78
78
 
79
79
  def _check_trigger(expected: CatalogMetricAlert, actual_args: dict) -> bool:
80
+ if expected.operator == "ANOMALY":
81
+ return True
80
82
  exp_trigger = expected.trigger
81
83
  act_trigger = actual_args.get("trigger", actual_args.get("triggerMode", "ALWAYS"))
82
84
  if exp_trigger in _ALWAYS_TRIGGER_VALUES:
@@ -235,27 +237,42 @@ class AgenticAlertSummary:
235
237
  best: AlertRunResult
236
238
 
237
239
 
240
+ def _case_insensitive_get(d: dict, *keys: str) -> Any:
241
+ """Look up a value by key, preferring an exact match then a case-insensitive one."""
242
+ for k in keys:
243
+ if k in d:
244
+ return d[k]
245
+ lowered = {str(k).lower(): v for k, v in d.items()}
246
+ for k in keys:
247
+ if k.lower() in lowered:
248
+ return lowered[k.lower()]
249
+ return None
250
+
251
+
238
252
  def _normalize_expected_output(expected: dict) -> CatalogMetricAlert:
239
253
  """Parse expected_output dict into CatalogMetricAlert, accepting display-format or internal-format keys."""
240
- operator = expected.get("operator") or expected.get("Operator") or "GREATER_THAN"
241
- threshold = expected.get("threshold") or expected.get("Threshold")
242
- threshold_from = expected.get("threshold_from")
243
- threshold_to = expected.get("threshold_to")
244
- trigger = expected.get("trigger") or expected.get("Trigger") or "not specified"
245
-
246
- metric_id = expected.get("metric_id")
247
- if not metric_id and "Metric" in expected:
248
- m = re.search(r"\(([^)]+)\)\s*$", str(expected["Metric"]))
249
- if m:
250
- metric_id = m.group(1).strip()
251
-
252
- raw_recip = expected.get("recipients") or expected.get("Recipient(s)") or []
254
+ operator = _case_insensitive_get(expected, "operator") or "GREATER_THAN"
255
+ threshold = _case_insensitive_get(expected, "threshold")
256
+ threshold_from = _case_insensitive_get(expected, "threshold_from")
257
+ threshold_to = _case_insensitive_get(expected, "threshold_to")
258
+
259
+ trigger = _case_insensitive_get(expected, "trigger") or "not specified"
260
+ trigger = _TRIGGER_DISPLAY_TO_API.get(trigger, trigger)
261
+
262
+ metric_id = _case_insensitive_get(expected, "metric_id")
263
+ if not metric_id:
264
+ metric_disp = _case_insensitive_get(expected, "metric")
265
+ if metric_disp:
266
+ m = re.search(r"\(([^)]+)\)\s*$", str(metric_disp))
267
+ metric_id = m.group(1).strip() if m else None
268
+
269
+ raw_recip = _case_insensitive_get(expected, "recipients", "recipient(s)") or []
253
270
  if isinstance(raw_recip, str):
254
271
  recipients = [r.strip() for r in raw_recip.replace(";", ",").split(",") if r.strip()]
255
272
  else:
256
273
  recipients = list(raw_recip)
257
274
 
258
- filters = expected.get("filters") or expected.get("Time window/Filters")
275
+ filters = _case_insensitive_get(expected, "filters")
259
276
  if isinstance(filters, str) and any(kw in filters for kw in ("None", "All time")):
260
277
  filters = None
261
278
 
@@ -102,7 +102,7 @@ def _activated_skills(tool_call_events: list[ToolCallEvent]) -> list[str]:
102
102
  if tc.function_name != "set_skills":
103
103
  continue
104
104
  args = tc.parsed_arguments() or {}
105
- skills.extend(args.get("skills", []))
105
+ skills.extend(args.get("skill_names") or args.get("skills") or [])
106
106
  return list(set(skills))
107
107
 
108
108
 
@@ -71,7 +71,9 @@ def validate_cross_references(viz: CreatedVisualization) -> tuple[bool, list[str
71
71
  continue
72
72
  using_val = filter_dict.get("using", "")
73
73
  using_uri = _resolve_alias_to_uri(using_val, fields)
74
- if not using_uri.startswith(("metric/", "fact/")):
74
+ field_def = fields.get(using_val)
75
+ is_adhoc_agg = isinstance(field_def, AacQueryField) and bool(field_def.aggregation)
76
+ if not using_uri.startswith(("metric/", "fact/")) and not is_adhoc_agg:
75
77
  errors.append(
76
78
  f"ranking filter '{filter_key}': using='{using_val}' "
77
79
  f"resolves to '{using_uri}' — expected a metric/ or fact/ URI"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gooddata-eval
3
- Version: 1.68.1.dev3
3
+ Version: 1.68.1.dev4
4
4
  Summary: Evaluate the GoodData AI agent against your own questions and models.
5
5
  Project-URL: Source, https://github.com/gooddata/gooddata-python-sdk
6
6
  Author-email: GoodData <support@gooddata.com>
@@ -17,7 +17,7 @@ Classifier: Topic :: Scientific/Engineering
17
17
  Classifier: Topic :: Software Development
18
18
  Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.10
20
- Requires-Dist: gooddata-sdk~=1.68.1.dev3
20
+ Requires-Dist: gooddata-sdk~=1.68.1.dev4
21
21
  Requires-Dist: httpx<1.0,>=0.27
22
22
  Requires-Dist: orjson<4.0.0,>=3.9.15
23
23
  Requires-Dist: pydantic<3.0,>=2.6
@@ -8,13 +8,13 @@ gooddata_eval/core/config.py,sha256=c0lgsILU70VJejhJGSZJmyne8i2uNXDiZEXRRKJEOgs,
8
8
  gooddata_eval/core/connection.py,sha256=mh-Do5-Ti0-DXXikfCIH10eTTUbKuZUAS_sLoPNDJ5I,1229
9
9
  gooddata_eval/core/models.py,sha256=g7bi7OGxnADGidVQmJLNuvehddSoW_-4e4YhEFSSkKs,3989
10
10
  gooddata_eval/core/runner.py,sha256=vRo2SwRKRjkSNCp6tse4tSGRWC3zBPFdjAnM5rMg05M,8064
11
- gooddata_eval/core/scoring.py,sha256=eGn72OuPc_Hnm6oNmoWkr-HzFOJP06Yay7BRy6BEN9Q,5852
11
+ gooddata_eval/core/scoring.py,sha256=7ku48WEXtZl8EhowKikMiBmKfH7BDoZxHVvEOY8h3Rk,6007
12
12
  gooddata_eval/core/workspace.py,sha256=S8exiy5gpDtcRtT8-i2fIRALF34Pbo0J46xm8X_ldus,11846
13
13
  gooddata_eval/core/agentic/__init__.py,sha256=nPjJ9sbnJVvsAlo9QMQlnPFgLNTZRzy9-0IKlnRcU8Q,2671
14
14
  gooddata_eval/core/agentic/_catalog.py,sha256=eCaeyvLF-FCN0J3UnXSHaKtufU6HvrM2mxnmgyXsY1U,2085
15
15
  gooddata_eval/core/agentic/_langfuse.py,sha256=zJiZTz5xloWQBunwxXzdOY3NrA0S4QPFc6d3iB-cgkE,13432
16
- gooddata_eval/core/agentic/alert_skill.py,sha256=dOHEnE3823P4tx0FgoPcdPcu-i-qpju20LZFR6N8pBU,19138
17
- gooddata_eval/core/agentic/conversation.py,sha256=Ynq9Rg6vVXjpHRe76r34-KPISp-N9TZxm9rk2cNcibg,17513
16
+ gooddata_eval/core/agentic/alert_skill.py,sha256=h5i-GVJOAUzgMhIF5yGKIz7JL3f6QXKZAKz6gcN7vpY,19702
17
+ gooddata_eval/core/agentic/conversation.py,sha256=tTpN1AySPGDbYcpwY2G0J38lRYiU5sqvbdDJBOyPQHc,17542
18
18
  gooddata_eval/core/agentic/general_question.py,sha256=piPY5XOMjH4Xwl2qN0D5KWBL1RJjYaP63oX1eXp-7yU,7978
19
19
  gooddata_eval/core/agentic/guardrail.py,sha256=-vZg-jeL2LYKGaLesuu7Yg1AIEn-9bfDK130EMdw_7s,7865
20
20
  gooddata_eval/core/agentic/metric_skill.py,sha256=jFqVsxNEx-7IHa4v8aNLkDzD9OogDsgV4O3UJkiVDFw,11388
@@ -44,8 +44,8 @@ gooddata_eval/core/reporting/console.py,sha256=kCHt4sCSaSRh0ZWqaSEJOl6_Jgb6uiouS
44
44
  gooddata_eval/core/reporting/json_report.py,sha256=NIA_PvnZ0PbJnXz_zZauxc1gGnzqlLD_ouVqWeNmjtw,2837
45
45
  gooddata_eval/core/summary/__init__.py,sha256=U54lANKm34yjqm7dZL9KkGouPbwAaQWC9wiAmb5B5g4,32
46
46
  gooddata_eval/core/summary/http_client.py,sha256=dPArJ6zoCu1W9xmYXFA1WMDNsSOkhn3gaCpYgCUp3gk,2174
47
- gooddata_eval-1.68.1.dev3.dist-info/METADATA,sha256=ZGte7olPAbOw-BM69NnUhCskaAP4lSQRwwFTnapqJJM,9513
48
- gooddata_eval-1.68.1.dev3.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
49
- gooddata_eval-1.68.1.dev3.dist-info/entry_points.txt,sha256=28nFp5Viknx4haPYgzK9QHlwPFfC6rPF6RmjC2ht8EI,56
50
- gooddata_eval-1.68.1.dev3.dist-info/licenses/LICENSE.txt,sha256=LVfVlC9maU3K9lgMwdZnClQQsOIbOekdcdVKr9qzJtk,256836
51
- gooddata_eval-1.68.1.dev3.dist-info/RECORD,,
47
+ gooddata_eval-1.68.1.dev4.dist-info/METADATA,sha256=7eLGgge0gSIxqwAWeU3kPoPa4VjLC-WH0tQne-KWbS8,9513
48
+ gooddata_eval-1.68.1.dev4.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
49
+ gooddata_eval-1.68.1.dev4.dist-info/entry_points.txt,sha256=28nFp5Viknx4haPYgzK9QHlwPFfC6rPF6RmjC2ht8EI,56
50
+ gooddata_eval-1.68.1.dev4.dist-info/licenses/LICENSE.txt,sha256=LVfVlC9maU3K9lgMwdZnClQQsOIbOekdcdVKr9qzJtk,256836
51
+ gooddata_eval-1.68.1.dev4.dist-info/RECORD,,