Skip to content

feat(metadata_expert): add/update/delete open metadata type definitions - #428

Merged
dwolfson merged 5 commits into
odpi:mainfrom
dwolfson:feat/metadata-expert-type-defs
Oct 5, 2026
Merged

dwolfson merged 5 commits into
odpi:mainfrom
dwolfson:feat/metadata-expert-type-defs

Conversation

@dwolfson

@dwolfson dwolfson commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds the five open-metadata type-definition calls that the refreshed Egeria-api-metadata-expert.http documents and MetadataExpert lacked (the audit's metadata-expert section: 5 missing -> 0, 27 OK, 0 mismatched):

  • add_enum_def / add_type_def (entity, relationship or classification) / update_type_def (a patch carrying only what changes) / delete_type_def / delete_enum_def.
  • New request models OpenMetadataEnumDef, OpenMetadataTypeDef, OpenMetadataTypeDefPatch declare only the documented fields and use extra='allow'. These mirror deep Egeria beans (relationship ends, enum elements, updateToVersion, typeDefStatus, ...); modelling every field by hand risked silently dropping some under PyegeriaModel's default extra='ignore' (the ISSUE-62 gotcha). A test pins that undeclared fields survive.
  • The two deletes pass typeDefName / enumDefName as query parameters with no body, as the .http shows.

Live verification (2026-10-05, dev quickstart platform)

call result
add_enum_def works; returns the new GUID as a plain string
add_type_def works; returns the new GUID; read-back shows the type with its enum-typed attribute intact
delete_type_def works
update_type_def rejected by the server, not by pyegeria: OMRS-REPOSITORY-400-069 ... mandatory field updatedBy set to null. Egeria's getTypeDefPatch converter is never given the calling user (checked on origin/main, 2026-10-01), and the patch bean has no field a client could use. Logged as ISSUE-124; docstring warns.
delete_enum_def 500 OMRS-CONTENT-MANAGER-500-001 unknown TypeDef for an enum get_attribute_types still lists, even after the only type using it was deleted. Logged as ISSUE-125; docstring warns.

Re-tested on the rebuilt platform (2026-10-05, image built 14:19Z from Egeria main 449ad06894, egeria-main restarted 14:39Z): both failures reproduce identically (update_type_def with the same updatedBy error on a fresh throwaway type; delete_enum_def with the same unknown TypeDef error, and the enum also survived the restart). So neither is a stale-build artefact, and Egeria's source at that commit still has both causes (the patch converter never sets updatedBy; the GUID map is written in only one place).

The calls match the documented API; the two failures are Egeria server bugs and are logged rather than worked around. A stray throwaway enum, PyegeriaTmpCuisineType, is left on the shared dev platform (unused; a retry after the platform's next restart is worthwhile).

Test plan

🤖 Generated with Claude Code

dwolfson and others added 4 commits October 5, 2026 10:28
Adds add_enum_def, add_type_def, update_type_def, delete_type_def and
delete_enum_def (Egeria-api-metadata-expert.http, open-metadata-types and
open-metadata-attribute-types/enum-defs). The scripts/omvs_audit.py check for
metadata-expert now reports 0 missing.

The OpenMetadataEnumDef / OpenMetadataTypeDef / OpenMetadataTypeDefPatch models
declare only the documented fields and use extra='allow', so the rest of these
deep Egeria beans (relationship ends, enum elements, ...) is passed through
instead of being silently dropped by PyegeriaModel's extra='ignore'.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…d delete_enum_def

Live verification (2026-10-05): add_enum_def and add_type_def return the new GUID and the
read-back is intact; delete_type_def works. update_type_def is rejected by the server
(updatedBy is never set on the patch -- Egeria bug, ISSUE-124) and delete_enum_def answers
500 'unknown TypeDef' (ISSUE-125), leaving the throwaway enum behind. Docstrings now say so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Re-tested live on the 2026-10-05 rebuilt platform: the stray enum survives the restart and
delete_enum_def fails with the identical OMRS-CONTENT-MANAGER-500-001. Closes the 'retry after a restart' idea.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Re-tested live on the 2026-10-05 rebuilt platform: a patch to a throwaway entity type is rejected with the
identical 'updatedBy set to null' error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson force-pushed the feat/metadata-expert-type-defs branch from 3eb7dd3 to 36e6454 Compare October 5, 2026 15:29
…emoved (ISSUE-125)

The warning belongs on the method a caller reaches first, not only on delete_enum_def. Also notes on add_type_def that
only entity types have been verified live.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson marked this pull request as ready for review October 5, 2026 15:34
@dwolfson
dwolfson merged commit 2179358 into odpi:main Oct 5, 2026
5 checks passed
@dwolfson
dwolfson deleted the feat/metadata-expert-type-defs branch October 5, 2026 15:34
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