Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d5b99a4
fix(view): an Egeria-held spec's analytic_binders warns as a local on…
dwolfson Nov 9, 2026
d39a0de
feat(view): a positive find-method allowlist for specs held in Egeria
dwolfson Nov 9, 2026
e2e8a8c
fix(view): repoint the two unrunnable built-in specs; census 0 unrunn…
dwolfson Nov 9, 2026
eb511d2
feat: search and get filters universal, checked and typed (6.2.28)
dwolfson Nov 9, 2026
883d33e
fix(view): Asset-Graph renders the asset graph in every format it dec…
dwolfson Nov 9, 2026
fe390e6
fix: report specs filter as named; hard-coded filters no longer collide
dwolfson Nov 9, 2026
90b168c
fix: Digital-Product-Catalog report spec filters by type
dwolfson Nov 9, 2026
5fbc3c4
feat(view): Asset-Graph is an edge table, with a shape per output format
dwolfson Nov 9, 2026
8988fd9
feat: one name for the type filters (metadata_element_type / _subtypes)
dwolfson Nov 9, 2026
9b0fffe
feat(view): Asset-Graph declares DICT/JSON for code, REPORT/HTML/MERM…
dwolfson Nov 9, 2026
88ab777
feat: generic-search report specs use ClassificationExplorer with the…
dwolfson Nov 9, 2026
137132c
fix: technology report specs match the technology exactly, ANDed serv…
dwolfson Nov 9, 2026
4cd0917
Merge origin/fix/egeria-held-binder-warning (9b0fffef) into feat/sear…
dwolfson Nov 9, 2026
4bbcc6c
feat: technology report specs take the technology as a run parameter …
dwolfson Nov 9, 2026
c564e3b
fix: technology match is exact but ignores case
dwolfson Nov 9, 2026
cb6b522
Merge upstream/main (#564, #565, #566) into feat/search-filter-kwargs
dwolfson Nov 9, 2026
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
50 changes: 48 additions & 2 deletions commands/tech/gen_report_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,47 @@ def _build_generated_formats(columns: List[Column], default_types: Optional[List
return formats


# Report specs whose find method is a generic, all-types search. Each gets its command's own
# type from OM_TYPE (OpenMetadataRoot when the command has none), so the spec cannot list every
# element of the repository -- and with '*' Egeria refuses an untyped search outright.
GENERIC_SEARCH_METHODS = {
"ClassificationExplorer.find_elements_by_property_value",
"MetadataExpert.find_metadata_elements_with_string",
}
_TYPE_FILTER_KEYS = {"metadata_element_type", "metadata_element_subtypes", "include_only_classified_elements",
"classification_names"}
GENERIC_PROPERTY_NAMES = ["displayName", "qualifiedName"]
TECHNOLOGY_COLUMN = Column(name="Deployed Implementation Type", key="deployed_implementation_type")


def _technology_for_command(cmd_key: str) -> Optional[str]:
"""The deployed implementation type a Create command's element is made with, from the same
table Dr.Egeria's create-from-template calls use ("Create UC Table Element" -> "uc_table")."""
from pyegeria.omvs.automated_curation import ELEMENT_TEMPLATE_TECHNOLOGY

m = re.fullmatch(r"Create (.+) Element", cmd_key.strip())
if not m:
return None
return ELEMENT_TEMPLATE_TECHNOLOGY.get(re.sub(r"\s+", "_", m.group(1).strip().lower()))


def _generic_search_constraints(cmd_key: str, cmd_obj: dict, find_method: str, constraints: dict) -> dict:
"""spec_params for a generic-search spec: the command's type (and technology), derived here."""
if find_method not in GENERIC_SEARCH_METHODS:
return constraints
out = dict(constraints or {})
if not _TYPE_FILTER_KEYS & set(out):
out["metadata_element_type"] = (cmd_obj.get("OM_TYPE") or "").strip() or "OpenMetadataRoot"
if find_method.startswith("ClassificationExplorer."):
out.setdefault("property_names", list(GENERIC_PROPERTY_NAMES))
technology = _technology_for_command(cmd_key)
if technology:
# A default, not a pin: the run parameter deployed_implementation_type (declared optional,
# so the Portal's run form shows it) overrides it, and "*" means any technology.
out.setdefault("default_deployed_implementation_type", technology)
return out


def _derive_target_type(cmd_key: str, cmd_obj: dict) -> str:
display_name = str(cmd_obj.get("display_name", "")).strip()
if isinstance(cmd_key, str):
Expand Down Expand Up @@ -395,7 +436,11 @@ def build_format_sets_from_commands(
continue

find_method = cmd_obj.get("find_method") or ""
constraints = _safe_parse_constraints(cmd_obj.get("find_constraints"))
constraints = _generic_search_constraints(
cmd_key, cmd_obj, find_method, _safe_parse_constraints(cmd_obj.get("find_constraints")))
technology_spec = "default_deployed_implementation_type" in constraints
if technology_spec and all(c.key != TECHNOLOGY_COLUMN.key for c in columns):
columns = [*columns, Column(**TECHNOLOGY_COLUMN.model_dump())]
extra_find = cmd_obj.get("extra_find") or ""
extra_constraints = _safe_parse_constraints(cmd_obj.get("extra_constraints"))
action = None
Expand All @@ -406,7 +451,8 @@ def build_format_sets_from_commands(
action = ActionParameter(
function=find_method or None,
required_params=["search_string"] if find_method else [],
optional_params=OPTIONAL_SEARCH_PARAMS if find_method else [],
optional_params=([*OPTIONAL_SEARCH_PARAMS, "deployed_implementation_type"]
if technology_spec else OPTIONAL_SEARCH_PARAMS) if find_method else [],
spec_params=constraints or {},
analytic_function=extra_find or None,
analytic_spec_params=(extra_constraints or {}) if extra_find else {},
Expand Down
2 changes: 1 addition & 1 deletion commands/tech/list_related_elements_with_prop_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def generate_table() -> Table:
relationship_type,
property_value,
property_names,
metadata_element_type_name=om_type,
metadata_element_type=om_type,
)

if type(elements) is list:
Expand Down
104 changes: 104 additions & 0 deletions docs/release-notes/6.2.28.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,107 @@ See [Counts: not measured, and whose population](../output-formats-and-report-sp
any listed actor, instead of reporting "Operation completed".
- If only some listed actors have no relationship, it detaches the others and warns about the
rest.

<!-- Other 6.2.28 sections are added by other branches; keep this one self-contained. -->

## Search and get filters: universal, checked, documented

- **Every `find_*` / `get_*` takes the standard filters as keyword arguments.** Each public
method that sends a request body to Egeria (509 of them, sync and async) accepts `**kwargs` and
passes them to the shared request helper. Signatures are unchanged apart from that. Methods
that previously could not filter now can — including `DataDesigner.find_all_data_structures`
/ `find_all_data_fields`, `RuntimeManager.get_platforms_by_name` / `get_servers_by_name` and
the other runtime lookups, `CollectionManager.get_collection_hierarchy` / `get_member_list`,
and the get-by-GUID family (`GetFilters` now reach `GetRequestBody`; before, a filter
keyword on a get-by-GUID was silently dropped). For example:

```python
client.find_data_value_specifications("*", metadata_element_subtypes=["DataClass"])
```

- **Filter names are checked.** An unknown name warns with `UnknownFilterWarning` (a
`UserWarning`, also logged at WARNING), naming the bad key and listing the valid ones, and is
left out of the request. The valid names come from the request-body model the call sends
(`SearchStringRequestBody`, `FilterRequestBody`, `GetRequestBody`, ...). Report specs'
`spec_params` go through the same check, so a typo in a spec warns too.
**A future release will raise `TypeError` instead of warning** — fix any warnings now.
- **Typed filters (PEP 692).** `SearchFilters`, `ListFilters`, `GetFilters` and `FindFilters`
(in `pyegeria.core.request_filters`) are `TypedDict`s with a description per field. Methods
annotate `**kwargs: Unpack[...]` so editors complete the filter names. Methods that already
name some filters as explicit parameters keep a plain `**kwargs` (PEP 692 forbids the overlap);
their filters still pass through and are checked.
- **Docs:** [Search and get filters](../search-and-get-filters.md) — the full tables, which
Egeria request body each maps to, and examples.

- **One name for the type filters.** Every method now spells them `metadata_element_type`
and `metadata_element_subtypes` (135 signatures renamed, mostly from
`metadata_element_type_name`; also `metadata_element_sub_type`, `metadata_element_subtype`,
`metadata_element_subtype_names`, `metadata_element_name`). The old spellings still work, with
a `DeprecationWarning` naming the new one; giving old and new with different values raises
`TypeError`. Report specs using the old names keep working without warnings.

- **Generic-search report specs name their type.** The 40 Dr.Egeria `*-DrE-*` specs that
called `MetadataExpert.find_metadata_elements_with_string` with no type (Embedded-Process,
Report, Schema-Type, the Asset Maker `*-Element-DrE-*` specs, ...) now call
`ClassificationExplorer.find_elements_by_property_value` with their command's own type, which
the generator takes from the command's `OM_TYPE` (`OpenMetadataRoot` for the generic Element
command). `'*'` used to fail ("searchString is null"); it now lists the elements of that type.
A search string used to match every type; it now matches only that type.
- The 9 technology commands (Kafka, Postgres server/database, the Unity Catalog elements) also
pass their `deployedImplementationType` (from the same table Dr.Egeria's create-from-template
calls use). Egeria ANDs "technology equals" with the name search in one query, so these
reports list exactly that technology for `'*'` and for a search string (a "Databricks Unity
Catalog Server" is not a "Unity Catalog Server"); they show a *Deployed Implementation Type*
column.
The technology is an optional run parameter, `deployed_implementation_type`, defaulting to the
spec's own: `"*"` searches every element of the type (any technology), any other value is an
exact match on that technology (ignoring case).
- `'*'` with no type or a root type (`OpenMetadataRoot`, `Referenceable`) is refused: "give a
search string or a narrower type" (a whole-repository listing helped run the quickstart
platform out of heap on 2026-11-09). So `Element-DrE-*` works only with a search string.
- `'*'` lists a type at most 100 elements per call (the caller's `page_size`, default 100);
page on with `start_from`.
- **A misspelt report parameter warns.** `run_report` / `exec_report_spec` drop a caller's
parameter the report does not take; they now say so with `UnknownFilterWarning`. When a
caller's parameter collides with the spec's `spec_params`, the spec's value wins (unchanged).

### Behaviour changes: some reports now return fewer rows

These reports used to ignore part of their filter and list everything; they now return only
what they are named for. Row counts are from the quickstart demo (live reads, 2026-11-09):

| Report spec (Basic and Advanced) | Before | Now |
|---|---|---|
| `Cited-Document-DrE-*` | 87 (every external reference) | 2 |
| `Related-Media-DrE-*` | 87 | 4 |
| `External-Data-Source-DrE-*`, `External-Model-Source-DrE-*`, `External-Source-Code-DrE-*`, `External-Standard-DrE-*` | 87 each | 0 |
| `Question-DrE-*` | failed with `TypeError` (and would have listed 1000+ glossary terms) | 152 |
| `Data-Sharing-Agreement-DrE-*` (`find_collections`) | 1000+ (every collection) | 598 (Agreements classified DataSharingAgreement) |
| `Digital-Product-Catalog-DrE-*` (`find_collections`) | 1000+ (every collection) | 3 |

- **`classification_names` on a find now filters.** It is sent as
`includeOnlyClassifiedElements` (it already meant that on a by-name get). Before, a find
dropped it silently. So the two Dr.Egeria specs that pass `classification_names` to
`find_collections` return fewer rows than before. `Data-Sharing-Agreement-DrE-*` now lists
only Agreements classified DataSharingAgreement. `Digital-Product-Catalog-DrE-*` passed
`classification_names: ["DigitalProductCatalog"]`, but `DigitalProductCatalog` is a type, not a
classification; its Dr.Egeria `find_constraints` now uses `metadata_element_type`, so it lists
the 3 catalogs instead of every collection. The project-family specs
(Campaign etc.) already used `include_only_classified_elements` and are unchanged.
- **The external-reference and Question specs now return only their own type.** Their
Dr.Egeria `find_constraints` named filters the method did not have
(`metadata_element_types`, `classification`); they now use `metadata_element_type` and
`include_only_classified_elements: ["Question"]`, and the report specs were regenerated.
Dr.Egeria command processing is unchanged (it reads the singular type key the same way).
- **A hard-coded filter no longer collides with yours.** 58 call sites passed a filter such as
`metadata_element_type` explicitly beside `**kwargs`, so passing that filter raised
`TypeError: got multiple values` (this is why `Question-DrE-*` failed). The built-in value is
now a default that a caller's keyword overrides.

### Other changes to check

- A filter given as `None` never overrides a method's own default.
- `MetadataExpert.find_metadata_elements` builds its default body from any `FindRequestBody`
field given as a keyword (before: a fixed subset).
- Every built-in report spec's `spec_params` is now checked by a micro-test against the method
it calls.
Loading
Loading