Skip to content

Commit 3dfb022

Browse files
dwolfsonclaude
andcommitted
docs(metadata_expert): warn on add_enum_def that the enum cannot be removed (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>
1 parent 36e6454 commit 3dfb022

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎pyegeria/omvs/metadata_expert.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4404,6 +4404,11 @@ async def _async_add_enum_def(self, body: dict | OpenMetadataEnumDef) -> str | d
44044404
Add a new enum definition, which can then be used as the type of attributes in new type definitions.
44054405
Async version.
44064406
4407+
.. warning::
4408+
An enum added through the API cannot be removed again: ``delete_enum_def`` currently fails against
4409+
Egeria with a 500 "unknown TypeDef" (an Egeria server bug, ISSUE-125, reproduced on Egeria main
4410+
449ad06894, and the enum survives a restart). Do not create throwaway enums on a shared platform.
4411+
44074412
Parameters
44084413
----------
44094414
body : dict | OpenMetadataEnumDef
@@ -4433,7 +4438,8 @@ async def _async_add_enum_def(self, body: dict | OpenMetadataEnumDef) -> str | d
44334438

44344439
@dynamic_catch
44354440
def add_enum_def(self, body: dict | OpenMetadataEnumDef) -> str | dict:
4436-
"""Add a new enum definition, which can then be used as the type of attributes in new type definitions."""
4441+
"""Add a new enum definition, which can then be used as the type of attributes in new type definitions.
4442+
Note: it cannot be removed again through the API (ISSUE-125); see the async version's warning."""
44374443
loop = asyncio.get_event_loop()
44384444
return loop.run_until_complete(self._async_add_enum_def(body))
44394445

@@ -4443,6 +4449,10 @@ async def _async_add_type_def(self, body: dict | OpenMetadataTypeDef) -> str | d
44434449
Add a new type definition for an entity, relationship or classification. Links to other types - the
44444450
supertype, attribute types, relationship ends - only need the name of the type. Async version.
44454451
4452+
.. note::
4453+
Verified against a live server for entity types (with primitive and enum attributes). Relationship and
4454+
classification definitions go through the same code and models but have not been exercised live.
4455+
44464456
Parameters
44474457
----------
44484458
body : dict | OpenMetadataTypeDef

0 commit comments

Comments
 (0)