Skip to content

pyegeria 6.2.35: restricted report specs, SavedQuery delete, Smart Collections by catalog target, dashboard Report params - #587

Merged
dwolfson merged 23 commits into
odpi:mainfrom
dwolfson:release/6.2.35
Nov 11, 2026
Merged

dwolfson merged 23 commits into
odpi:mainfrom
dwolfson:release/6.2.35

Conversation

@dwolfson

Copy link
Copy Markdown
Member

pyegeria 6.2.35

One release branch, assembled on v6.2.34 (020d3b2) with the merge parents recorded:

  • B6: restricted report specs per user. list_visible_restricted_specs reads the specs a signed-in user can see, cached by credential. They never enter a shared cache.
  • ISSUE-183: deleting a SavedQuery. saved_query.delete_saved_query(client, guid) is new; pyegeria had no SavedQuery delete before.
    • It refuses unless the element is a SavedQuery, and deletes nothing in that case.
    • It detaches each SmartQuery-linked ResultsSet first, reading every page until an empty one, then deletes the query. The ResultsSets are kept and named in the result.
  • ISSUE-184: Smart Collection detection. A SavedQuery counts as a Smart Collection only when its SmartQuery-linked ResultsSet is a catalog target ("resultsSetToMaintain") of an integration connector. The Portal's own flag no longer decides it.
    • An unrefreshed Smart Collection reads "not refreshed yet", never an empty answer.
  • Dashboard Report parameters fixed. The dashboard resolver now maps a Report's stored camelCase parameters and analyticParams to the spec's snake_case names. Before this, every stored parameter was dropped, so collection-scoped tiles failed.

See docs/release-notes/6.2.35.md.

Checks

  • 3.13 micro-tests on this branch (814a263) on laz: 3000 tests, 0 failures, 0 errors, 3 skipped.
  • Architect read-backs: PASS on the assembled head, on each fix, and on a live tile proof. All 29 report tiles across 7 sheets were run on 6.2.34 and on this head: 27 behave identically, and the 2 collection-scoped tiles now run instead of failing.

After merge, the v6.2.35 tag goes on the squash commit, and the owner approves the PyPI release environment.

🤖 Generated with Claude Code

…t (W2)

Brief W2 (2026-11-10): a trend must never show a capped count as a
measured value.

