mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 09:58:14 +00:00
fix(ingestProposal): fix/handle no-op ingestion (#10126)
This commit is contained in:
parent
fc03a1c3ee
commit
45f6c2a21e
@ -747,10 +747,12 @@ public class JavaEntityClient implements EntityClient {
|
||||
.mcps(List.of(metadataChangeProposal), auditStamp, entityService)
|
||||
.build();
|
||||
|
||||
IngestResult one = entityService.ingestProposal(batch, async).stream().findFirst().get();
|
||||
Optional<IngestResult> one = entityService.ingestProposal(batch, async).stream().findFirst();
|
||||
|
||||
Urn urn = one.getUrn();
|
||||
tryIndexRunId(urn, metadataChangeProposal.getSystemMetadata());
|
||||
Urn urn = one.map(IngestResult::getUrn).orElse(metadataChangeProposal.getEntityUrn());
|
||||
if (one.isPresent()) {
|
||||
tryIndexRunId(urn, metadataChangeProposal.getSystemMetadata());
|
||||
}
|
||||
return urn.toString();
|
||||
}
|
||||
|
||||
|
||||
@ -253,11 +253,11 @@ public class AspectResource extends CollectionResourceTaskTemplate<String, Versi
|
||||
Set<IngestResult> results =
|
||||
_entityService.ingestProposal(batch, asyncBool);
|
||||
|
||||
IngestResult one = results.stream().findFirst().get();
|
||||
java.util.Optional<IngestResult> one = results.stream().findFirst();
|
||||
|
||||
// Update runIds, only works for existing documents, so ES document must exist
|
||||
Urn resultUrn = one.getUrn();
|
||||
if (one.isProcessedMCL() || one.isUpdate()) {
|
||||
Urn resultUrn = one.map(IngestResult::getUrn).orElse(metadataChangeProposal.getEntityUrn());
|
||||
if (one.map(result -> result.isProcessedMCL() || result.isUpdate()).orElse(false)) {
|
||||
tryIndexRunId(
|
||||
resultUrn, metadataChangeProposal.getSystemMetadata(), entitySearchService);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user