Skip to content

Commit 31e7a67

Browse files
authored
docs(issues): ISSUE-123 count_elements returns 0 on any failure (#430)
Tracks #424. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
1 parent 6827983 commit 31e7a67

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

‎PYEGERIA_ISSUES.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,43 @@ Agreement.
11771177

11781178
---
11791179

1180+
### ISSUE-123: `overview_metrics.count_elements` (and `_find`/`_element_count`) return `0`/`[]` on any failure — a failed measurement is indistinguishable from a real zero
1181+
1182+
**Layer:** Pyegeria · **Status:** open · **Found:** 2026-10-04, while
1183+
making the portal's Egeria Overview stop showing confident numbers during
1184+
an outage · **GitHub:** odpi/egeria-python#424
1185+
1186+
**Root cause, from reading `pyegeria/view/overview_metrics.py` (6.1.28):**
1187+
1188+
- `_find(mgr, body, page_size)` wraps `find_metadata_elements` in a bare
1189+
`except Exception` and returns `[]`, logging only at `debug`.
1190+
- `_element_count(mgr, body, as_of)` tries the native count; if it is
1191+
unsupported *or raises*, it falls back to `len(_find(...))` — so a failed
1192+
query becomes `0`.
1193+
- `count_elements(...)`'s docstring states "0 on any failure (never
1194+
raises)". The callers `people_counts`, `usage_context_counts` and
1195+
`counts_by_type` inherit the same behaviour.
1196+
1197+
**Effect:** a dashboard cannot tell "there are 0 elements" from "Egeria
1198+
timed out / returned 401 / 500". An outage or auth failure renders as a
1199+
confident `0`. A fallback count that returns exactly the page size is also
1200+
only a lower bound, not a total, and is not flagged.
1201+
1202+
**Proposed fix:** return `None` on failure (or add a strict variant, e.g.
1203+
`count_elements(..., strict=True)` / `try_count_elements`, that raises or
1204+
returns `None`), keeping today's behaviour behind an explicit opt-in if
1205+
existing callers rely on it. Apply the same to `_find`/`_element_count` and
1206+
propagate `None` through `people_counts`, `usage_context_counts` and
1207+
`counts_by_type`. Log failures above `debug`. Flag a capped fallback count
1208+
as a lower bound.
1209+
1210+
**Workaround in egeria-workspaces:** the portal's Overview handler calls
1211+
`find_metadata_elements` directly and returns `None` for failed or capped
1212+
queries, rendering "Not measured" instead of `0` (odpi/egeria-workspaces
1213+
#601, #607).
1214+
1215+
---
1216+
11801217
### ISSUE-122: `AssetMaker.get_catalog_targets` / `get_catalog_target` send `metadataElementTypeName="CatalogTarget"` (a relationship type) — server rejects with OMAG-COMMON-400-019, surfaced as SERVER_ERROR_500
11811218

11821219
**Status: fixed on branch `fix/issue-122-catalog-target-type` (2026-10-04), pending PR/merge**

0 commit comments

Comments
 (0)