Finding first (read-only on laz, and in Egeria's source): the live trend
200, 200, 1065 is true. Egeria's native count honours asOfTime
(countMetadataElements passes it to the repository's SQL COUNT).
GlossaryTerm is 200 up to 96 h ago and 1061 from 72 h ago. Paged finds at
45 days end at 200 for page sizes 70, 200 and 1000, and Asset reads 288 on
the same dates. count_elements never returned the find cap anyway; what was
missing was the per-point truth.

- _element_count records how each count was answered (native, find,
  find-capped, not-measured) for an enclosing _recording_how().
- metric_trend: each point carries measurement {exact, capped, at_least,
  how, reasons}; a scalar point also carries display ("200", "≥500" for a
  lower bound, "not measured"). Notes still reach an enclosing
  recording_unmeasured(). New strict=True is passed to a target that takes
  strict, and raises TrendNotExact if any point is not exact.
- SERIES: a trend whose only inexact points are lower bounds is drawn, each
  bound plotted at its bound with a "≥N" text layer and tooltip, subtitled
  "N of M points are lower bounds". A point with no number still withholds
  the chart. BAR, PIE and DICT are unchanged.
- Registry: metric_trend declares strict, display and measurement.

Tests (fakes that answer like Egeria): the live shape exact and native at
every point; a refused asOfTime count giving lower bounds (viewer) or
not-measured (repository); a short find page exact; strict raising and
passed through; a failed snapshot; a dict target; the SERIES chart exact,
bounded (marked) and withheld; no bound shown without its marker in
SERIES, BAR or DICT.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ort (Route B)

Brief BRIEF-USEFUL-SHEETS-AND-SAVED-QUERY-REPORTS-2026-11-10, Route B,
Builder 2 (owner: "Both routes").

saved_query(client, name, mode="cached"|"live", output="count"|"list"),
registered as an analytic function (inputs: EgeriaTech, the viewer's).
- Finds the SavedQuery by an exact qualifiedName find, as the viewer
  (zones apply). Missing, ambiguous, hidden or failed lookups are
  not_established with the reason, never 0.
- cached: Results Set members (from additionalProperties.resultsSetGuid),
  asOf lastRefreshedTime; never refreshed is not_established, not empty.
- live: runs the stored request with the viewer's token, paging to an
  empty page, at most 20 pages of 500. A stopped read is capped: value
  None, atLeast N, display "≥N".
- Security: the stored Query URL is checked, never followed. Its path must
  be the one allow-listed endpoint (metadata-expert by-search-conditions),
  relative or under this client's /servers/<view server>. An absolute URL
  is accepted only for this client's own scheme/host/port and view server
  (the shape the Portal stores). Another host, port, scheme, user info or
  view server, a query string or fragment, an encoded or dotted path, or a
  non-FindRequestBody body is refused with a sentence and nothing is sent.
  The call is pyegeria's own find_metadata_elements on the viewer's client.

Tests (48): the Portal's real SavedQuery shape (absolute same-origin
queryURL, JSON-string body, map additionalProperties); cached as-of, never
refreshed, empty, capped, no Results Set; the exact-QN lookup, a near miss,
missing and hidden; live paging, capped, list, refused and failed requests;
5 accepted URL forms and 20 refused ones, each proving the lookup was the
only call; refused bodies; the executor running it on the supply's
EgeriaTech. Registry coverage tests list saved_query (29 built-ins).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The "Collection Members" report spec required collection_guid, so a Report had
to pin a GUID, and its dashboard tile broke (CLIENT_ERROR_400) once the
collection was re-created. The spec now takes any one of collection_guid,
collection_qname or collection_name.

get_collection_members resolves a name through _resolve_collection_guid:
qualifiedName first, then display name. A name that matches nothing raises
PyegeriaNotFoundException (relatedHTTPCode 404) naming the collection, before
any members request. Before, a missing qualifiedName surfaced as "Neither
server_guid nor server_name were provided" and a missing display name was put
in the URL as the GUID "No elements found".

Report-spec seed rebuilt (External References.json).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…te (§9)

Brief §9 (owner: "parameterize a saved query rather than just run it
plain").

- additionalProperties.parameters declares {name, type string|int|bool|
  enum, default, required, values}; a bad declaration is refused.
- saved_query(..., params={...}) binds the given values plus defaults,
  typed. In the request body a placeholder is a whole value "{{name}}",
  replaced by the typed value: never concatenated, never in a key, never
  in the URL (which is not a template; the allow-list rule is unchanged).
- Refused with a sentence before anything runs: undeclared names, missing
  required values, wrong types, enum values outside the list, strings with
  control characters or "{{", placeholders in keys, inside longer strings
  or naming an unbound value, and params on a query that declares none.
  A URL or path in a string value is data only.
- Cached: one Results Set holds one answer, for the values its refresh
  recorded (additionalProperties.lastRefreshParams). It is returned only
  for exactly those values (defaults included), labelled "as of <time>,
  for k=v, ..."; other values, or none recorded, are refused with a
  pointer to live mode. Results carry params.

Tests (33 new, 81 in the file): typed substitution with quotes and braces
kept as data; defaults; int and bool types; 12 injection or mismatch
cases refused with only the lookup made; a URL in a value stays data; no
declaration; a required value; placeholders in a key, inside a string or
unbound; 7 bad declarations; the URL never a template; the cached label;
other values refused; the cache key including defaults; values not
recorded.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
BRIEF-PORTAL-SAVED-QUERY-SEEDABLE-2026-11-10: a seeded SavedQuery carries
its query, since the Portal's insights refresh re-runs `formula`
(formulaType egeria-insights-search-v1).

- Compact spec, edited through the Spec Editor API (Views & Reports):
  Formula and Formula Type added with definitions identical to the other
  families' (attribute definitions merge globally, last file wins), and
  appended to the Saved Query Base bundle. Validated by the API and by
  validate_compact_specs (0 errors).
- refresh_specs --merge-reports: the advanced Create_Saved_Query template,
  generated_format_sets.json, base_report_formats.py, dr_egeria_reports.py
  and the Views & Reports seed. The help file was regenerated but is not
  committed, as with earlier runs.
- Processor (skill step 3): SavedQueryProcessor set only typed fields and
  never read either attribute, so they would have been silently dropped.
  It now writes DataSetProperties' formula/formulaType on create and update.

Tests: the command spec has both attributes; create and update write them;
nothing is invented when they are absent. Not live-verified (an Egeria
write). Skill steps 4/5 (glossary --process, template propagation into
egeria-workspaces/trellis) are not run here.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
get_collection_members used collection_guid whenever it was present, so a
Report carrying a stale collectionGuid beside a new collectionQname (what a
merge update leaves) still asked Egeria for the dead GUID. Precedence is now
qualifiedName > display name > GUID: a given name is always resolved, and a
name that matches nothing is refused (not-found), never silently replaced by
the GUID. GUID-only calls are unchanged.

Tests: stale GUID + valid qualifiedName uses the qualifiedName; a display name
wins over a GUID; a qualifiedName wins over a display name; a valid GUID beside
a missing name is refused with no members request.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ne parameter model with the Portal)

Architect read-back READBACK-pyegeria-6.2.34-w2-routeB-params-formula
-2026-11-10.

P-1: the stored queryURL is checked and never followed, so its host is not
a boundary. The Portal stores it from inside its container
(https://host.docker.internal:9443/...), while EA, notebooks and the CLI
use localhost:9443, so every Portal-saved query was refused from them.
- A different http(s) scheme or host:port is now accepted and noted in the
  result's `how`; the call still goes to the viewer's own client.
- Still refused: user info, scheme-relative and non-http(s) URLs, query
  strings, fragments, encoded/dotted/double-slash paths, another view
  server, and paths off the allow-list.

P-2: the Portal (b9dce798) and pyegeria read the same `parameters`
declaration differently, and {{x}} placeholders would break the Smart
Collection (Egeria's connector runs queryRequestBody literally).
- There are no placeholders. Entries are {name, type, default?,
  searchPath?, requestPath?}, with the Portal's types (string, integer,
  number, boolean, list) and no coercion.
- One effective-value rule with the Portal: the value given, else the
  stored search value at searchPath (formula, else searchSpec), else the
  default. Cached answers are compared with lastRefreshParams on that map,
  so a stored value that differs from the default no longer causes a false
  refusal.
- Live: values are applied at requestPath, typed, as values only, on a
  copy. A parameter with no requestPath is refused live when given, or
  when its value would be its default.
- The shared Portal-shaped fixture is
  tests/micro-tests/data/portal_saved_query_parameters_2026_11_10.json
  (copy it into the Portal tests).

Tests (91 in the file): host.docker.internal from a localhost client, run
and noted; 19 refusals; the fixture's cached answer matching and labelled;
stored value over default; the default when the search has none; the
searchSpec fallback; searchPath; other values refused; the cache key on
every value; nothing recorded; live requestPath; live as stored; the
stored request unchanged; Portal-only parameters refused live; a nested
requestPath setting a value only; a path pointing nowhere; injections and
type mismatches; the Portal's types without coercion; no declaration; 10
bad declarations; the URL never parameterised.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ve values come from formula

Coordinator / Portal builder (fix/portal-saved-query-seedable @3afa0e82).

- The shared fixture replaces pyegeria's own:
  tests/micro-tests/data/saved_query_portal_shaped.json, byte-identical to
  the Portal's (sha256 c3a27fc3..., the version with P-3's
  lastRefresh, still uncommitted on the Portal side when copied). Its
  cases[] are the contract: _effective_parameters returns cases[].effective
  for each request.
- Live: every parameter's effective value (the value given, else the value
  at searchPath in formula, else the default) is set at its requestPath.
  It is never the value already in queryRequestBody, which can differ (the
  Portal strips paging from formula; queryRequestBody always says
  pageSize 500).
- A declared requestPath pageSize becomes the live read's page size. A
  requestPath of startFrom is refused, because the read owns where it
  starts.

Tests (92 in the file):
- the fixture's three cases as the effective-value contract;
- lastRefresh as the Portal's own map;
- the cached answer served only for the recorded values and labelled, each
  case served or refused by that rule, and other values refused;
- nothing recorded, and the searchSpec fallback;
- live refused while the Portal-only 'sort' is declared, or when it is
  given;
- live sending each case's effective values: asset_type, the deep
  min_level path, and page_size as the read's page size;
- formula, not the request body, as the stored value;
- the stored request never changed, startFrom refused, a path pointing
  nowhere, a string value kept as data;
- 8 injections and type mismatches, no declaration, 10 bad declarations.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…wers for its stored values

Architect P-3. A SavedQuery registered as a Smart Collection
(additionalProperties.smartCollection == "true", the Portal's
_is_registered_smart_collection) is re-run by Egeria's
SmartCollectionsMembershipManager about every 30 minutes from its STORED
queryRequestBody, with no overrides.

- Its cached answer stands only for the stored effective values (the
  Portal's rule with no request), whatever lastRefreshParams says. For
  other values it is refused with "is a Smart Collection, kept current by
  Egeria ... use mode live".
- It is labelled keptCurrentBy and "kept current by Egeria · as of <time>,
  for k=v", and needs no Portal refresh time ("no refresh time recorded").
- An unregistered query keeps the lastRefreshParams rule. Live mode is
  unchanged by registration.
- The fixture stays byte-identical to the Portal's (9ff668d1, P-3).

Tests (103 in the file): the unregistered rule on a copy marked
smartCollection false; for a registered query:
- served for the stored values and labelled kept current;
- each contract case served or refused;
- a refresh record naming other values ignored;
- no Portal refresh time needed;
- no parameters;
- live not limited by registration.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
w1-collection-members-by-qname: Collection Members takes the collection's
qualifiedName, and a collection name wins over a GUID (W1, W1-1).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
feat/saved-query-analytic: W2 trend points exact, saved_query (Route B)
with P-1, parameters in the Portal's model (P-2, P-3), and Formula / Formula
Type on Dr.Egeria Saved Query.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Version bump, uv lock and release notes: Collection Members by
qualifiedName (W1); saved_query, a saved query as the source of a Report
(Route B, with P-1 and parameters in the Portal's model); every trend point
says whether its number is exact (W2); Formula and Formula Type on
Dr.Egeria's Saved Query commands.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
PyegeriaUnauthorizedException always uses AUTHORIZATION_ERROR (401), so an
Egeria-wrapped 403 OPEN-METADATA-SECURITY-403-020 (element not visible to
the user) is logged as "AUTHORIZATION_ERROR_401 => User not authorized",
pointing at credentials. Filing only; proposed fix and test in the entry.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ON_ERROR_401 (ISSUE-182)

PyegeriaUnauthorizedException labelled every authorization failure 401
"User not authorized", so a zone-hidden element (OPEN-METADATA-SECURITY-
403-020) pointed at credentials. When Egeria's relatedHTTPCode is 403 it
now uses the new FORBIDDEN_ERROR: message_id AUTHORIZATION_ERROR_403,
message "HTTP Code: 403 <Egeria's message> (user `x`)", and sets
egeria_message_id. A transport or wrapped 401 is unchanged.

Unchanged: the class, related_http_code, and the token retry (transport
401 only; a 403 is never retried). The AUTHORIZATION_ERROR prefix and
"HTTP Code: 403" keep the Portal's text-matching _is_auth_error helpers
working. The 401/403 enum-name swap is left for a coordinated change:
AUTHORIZATION_ERROR_401 is matched as text in the Portal and trellis.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ricted specs (B6)

A shared cache never holds a zoned spec (§9). Tools that show restricted
specs read them per signed-in user with this function, as that user's
token, so Egeria's zone check decides what comes back. Nothing is cached
here; the caller caches per credential identity, never by bare user id.

Consumer folders are walked recursively with the existing _walk_folder;
zones are read from the full element when the listing lacks them; a
folder not found/unreadable is stated per folder, never an empty list.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
… a flag

saved_query treated a SavedQuery as a Smart Collection (kept current by
Egeria, answered only for its stored values) when its additionalProperties
said smartCollection == "true", the Portal's flag. It is now what Egeria
records: a Results Set linked to the SavedQuery by SmartQuery that is a
CatalogTarget of an IntegrationConnector under the target name
"resultsSetToMaintain" (SmartCollectionsCatalogTarget.CATALOG_TARGET,
Egeria #9200). That Results Set is the one read.

- _smart_collection_results_set(client, guid): two related-element reads,
  only in cached mode. A read that fails is not a registration; the query
  then takes the ordinary cached path, which answers only for the values
  its refresh recorded, so it is never wrong.
- Tests: a CatalogTarget related element captured read-only from a
  quickstart platform (fixture data/catalog_target_related_2026_11_11.json),
  with the Smart Collections case derived from it (names and target name
  only). The flag alone no longer registers; Egeria's Results Set is read;
  another connector's target, a non-connector end, and a failed lookup do
  not register; live mode never looks it up.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…eleting

pyegeria had no way to delete a SavedQuery that did not leave its Results
Set behind: a plain delete_asset leaves the SmartQuery link to an
independently anchored Results Set, which Egeria refuses to delete past
(OMAG-GENERIC-HANDLERS-403-005). The Portal does this by hand from its own
additionalProperties markers.

- saved_query.delete_saved_query(client, guid): finds every Results Set
  linked by SmartQuery from Egeria's relationships (the SavedQuery is end
  2), detaches each through the dedicated collection-manager endpoint
  (detach_smart_query), then deletes the SavedQuery. The Results Sets are
  kept and named in the result: deleting one also means unlinking its
  members and, for a Smart Collection, its catalog target.
- A link that cannot be detached stops the delete and raises with the
  reason; nothing is half done silently.
- Tests: order (every detach before the delete), no Results Set, a refused
  detach stops the delete, a GUID is required.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

# Conflicts:
#	pyegeria/view/saved_query.py
#	tests/micro-tests/test_saved_query_analytic.py
Version bump, uv lock and release notes: list_visible_restricted_specs, a
user's zone-restricted specs (B6); a Smart Collection detected by its
catalog target, not the Portal's flag (ISSUE-184); delete_saved_query
detaches a saved query's SmartQuery links before deleting it (ISSUE-183).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ction; delete guard and paging

From the Architect's read-backs of 6.2.35 @bcea343a and LD-2:

- dashboard_resolver: a Report's stored params (camelCase in
  additionalProperties) and analyticParams are passed to exec_report_spec in
  snake_case, the names specs declare; a key already snake_case is unchanged
  and wins. Collection-scoped tiles failed because every stored param was
  dropped ("'collectionQname' ignored -- it takes: collection_qname").
- saved_query: a registered Smart Collection is "as of" its Results Set's
  completionTime (Egeria stamps it on each refresh); with no refresh
  recorded anywhere it is not_established, "not refreshed yet", never 0. A
  Smart Collection lookup that cannot be made is said in the answer's note.
- delete_saved_query (REQUIRED in the read-back): the element is read and
  must be a SavedQuery, else refused with nothing deleted; SmartQuery links
  are read until an EMPTY page, and more than 40 pages is refused.
- Tests: test_dashboard_report_params.py (new); saved-query refresh state;
  delete type guard (UserIdentity, Report, Collection, not found,
  unreadable) and paging (120 links over 4 reads; over the bound refused).
- Release notes updated.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 854079d into odpi:main Nov 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant