You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ab...@apache.org on 2023/03/03 01:16:28 UTC

[ranger] branch master updated: RANGER-4115: Tags containing attributes not processed correctly by tagsync

This is an automated email from the ASF dual-hosted git repository.

abhay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 48a635c30 RANGER-4115: Tags containing attributes not processed correctly by tagsync
48a635c30 is described below

commit 48a635c30ac2afe4492f06d132cc517431933dd8
Author: Abhay Kulkarni <ab...@apache.org>
AuthorDate: Thu Mar 2 17:16:21 2023 -0800

    RANGER-4115: Tags containing attributes not processed correctly by tagsync
---
 .../ranger/tagsync/source/atlas/AtlasNotificationMapper.java       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
index dadc76a54..a7c456b3d 100644
--- a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
+++ b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasNotificationMapper.java
@@ -351,9 +351,14 @@ public class AtlasNotificationMapper {
 
                     RangerTagDef tagDef = new RangerTagDef(tag.getName(), "Atlas");
                     if (MapUtils.isNotEmpty(tag.getAttributes())) {
+                        List<RangerTagAttributeDef> attributeDefs = tagDef.getAttributeDefs();
+                        if (attributeDefs == null) {
+                            attributeDefs = new ArrayList<>();
+                        }
                         for (String attributeName : tag.getAttributes().keySet()) {
-                            tagDef.getAttributeDefs().add(new RangerTagAttributeDef(attributeName, entityWithTags.getTagAttributeType(tag.getName(), attributeName)));
+                            attributeDefs.add(new RangerTagAttributeDef(attributeName, entityWithTags.getTagAttributeType(tag.getName(), attributeName)));
                         }
+                        tagDef.setAttributeDefs(attributeDefs);
                     }
                     ret.add(tagDef);
                 }