Skip to content

Commit

Permalink
Change break to continue (#17015)
Browse files Browse the repository at this point in the history
* Change break to continue
  • Loading branch information
alovew committed Sep 22, 2022
1 parent abed1ce commit 90ceb1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public boolean shouldRunNormalization(final Long jobId, final Long attemptNumber

// if the count of committed records for this attempt is > 0 OR if it is null,
// then we should run normalization
if (numCommittedRecords.get() == null || numCommittedRecords.get() > 0) {
if (numCommittedRecords.isEmpty() || numCommittedRecords.get() > 0) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public StandardSyncOutput run(final JobRunConfig jobRunConfig,
}
if (!shouldRun) {
LOGGER.info("Skipping normalization because there are no records to normalize.");
break;
continue;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ void testSkipNormalization() throws IOException {
verifyReplication(replicationActivity, syncInput);
verifyPersistState(persistStateActivity, sync, replicationSuccessOutputNoRecordsCommitted, syncInput.getCatalog());
verifyNoInteractions(normalizationActivity);
verifyNoInteractions(dbtTransformationActivity);
verifyDbtTransform(dbtTransformationActivity, syncInput.getResourceRequirements(),
operatorDbtInput);
}

@SuppressWarnings("ResultOfMethodCallIgnored")
Expand Down

0 comments on commit 90ceb1b

Please sign in to comment.