Skip to content

Commit

Permalink
fix(lineage): error message for edit lineage (datahub-project#12724)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Feb 25, 2025
1 parent c3ca73e commit 653f9ef
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,15 @@ private void checkLineageEdgePrivileges(
if (!isAuthorized(context, upstreamUrn, editLineagePrivileges)) {
throw new AuthorizationException(
String.format(
"Unauthorized to edit %s lineage. Please contact your DataHub administrator.",
upstreamUrn.getEntityType()));
"Unauthorized to edit %s lineage for %s", upstreamUrn, upstreamUrn.getEntityType()));
}

Urn downstreamUrn = UrnUtils.getUrn(lineageEdge.getDownstreamUrn());
if (!isAuthorized(context, downstreamUrn, editLineagePrivileges)) {
throw new AuthorizationException(
String.format(
"Unauthorized to edit %s lineage. Please contact your DataHub administrator.",
downstreamUrn.getEntityType()));
"Unauthorized to edit %s lineage for %s",
downstreamUrn, downstreamUrn.getEntityType()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export default function ManageLineageModal({
});
}
})
.catch(() => {
message.error('Error updating lineage');
.catch((error) => {
message.error(error.message || 'Error updating lineage');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ export default function ManageLineageModal({ node, direction, closeModal, refetc
});
}
})
.catch((e) => {
message.error('Error updating lineage');
console.warn(e);
.catch((error) => {
message.error(error.message || 'Error updating lineage');
});
}

Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-gms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ COPY --from=binary /go/bin/dockerize /usr/local/bin
ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base AS prod-install
COPY war.war /datahub/datahub-gms/bin/war.war
COPY metadata-models/src/main/resources/entity-registry.yml /datahub/datahub-gms/resources/entity-registry.yml
COPY docker/datahub-gms/start.sh /datahub/datahub-gms/scripts/start.sh
COPY docker/monitoring/client-prometheus-config.yaml /datahub/datahub-gms/scripts/prometheus-config.yaml
RUN chmod +x /datahub/datahub-gms/scripts/start.sh
COPY war.war /datahub/datahub-gms/bin/war.war

FROM base AS dev-install
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
Expand Down
2 changes: 2 additions & 0 deletions docs/features/feature-guides/ui-lineage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The UI shows the latest version of the data lineage. The time picker can be used

## Editing from Lineage Graph View

Ensure that you have `Edit lineage` privilege on both upstream and downstream entities before you try to add upstream or downstream lineage.

The first place that you can edit data lineage for entities is from the Lineage Visualization screen. Click on the "Lineage" button on the top right of an entity's profile to get to this view.

<p align="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void run() {
writeLock.unlock();
}

log.debug(String.format("Successfully fetched %s policies.", total));
log.debug("Successfully fetched {} policies.", total);
} catch (Exception e) {
log.error(
"Caught exception while loading Policy cache. Will retry on next scheduled attempt.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,10 @@ private boolean isResourceMatch(
return true;
}
if (policyResourceFilter == null) {
// No resource defined on the policy.
log.debug("No resource defined on the policy.");
return true;
}
if (requestResource.isEmpty()) {
// Resource filter present in policy, but no resource spec provided.
log.debug("Resource filter present in policy, but no resource spec provided.");
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public PolicyFetchResult fetchPolicies(
public PolicyFetchResult fetchPolicies(
OperationContext opContext, String query, int count, @Nullable String scrollId, Filter filter)
throws RemoteInvocationException, URISyntaxException {
log.debug(String.format("Batch fetching policies. count: %s, scroll: %s", count, scrollId));
log.debug("Batch fetching policies. count: {}, scroll: {}", count, scrollId);

// First fetch all policy urns
ScrollResult result =
Expand Down

0 comments on commit 653f9ef

Please sign in to comment.