Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Parent category does not change when category is updated in OMAS Subject-Area #5816

Closed
1 task done
Inventoroz opened this issue Oct 11, 2021 · 5 comments · Fixed by #5914
Closed
1 task done
Assignees
Labels
bug Something isn't working triage New bug/issue which needs checking & assigning

Comments

@Inventoroz
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

in Request
"parentCategory" : {
"type" : "Category",
"guid" : "184644cc-c4ff-4470-a690-0ecdb10f1300"
}

Return in Response
"parentCategory" : {
"type" : "Category",
"name" : "XQ2EG7DNE0",
"qualifiedName" : "LCSN56U4CW@a50931a1-a68a-40a9-bc24-578c9b09906f",
"guid" : "f078ff61-5df9-4083-9bcf-5bc2feb16a40",
"relationshipguid" : "2ba92e6f-910b-4672-b1a8-773c114ccf6f"
}
}

Expected Behavior

Return ParentCategory must equals Request ParentCategory

Steps To Reproduce

PUT https://1.2.3.4:9443/servers/xxx/open-metadata/access-services/subject-area/users/test/categories/209e75c1-2dca-4768-87ec-0ade461ad98b?isReplace=false

{
"class" : "Category",
"nodeType" : "Category",
"name" : "Топовый раздел",
"readOnly" : false,
"description" : "Самое лучшее описание раздела",
"classifications" : [ ],
"glossary" : {
"type" : "Glossary",
"guid" : "634cf473-e420-4786-bd01-7127ceca06f5"
},
"parentCategory" : {
"type" : "Category",
"guid" : "184644cc-c4ff-4470-a690-0ecdb10f1300"
}
}
200 OK
{
"class" : "SubjectAreaOMASAPIResponse",
"relatedHTTPCode" : 200,
"result" : [ {
"class" : "Category",
"nodeType" : "Category",
"name" : "Топовый раздел",
"qualifiedName" : "Топовый раздел@e033f334-a94f-4358-a050-0fd53fe22b70",
"systemAttributes" : {
"status" : "ACTIVE",
"createdBy" : "test",
"createTime" : 1633940943155,
"version" : 1,
"guid" : "209e75c1-2dca-4768-87ec-0ade461ad98b"
},
"readOnly" : false,
"description" : "Самое лучшее описание раздела",
"classifications" : [ ],
"glossary" : {
"type" : "Glossary",
"name" : "R-o-o-t 1G2l3o4s5s6a7r8y9",
"qualifiedName" : "R-o-o-t 1G2l3o4s5s6a7r8y9@81db59ff-eed7-4a18-9d76-dd011543cdb2",
"guid" : "634cf473-e420-4786-bd01-7127ceca06f5",
"relationshipguid" : "72e3e961-329a-4c09-b1f6-487de0cc79d2"
},
"parentCategory" : {
"type" : "Category",
"name" : "XQ2EG7DNE0",
"qualifiedName" : "LCSN56U4CW@a50931a1-a68a-40a9-bc24-578c9b09906f",
"guid" : "f078ff61-5df9-4083-9bcf-5bc2feb16a40",
"relationshipguid" : "2ba92e6f-910b-4672-b1a8-773c114ccf6f"
}
} ]
}

Environment

- Egeria: 3.0 in 3.2 too promblem
- OS: Centos
- Java: 11

Any Further Information?

No response

@Inventoroz Inventoroz added bug Something isn't working triage New bug/issue which needs checking & assigning labels Oct 11, 2021
@Inventoroz
Copy link
Author

Inventoroz commented Nov 4, 2021

@davidradl, Is there any movement on the issue?

@davidradl
Copy link
Member

davidradl commented Nov 8, 2021

@Inventoroz I have just had a quick look. The code only update the category bean content - it does not update the parent category or parent glossary. Those fields were intended mostly for gets.

I can see that the API as documented does not indicate that this is the way it works.

we have 2 options :

1- document this is working as designed.
2- fix change the code for Category Update take into account changes to the category parent.

I am going to look today at option 2.

Of course you can always work with the relationships directly to delete the existing one and add the new one.

@Inventoroz
Copy link
Author

@davidradl, I think it's better to do it according to option 2. This will be similar to the situation when we update the parent for the term

@davidradl
Copy link
Member

@Inventoroz Agreed - I am thinking that if the existing category has a parent and the update request a null parent with isReplace=true - then I should remove the parent. is= false I would not remove the parent in this case.

davidradl added a commit to davidradl/egeria that referenced this issue Nov 8, 2021
@davidradl
Copy link
Member

@Inventoroz I have a draft fix in the associated pr . It fails on one of the junits at the moment. If you want to review it and feedback - feel free.

davidradl added a commit to davidradl/egeria that referenced this issue Nov 8, 2021
davidradl added a commit that referenced this issue Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New bug/issue which needs checking & assigning
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants