Repository navigation
feat(glossary_term_relationship): support DataHub Cloud relationship types - #218
Open
gnawhnehpets wants to merge 2 commits into
Open
gnawhnehpets wants to merge 2 commits into
gnawhnehpets wants to merge 2 commits into
Conversation
…types relationship_type now accepts isRelatedTo, synonymOf, antonymOf, translatesTo and hasValue in addition to isA and hasA. These values are in DataHub Cloud's TermRelationshipType enum, and addRelatedTerms / removeRelatedTerms already handle them there. Each type is stored in its own glossaryRelatedTerms list (isRelatedTo in relatedTerms, hasValue in values), so Read now decodes all seven lists; without that, Read would drop every such edge from state. Business glossary YAML writes related_terms and values to the same lists, so existing edges can be adopted with import. Against open-source DataHub, or an older Cloud release, a Cloud-only type fails with an UnsupportedRelationshipTypeError naming the type and quoting the server's message. isA and hasA are unchanged everywhere. The mock server now models all seven types. New acceptance tests cover the Cloud types (RequireCloud) and the OSS error path (RequireOSS). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xd1DZb1TvHziJ7HThE8pKg
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #218 +/- ##
==========================================
+ Coverage 81.29% 81.35% +0.05%
==========================================
Files 154 154
Lines 21383 21441 +58
==========================================
+ Hits 17384 17444 +60
+ Misses 3993 3991 -2
Partials 6 6
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
…tedTerms.list Replace the switch with a lookup table. The switch's trailing return nil was reachable only for an unknown relationship type, which validation already rejects, so it was never covered. Behaviour is unchanged: an unknown type still yields nil. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xd1DZb1TvHziJ7HThE8pKg
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
datahub_glossary_term_relationshipnow accepts the relationship types DataHub Cloud adds toTermRelationshipType:isRelatedTo,synonymOf,antonymOf,translatesToandhasValue, alongsideisAandhasA.Until now a glossary whose terms are associated without inheriting from or containing each other couldn't be managed in Terraform without changing what its relationships mean. Business glossary YAML writes
related_termsandvaluesto the same aspect lists asisRelatedToandhasValue, so existing edges can be adopted withimport.Changes
glossaryRelatedTermslists, whose field names differ from the type names (isRelatedTo→relatedTerms,hasValue→values). Without this, Read would drop such edges from state and Terraform would recreate them on every plan.UnsupportedRelationshipTypeErrorthat names the type and keeps the server's message.isA/hasAare unchanged everywhere.Testing
TestAcc_GlossaryTermRelationship_CloudTypes(RequireCloud) runs create, a clean re-plan and import.TestAcc_GlossaryTermRelationship_CloudTypeOnOSS(RequireOSS) covers the open-source error path.make generate,make lint,make testandmake test-examplespass locally.