Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions commands/tech/gen_report_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
"anchor_id",
"anchor_scope_id",
"anchor_scope_ids",
# Create Dashboard Sheet's owner input: written as the Dashboard's Ownership classification, not a
# property, so a column for it would always be empty -- and an empty owner reads as "no owner".
"dashboard_owner",
"external_source_guid",
"external_source_name",
"for_duplicate_processing",
Expand Down
49 changes: 49 additions & 0 deletions docs/release-notes/6.2.31.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# pyegeria 6.2.31

## Changed

- **The Dashboard Sheet command help says where a sheet lives.** The Dr.Egeria templates and help for
`Create Dashboard Sheet`, `Link Report to Dashboard Sheet` and `Add Text on Dashboard Sheet` described a
sheet as a "local pyegeria-managed record". Since 6.2.29 a sheet is held in Egeria: a Dashboard with a
DisplayDataSchemaType, the sheet's DisplayDataContainer, and one DisplayDataField per placement. The
local JSON store is a fallback, written alone with `--local-only` or with no Egeria connection. The
three commands' descriptions, the `Dashboard Sheet Name` and `MD Content` attributes, and the
regenerated templates now say so. `Create Dashboard Sheet` and `Link Report to Dashboard Sheet` had no
description before.
- **`Create Dashboard Sheet` sets the Dashboard's owner, as `migrate` does (DB-3).** The sheet's
Dashboard gets an Ownership classification for the user the command runs as (in the Portal, by
default, its service user), or for the userId given in the
new Advanced attribute `Dashboard Owner` (the same meaning as `python -m pyegeria.view.dashboards
migrate --owner`). It is set once: a Dashboard that already has an owner keeps it, a re-run writes
nothing, and the output says "Ownership: unchanged (already owned)" (with a note when a different
owner was asked for). With `--local-only` or no Egeria connection nothing is set, and the output says
"Ownership: not written (local only)". Both commands use one implementation,
`DashboardSheetEgeriaWriter.ensure_ownership`. `Dashboard Owner` is not a column in the generated
report specs: the owner is held in the classification, not a property.
- **"Analytic Demo - Governance Coverage" says what it counts.** Its description, and the
`governed_coverage` registry entry, said "share of assets". It counts elements of **any type that the
caller can see** carrying any of the five governance classifications, by a paged find: not a share of
Assets, and not a percentage. The Overview's Governed tile is a different metric (Assets only, a native
repository-wide count, as a share of all Assets), so the two numbers differ by definition; the spec now
says so. The spec's label and heading are unchanged.
- **Semantic grounding counts distinct Assets.** `semantic_grounding` (and "Analytic Demo - Semantic
Grounding") returns six new fields:
- `groundedAssets`: the number of **distinct** Assets with a glossary term on it or on any of its
parts (tables, columns): a SemanticAssignment on the Asset itself, or on an element anchored to it. Live, terms are assigned to
Assets' columns, not to Assets directly, so a column's term grounds its Asset. The Asset is read
from the `anchor` each relationship end carries, with no extra reads. A deleted (memento) element
grounds nothing.
- `groundedAssetTotal`: the Asset total it divides by.
- `groundedAssetPct`: the share of Assets grounded.
- `groundedAssetNote`: why the share is empty, when it is.
- `groundingLinksNotOnAsset`: the links that ground no Asset (a term on a process, say), so none
silently drop out.
- `groundingLinksScanned`: the links the scan read, the ones you can see. It can be below
`groundingLinks` (the native, repository-wide count) by the links you cannot see.
Egeria cannot count distinct relationship ends natively, so the count comes from a scan of every
SemanticAssignment the caller can see, and the total is counted in that same (viewer) population.
When the viewer Asset total cannot be measured (it can time out on a large catalog),
`groundedAssetPct` is None and `groundedAssetNote` says why: never a viewer count over a repository
total. `groundingLinks` and `groundingPct` are unchanged: the native, repository-wide link count,
and links per hundred Assets (links, not Assets). The routine is now slower: a relationship scan
and a viewer Asset count run beside the two native counts.
38 changes: 29 additions & 9 deletions md_processing/data/compact_commands/commands_report_compact.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"default_value": "",
"valid_values": [],
"existing_element": "",
"description": "The unique name of a Dashboard Sheet \u2014 a local pyegeria-managed record (planned to become a Collection subtype in Egeria; see Container/ContainerDict in pyegeria.view._output_container_models for the current pre-Egeria model). Used both to define a new Dashboard Sheet's identity (Create Dashboard Sheet) and to reference an existing one (Link Report to Dashboard Sheet).",
"description": "The unique name of a Dashboard Sheet, held in Egeria as a Dashboard with its layout (a DisplayDataSchemaType, the sheet's DisplayDataContainer, and one DisplayDataField per placement). Used both to name a new Dashboard Sheet (Create Dashboard Sheet) and to refer to an existing one (Link Report to Dashboard Sheet, Add Text on Dashboard Sheet).",
"generated": false,
"style": "Simple",
"user_specified": true,
Expand All @@ -114,7 +114,7 @@
"min_cardinality": 1,
"max_cardinality": 1,
"level": "Basic",
"Journal Entry": "The unique name of a Container \u2014 a local pyegeria-managed record (see Container/ContainerDict in pyegeria.view._output_container_models), not an Egeria element. Used both to define a new Container's identity (Create Container) and to reference an existing one (Link Report to Container)."
"Journal Entry": "The unique name of a Container \u2014 a local pyegeria-managed record (see Container/ContainerDict in pyegeria.view._output_container_models), not an Egeria element. Used both to define a new Container's identity (Create Container) and to reference an existing one (Link Report to Container). 2026-11-10: wording updated -- since 6.2.29 the sheet is held in Egeria (\u00a78d chain); the local store is a fallback."
},
"Effective Time": {
"variable_name": "effective_time",
Expand Down Expand Up @@ -295,7 +295,7 @@
"default_value": "",
"valid_values": [],
"existing_element": "",
"description": "Markdown text to display at this placement \u2014 section headers, explanations, captions. Rendered as-is (mermaid fences supported), no Egeria element involved.",
"description": "Markdown text to display at this placement -- section headers, explanations, captions. Rendered as-is (mermaid fences supported). Held in Egeria as the placement's markdownContent.",
"generated": false,
"style": "Simple",
"user_specified": true,
Expand Down Expand Up @@ -1028,6 +1028,25 @@
"max_cardinality": 1,
"level": "Basic",
"Journal Entry": "2026-11-07 -- Egeria 6.3 report specs / measurements / dashboards (odpi/egeria#9432)."
},
"Dashboard Owner": {
"variable_name": "dashboard_owner",
"inUpdate": true,
"attr_labels": "",
"examples": "",
"default_value": "",
"valid_values": [],
"existing_element": "",
"description": "The userId that owns the sheet's Dashboard (its Ownership classification, owner type UserIdentity). Leave it empty for the user the command runs as (in the Portal, by default, its service user). Set once: a Dashboard that already has an owner keeps it. Not written to Egeria with --local-only or with no Egeria connection.",
"generated": false,
"style": "Simple",
"user_specified": true,
"unique": false,
"input_required": false,
"min_cardinality": 0,
"max_cardinality": 1,
"level": "Advanced",
"Journal Entry": "2026-11-10: added -- Create Dashboard Sheet sets Ownership the way `pyegeria.view.dashboards migrate --owner` does (DB-3)."
}
},
"bundles": {
Expand Down Expand Up @@ -1172,6 +1191,7 @@
"Dashboard Sheet Base": {
"inherits": "Collection Base",
"own_attributes": [
"Dashboard Owner",
"Dashboard Sheet Description",
"Dashboard Sheet Family",
"Dashboard Sheet Heading"
Expand Down Expand Up @@ -1313,7 +1333,7 @@
"Sheet"
],
"family": "Views & Reports",
"description": "",
"description": "Creates or updates a Dashboard Sheet: a named, ordered layout of report and text placements, held in Egeria as a Dashboard with its layout (a DisplayDataSchemaType, the sheet's DisplayDataContainer, and one DisplayDataField per placement). Re-running it updates the sheet in place. The local JSON store (PYEGERIA_DASHBOARD_SHEETS_STORE) is a fallback: with --local-only or no Egeria connection, only the store is written, and the command output says so.",
"verb": "Create",
"upsert": true,
"attach": false,
Expand All @@ -1325,14 +1345,14 @@
"OM_TYPE": "",
"bundle": "Dashboard Sheet Base",
"custom_attributes": [],
"Journal Entry": "Creates a named, ordered, nestable Dashboard Sheet \u2014 a local pyegeria-managed layout record (see Container/ContainerDict in pyegeria.view._output_container_models), NOT yet an Egeria element. PLANNED: Dashboard Sheet will become an Egeria Collection subtype \u2014 when that lands, this bundle (Dashboard Sheet Base) should switch BundleInherits from none to Collection Base (see /Command Specifications/Common Bundles/Collection Base), picking up Purpose + the full Referenceable/AuthoredReferenceable chain. Not immediate \u2014 until then this stays a local record: no upsert, no qualified name prefix, mirroring the Report command's own non-element-creation pattern. 2026-11-07: dropped the 'Dashboard' alias -- 'Create Dashboard' now creates an Egeria Dashboard (odpi/egeria#9432)."
"Journal Entry": "Creates or updates a Dashboard Sheet, written to Egeria as the \u00a78d chain: Dashboard (Dashboard::<name>) --Schema--> DisplayDataSchemaType --AttributeForSchema--> DisplayDataContainer (the sheet); placements are DisplayDataFields under it. Upsert by qualifiedName. 2026-11-07: dropped the 'Dashboard' alias -- 'Create Dashboard' now creates an Egeria Dashboard (odpi/egeria#9432). 2026-11-10: wording updated -- since 6.2.29 the sheet is held in Egeria (\u00a78d chain); the local store is a fallback."
},
"Link Report to Dashboard Sheet": {
"display_name": "",
"qn_prefix": "",
"alternate_names": [],
"family": "Views & Reports",
"description": "",
"description": "Places a Report into a Dashboard Sheet as an ordered placement, with layout hints (span and emphasis). In Egeria the placement is a DisplayDataField of the sheet, and the Report is linked from the Dashboard (DataSetContent). Re-running it with the same Report Name updates the placement in place. The Dashboard Sheet must already exist (Create Dashboard Sheet). The local JSON store (PYEGERIA_DASHBOARD_SHEETS_STORE) is a fallback: with --local-only or no Egeria connection, only the store is written, and the command output says so.",
"verb": "Link",
"upsert": false,
"attach": false,
Expand All @@ -1344,14 +1364,14 @@
"OM_TYPE": "",
"bundle": "Report to Dashboard Sheet Link Base",
"custom_attributes": [],
"Journal Entry": "Places a Report Spec (FormatSet) into a Dashboard Sheet as an ordered Placement, with layout hints (span/emphasis). A local pyegeria Container/Placement record, not an Egeria relationship \u2014 no upsert. The target Dashboard Sheet must already exist (created via Create Dashboard Sheet)."
"Journal Entry": "Places a Report into a Dashboard Sheet as an ordered placement (DisplayDataField, placementKind 'report'), with span/emphasis; the Report is linked by DataSetContent from the Dashboard. 2026-11-10: wording updated -- since 6.2.29 the sheet is held in Egeria (\u00a78d chain); the local store is a fallback."
},
"Add Text on Dashboard Sheet": {
"display_name": "",
"qn_prefix": "",
"alternate_names": [],
"family": "Views & Reports",
"description": "Places literal markdown text (a section header, explanation, or caption) into a Dashboard Sheet as an ordered Placement, alongside Report placements. A local pyegeria Placement record, not an Egeria element or relationship \u2014 no upsert. The target Dashboard Sheet must already exist (Create Dashboard Sheet).",
"description": "Places literal markdown text (a section header, explanation, or caption) into a Dashboard Sheet as an ordered placement, alongside Report placements. In Egeria the placement is a DisplayDataField of the sheet that holds the text. Re-running it with the same Placement Name updates it in place. The Dashboard Sheet must already exist (Create Dashboard Sheet). The local JSON store (PYEGERIA_DASHBOARD_SHEETS_STORE) is a fallback: with --local-only or no Egeria connection, only the store is written, and the command output says so.",
"verb": "Place",
"upsert": false,
"attach": false,
Expand All @@ -1363,7 +1383,7 @@
"OM_TYPE": "",
"bundle": "Text Placement Base",
"custom_attributes": [],
"Journal Entry": "Places a Report Spec (FormatSet) into a Dashboard Sheet as an ordered Placement, with layout hints (span/emphasis). A local pyegeria Container/Placement record, not an Egeria relationship \u2014 no upsert. The target Dashboard Sheet must already exist (created via Create Dashboard Sheet)."
"Journal Entry": "Places markdown text into a Dashboard Sheet as an ordered placement (DisplayDataField, placementKind 'text', markdownContent). 2026-11-10: wording updated -- since 6.2.29 the sheet is held in Egeria (\u00a78d chain); the local store is a fallback."
},
"Create Saved Query": {
"display_name": "Saved Query",
Expand Down
42 changes: 39 additions & 3 deletions md_processing/v2/dashboard_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,29 @@ async def ensure_sheet(self, sheet_name: str, heading: str, description: str = "
f"{sheet_container_qn(sheet_name)}")
return chain

async def ensure_ownership(self, dashboard_guid: Optional[str], qn: str, owner: str) -> str:
"""DB-3: the Dashboard's Ownership classification (owner = a userId), set once. A Dashboard that
already has an owner keeps it. No zone is set. Used by `Create Dashboard Sheet` and by
`python -m pyegeria.view.dashboards migrate`.

Returns "set", "unchanged" (already owned) or "planned" (dry run)."""
current = None if self._is_planned(dashboard_guid) else await self._find(qn)
existing = (((current or {}).get("elementHeader") or {}).get("ownership") or {})
if existing:
have = (existing.get("classificationProperties") or {}).get("owner")
self.actions.append(f"unchanged Ownership {qn}")
if have and have != owner:
self._note(f"Dashboard '{qn}' is already owned by '{have}'; its owner was not changed to '{owner}'.")
return "unchanged"
self.actions.append(f"classify Ownership {qn} (owner {owner})")
if self.dry_run:
return "planned"
await self.client.classification_manager._async_add_ownership_to_element(
dashboard_guid, {"class": "NewClassificationRequestBody",
"properties": {"class": "OwnershipProperties", "owner": owner,
"ownerTypeName": "UserIdentity", "ownerPropertyName": "userId"}})
return "set"

# ------------------------------------------------------------ placements

async def _resolve_report(self, report_name: str) -> Optional[str]:
Expand Down Expand Up @@ -786,23 +809,36 @@ async def apply_changes(self) -> str:
sheets = _load_store(path)
aliases = list(sheets[name].aliases) if name in sheets else []

# DB-3: owned by the user the command runs as (client.user_id; in the Portal, by default, its service
# user) unless Dashboard Owner names another userId; set once.
explicit_owner = attributes.get("Dashboard Owner", {}).get("value") or None
owner = explicit_owner or getattr(self.client, "user_id", None) or None
ownership = {}

async def _work(writer: DashboardSheetEgeriaWriter):
chain = await writer.ensure_sheet(name, heading, description, family, aliases)
self.parsed_output["guid"] = chain.dashboard_guid
if owner:
ownership["status"] = await writer.ensure_ownership(chain.dashboard_guid, dashboard_qn(name), owner)

writer, local_reason = await self._with_egeria(_work)

is_update = name in sheets
sheets.upsert(name, DashboardSheet(name=name, heading=heading, description=description, family=family))
sheets.save_to_json(path)
zones_note = ""
status_notes = ""
if local_reason:
# `name` stands in for the GUID (the sheet is in the local store only), so the base
# processor must not sync anything to Egeria with it.
self.parsed_output["guid"] = name
self.parsed_output["local_only"] = local_reason
if attributes.get("Zone Membership", {}).get("value"):
zones_note = "\n- **Zone Membership**: not written (local only)"
status_notes = "\n- **Zone Membership**: not written (local only)"
status_notes += "\n- **Ownership**: not written (local only)"
elif ownership.get("status") == "set":
status_notes = f"\n- **Ownership**: {owner}"
elif ownership.get("status") == "unchanged":
status_notes = "\n- **Ownership**: unchanged (already owned)"

verb_word = "Updated" if is_update else "Created"
logger.success(f"{verb_word} Dashboard Sheet '{name}' (local store {path}; Egeria: "
Expand All @@ -814,7 +850,7 @@ async def _work(writer: DashboardSheetEgeriaWriter):
f"- **Description**: {description or '_(none)_'}\n"
f"- **Family**: {family or '_(none)_'}\n"
f"- **Local store**: {path}"
f"{zones_note}"
f"{status_notes}"
f"{_egeria_section(writer, local_reason)}"
)

Expand Down
Loading
Loading