Skip to content

Commit

Permalink
feat(dataplex): save taxonomy display name for policy tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Chief-Rishab committed Oct 17, 2023
1 parent 442a06e commit e36286c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
7 changes: 4 additions & 3 deletions plugins/providers/dataplex/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ func (p *policyTagClient) GetPolicies(ctx context.Context) ([]*Policy, error) {
break
}
policyTags = append(policyTags, &Policy{
Name: tag.Name,
DisplayName: tag.DisplayName,
Description: tag.Description,
Name: tag.Name,
DisplayName: tag.DisplayName,
Description: tag.Description,
TaxonomyDisplayName: taxonomy.DisplayName,
})
}
}
Expand Down
8 changes: 5 additions & 3 deletions plugins/providers/dataplex/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ const (

// Policy is a reference to a Dataplex Policy Tag
type Policy struct {
Name string
DisplayName string
Description string
Name string
DisplayName string
Description string
TaxonomyDisplayName string
}

func (p *Policy) ToDomain() *domain.Resource {
Expand All @@ -25,6 +26,7 @@ func (p *Policy) ToDomain() *domain.Resource {
URN: p.Name,
Details: map[string]interface{}{
"description": p.Description,
"taxonomy": p.TaxonomyDisplayName,
},
}
}
Expand Down
8 changes: 5 additions & 3 deletions plugins/providers/dataplex/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,10 @@ func TestGetResources(t *testing.T) {
}
expectedPolicies := []*dataplex.Policy{
{
Name: "p_name",
DisplayName: "p_displayname",
Description: "p_description",
Name: "p_name",
DisplayName: "p_displayname",
Description: "p_description",
TaxonomyDisplayName: "p_taxonomydisplayname",
},
}
client.On("GetPolicies", mock.Anything).Return(expectedPolicies, nil).Once()
Expand All @@ -298,6 +299,7 @@ func TestGetResources(t *testing.T) {
URN: "p_name",
Details: map[string]interface{}{
"description": "p_description",
"taxonomy": "p_taxonomydisplayname",
},
},
}
Expand Down

0 comments on commit e36286c

Please sign in to comment.