Skip to content

Commit

Permalink
fix(changeEvents): add description-parameter to the change-event of a…
Browse files Browse the repository at this point in the history
… schemaField-description (#10414)
  • Loading branch information
ksrinath authored May 7, 2024
1 parent ddb38e7 commit 28e97dd
Show file tree
Hide file tree
Showing 4 changed files with 414 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/managed-datahub/datahub-api/entity-events-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ This event is emitted when a description has been added to an entity on DataHub.

#### Header

<table><thead><tr><th>Category</th><th>Operation</th><th>Entity Types</th><th data-hidden></th></tr></thead><tbody><tr><td>DOCUMENTATION</td><td>ADD</td><td><code>dataset</code>, <code>dashboard</code>, <code>chart</code>, <code>dataJob</code>, <code>dataFlow</code> , <code>container</code>, <code>glossaryTerm</code>, <code>domain</code>, <code>tag</code></td><td></td></tr></tbody></table>
<table><thead><tr><th>Category</th><th>Operation</th><th>Entity Types</th><th data-hidden></th></tr></thead><tbody><tr><td>DOCUMENTATION</td><td>ADD</td><td><code>dataset</code>, <code>dashboard</code>, <code>chart</code>, <code>dataJob</code>, <code>dataFlow</code> , <code>container</code>, <code>glossaryTerm</code>, <code>domain</code>, <code>tag</code>, <code>schemaField</code></td><td></td></tr></tbody></table>

#### Parameters

Expand Down Expand Up @@ -384,7 +384,7 @@ This event is emitted when an existing description has been removed from an enti

#### Header

<table><thead><tr><th>Category</th><th>Operation</th><th>Entity Types</th><th data-hidden></th></tr></thead><tbody><tr><td>DOCUMENTATION</td><td>REMOVE</td><td><code>dataset</code>, <code>dashboard</code>, <code>chart</code>, <code>dataJob</code>, <code>container</code> ,<code>dataFlow</code> , <code>glossaryTerm</code>, <code>domain</code>, <code>tag</code></td><td></td></tr></tbody></table>
<table><thead><tr><th>Category</th><th>Operation</th><th>Entity Types</th><th data-hidden></th></tr></thead><tbody><tr><td>DOCUMENTATION</td><td>REMOVE</td><td><code>dataset</code>, <code>dashboard</code>, <code>chart</code>, <code>dataJob</code>, <code>container</code> ,<code>dataFlow</code> , <code>glossaryTerm</code>, <code>domain</code>, <code>tag</code>, <code>schemaField</code></td><td></td></tr></tbody></table>

#### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.datahub.util.RecordUtils;
import com.github.fge.jsonpatch.JsonPatch;
import com.google.common.collect.ImmutableMap;
import com.linkedin.common.AuditStamp;
import com.linkedin.common.GlobalTags;
import com.linkedin.common.GlossaryTerms;
Expand Down Expand Up @@ -166,6 +167,7 @@ private static ChangeEvent getDocumentationChangeEvent(
targetFieldInfo.getFieldPath(),
datasetFieldUrn,
targetFieldDescription))
.parameters(ImmutableMap.of("description", targetFieldDescription))
.auditStamp(auditStamp)
.build();
}
Expand All @@ -183,6 +185,7 @@ private static ChangeEvent getDocumentationChangeEvent(
Optional.ofNullable(targetFieldInfo).map(EditableSchemaFieldInfo::getFieldPath),
datasetFieldUrn,
baseFieldDescription))
.parameters(ImmutableMap.of("description", baseFieldDescription))
.auditStamp(auditStamp)
.build();
}
Expand All @@ -203,6 +206,7 @@ private static ChangeEvent getDocumentationChangeEvent(
datasetFieldUrn,
baseFieldDescription,
targetFieldDescription))
.parameters(ImmutableMap.of("description", targetFieldDescription))
.auditStamp(auditStamp)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.datahub.util.RecordUtils;
import com.github.fge.jsonpatch.JsonPatch;
import com.google.common.collect.ImmutableMap;
import com.linkedin.common.AuditStamp;
import com.linkedin.common.urn.DatasetUrn;
import com.linkedin.common.urn.Urn;
Expand Down Expand Up @@ -62,6 +63,7 @@ private static ChangeEvent getDescriptionChange(
.description(
String.format(
FIELD_DESCRIPTION_ADDED_FORMAT, targetDescription, targetField.getFieldPath()))
.parameters(ImmutableMap.of("description", targetDescription))
.auditStamp(auditStamp)
.build();
}
Expand All @@ -75,6 +77,7 @@ private static ChangeEvent getDescriptionChange(
.description(
String.format(
FIELD_DESCRIPTION_REMOVED_FORMAT, baseDescription, baseField.getFieldPath()))
.parameters(ImmutableMap.of("description", baseDescription))
.auditStamp(auditStamp)
.build();
}
Expand All @@ -91,6 +94,7 @@ private static ChangeEvent getDescriptionChange(
baseField.getFieldPath(),
baseDescription,
targetDescription))
.parameters(ImmutableMap.of("description", targetDescription))
.auditStamp(auditStamp)
.build();
}
Expand Down
Loading

0 comments on commit 28e97dd

Please sign in to comment.