diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java index 097e1358ffb..58f03821f35 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCaseRepository.java @@ -790,6 +790,8 @@ public class TestCaseRepository extends EntityRepository { "failedRowsSample", JsonUtils.pojoToJson(tableData)); setFieldsInternal(testCase, Fields.EMPTY_FIELDS); + // deep copy the test case to avoid updating the cached entity + testCase = JsonUtils.deepCopy(testCase, TestCase.class); return testCase.withFailedRowsSample(tableData); } @@ -999,7 +1001,7 @@ public class TestCaseRepository extends EntityRepository { Entity.TABLE, table.getColumns(), table.getFullyQualifiedName(), true); List tags = daoCollection.tagUsageDAO().getTags(table.getFullyQualifiedName()); table.setTags(tags); - return maskSampleData(testCase.getFailedRowsSample(), table, table.getColumns()); + return maskSampleData(sampleData, table, table.getColumns()); } return sampleData; }