mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 05:03:10 +00:00
Fix Playwright failures: handle JsonParsingException after JsonUtils refactor (#22020)
This commit is contained in:
parent
cb39c70ef7
commit
ae3c6893eb
@ -26,6 +26,7 @@ import org.openmetadata.schema.entity.applications.configuration.internal.Servic
|
||||
import org.openmetadata.schema.entity.services.ingestionPipelines.IngestionPipeline;
|
||||
import org.openmetadata.schema.entity.services.ingestionPipelines.PipelineStatus;
|
||||
import org.openmetadata.schema.entity.services.ingestionPipelines.PipelineStatusType;
|
||||
import org.openmetadata.schema.exception.JsonParsingException;
|
||||
import org.openmetadata.schema.type.EntityReference;
|
||||
import org.openmetadata.schema.type.Include;
|
||||
import org.openmetadata.schema.utils.JsonUtils;
|
||||
@ -175,7 +176,7 @@ public class RunAppImpl {
|
||||
.triggerApplicationOnDemand(
|
||||
app, Entity.getCollectionDAO(), Entity.getSearchRepository(), config);
|
||||
break;
|
||||
} catch (UnhandledServerException e) {
|
||||
} catch (JsonParsingException | UnhandledServerException e) {
|
||||
if (e.getMessage().contains("Job is already running")) {
|
||||
attempt++;
|
||||
if (attempt >= maxRetries) {
|
||||
|
@ -10,11 +10,11 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.openmetadata.schema.EntityInterface;
|
||||
import org.openmetadata.schema.exception.JsonParsingException;
|
||||
import org.openmetadata.schema.type.FieldChange;
|
||||
import org.openmetadata.schema.type.change.ChangeSource;
|
||||
import org.openmetadata.schema.type.change.ChangeSummary;
|
||||
import org.openmetadata.schema.utils.JsonUtils;
|
||||
import org.openmetadata.service.exception.UnhandledServerException;
|
||||
import org.openmetadata.service.util.FullyQualifiedName;
|
||||
|
||||
@Slf4j
|
||||
@ -148,7 +148,7 @@ public class ChangeSummarizer<T extends EntityInterface> {
|
||||
keysToDelete.add(
|
||||
FullyQualifiedName.build(fieldChange.getName(), name, nestedField));
|
||||
});
|
||||
} catch (UnhandledServerException e) {
|
||||
} catch (JsonParsingException e) {
|
||||
LOG.warn("Error processing deleted fields", e);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.jdbi.v3.core.Handle;
|
||||
import org.json.JSONObject;
|
||||
import org.openmetadata.schema.entity.services.ingestionPipelines.IngestionPipeline;
|
||||
import org.openmetadata.schema.exception.JsonParsingException;
|
||||
import org.openmetadata.schema.metadataIngestion.dbtconfig.DbtAzureConfig;
|
||||
import org.openmetadata.schema.metadataIngestion.dbtconfig.DbtCloudConfig;
|
||||
import org.openmetadata.schema.metadataIngestion.dbtconfig.DbtGCSConfig;
|
||||
@ -12,7 +13,6 @@ import org.openmetadata.schema.metadataIngestion.dbtconfig.DbtHttpConfig;
|
||||
import org.openmetadata.schema.metadataIngestion.dbtconfig.DbtLocalConfig;
|
||||
import org.openmetadata.schema.metadataIngestion.dbtconfig.DbtS3Config;
|
||||
import org.openmetadata.schema.utils.JsonUtils;
|
||||
import org.openmetadata.service.exception.UnhandledServerException;
|
||||
|
||||
@Slf4j
|
||||
public class MigrationUtil {
|
||||
@ -55,7 +55,7 @@ public class MigrationUtil {
|
||||
DbtS3Config dbtS3Config = JsonUtils.readValue(jsonString, DbtS3Config.class);
|
||||
dbtS3Config.setDbtConfigType(DbtS3Config.DbtConfigType.S_3);
|
||||
return dbtS3Config;
|
||||
} catch (UnhandledServerException ex) {
|
||||
} catch (JsonParsingException ex) {
|
||||
}
|
||||
|
||||
// For adding GCS type
|
||||
@ -63,7 +63,7 @@ public class MigrationUtil {
|
||||
DbtGCSConfig dbtGCSConfig = JsonUtils.readValue(jsonString, DbtGCSConfig.class);
|
||||
dbtGCSConfig.setDbtConfigType(DbtGCSConfig.DbtConfigType.GCS);
|
||||
return dbtGCSConfig;
|
||||
} catch (UnhandledServerException ex) {
|
||||
} catch (JsonParsingException ex) {
|
||||
}
|
||||
|
||||
// For adding Azure type
|
||||
@ -71,7 +71,7 @@ public class MigrationUtil {
|
||||
DbtAzureConfig dbtAzureConfig = JsonUtils.readValue(jsonString, DbtAzureConfig.class);
|
||||
dbtAzureConfig.setDbtConfigType(DbtAzureConfig.DbtConfigType.AZURE);
|
||||
return dbtAzureConfig;
|
||||
} catch (UnhandledServerException ex) {
|
||||
} catch (JsonParsingException ex) {
|
||||
}
|
||||
|
||||
// For adding cloud type
|
||||
@ -79,7 +79,7 @@ public class MigrationUtil {
|
||||
DbtCloudConfig dbtCloudConfig = JsonUtils.readValue(jsonString, DbtCloudConfig.class);
|
||||
dbtCloudConfig.setDbtConfigType(DbtCloudConfig.DbtConfigType.CLOUD);
|
||||
return dbtCloudConfig;
|
||||
} catch (UnhandledServerException ex) {
|
||||
} catch (JsonParsingException ex) {
|
||||
}
|
||||
|
||||
// For adding local type
|
||||
@ -87,7 +87,7 @@ public class MigrationUtil {
|
||||
DbtLocalConfig dbtLocalConfig = JsonUtils.readValue(jsonString, DbtLocalConfig.class);
|
||||
dbtLocalConfig.setDbtConfigType(DbtLocalConfig.DbtConfigType.LOCAL);
|
||||
return dbtLocalConfig;
|
||||
} catch (UnhandledServerException ex) {
|
||||
} catch (JsonParsingException ex) {
|
||||
}
|
||||
|
||||
// For adding http type
|
||||
@ -95,7 +95,7 @@ public class MigrationUtil {
|
||||
DbtHttpConfig dbtHttpConfig = JsonUtils.readValue(jsonString, DbtHttpConfig.class);
|
||||
dbtHttpConfig.setDbtConfigType(DbtHttpConfig.DbtConfigType.HTTP);
|
||||
return dbtHttpConfig;
|
||||
} catch (UnhandledServerException ex) {
|
||||
} catch (JsonParsingException ex) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ import org.openmetadata.schema.api.search.SearchSettings;
|
||||
import org.openmetadata.schema.dataInsight.DataInsightChartResult;
|
||||
import org.openmetadata.schema.entity.classification.Tag;
|
||||
import org.openmetadata.schema.entity.data.QueryCostSearchResult;
|
||||
import org.openmetadata.schema.exception.JsonParsingException;
|
||||
import org.openmetadata.schema.search.AggregationRequest;
|
||||
import org.openmetadata.schema.search.SearchRequest;
|
||||
import org.openmetadata.schema.service.configuration.elasticsearch.ElasticSearchConfiguration;
|
||||
@ -105,7 +106,6 @@ import org.openmetadata.search.IndexMappingLoader;
|
||||
import org.openmetadata.service.Entity;
|
||||
import org.openmetadata.service.events.lifecycle.EntityLifecycleEventDispatcher;
|
||||
import org.openmetadata.service.events.lifecycle.handlers.SearchIndexHandler;
|
||||
import org.openmetadata.service.exception.UnhandledServerException;
|
||||
import org.openmetadata.service.jdbi3.EntityRepository;
|
||||
import org.openmetadata.service.search.elasticsearch.ElasticSearchClient;
|
||||
import org.openmetadata.service.search.indexes.SearchIndex;
|
||||
@ -773,7 +773,7 @@ public class SearchRepository {
|
||||
fieldData.put(field.getName(), JsonUtils.getMap(entityReference));
|
||||
scriptTxt.append(" ");
|
||||
}
|
||||
} catch (UnhandledServerException e) {
|
||||
} catch (JsonParsingException e) {
|
||||
scriptTxt.append(String.format(REMOVE_PROPAGATED_FIELD_SCRIPT, field.getName()));
|
||||
}
|
||||
}
|
||||
@ -795,7 +795,7 @@ public class SearchRepository {
|
||||
field.getName(),
|
||||
field.getName()));
|
||||
fieldData.put(field.getName(), newEntityReference);
|
||||
} catch (UnhandledServerException e) {
|
||||
} catch (JsonParsingException e) {
|
||||
if (field.getName().equals(Entity.FIELD_TEST_SUITES)) {
|
||||
scriptTxt.append(PROPAGATE_TEST_SUITES_SCRIPT);
|
||||
fieldData.put(Entity.FIELD_TEST_SUITES, field.getNewValue());
|
||||
@ -838,7 +838,7 @@ public class SearchRepository {
|
||||
fieldData.put(field.getName(), entityReference);
|
||||
}
|
||||
scriptTxt.append(" ");
|
||||
} catch (UnhandledServerException e) {
|
||||
} catch (JsonParsingException e) {
|
||||
if (field.getName().equals(FIELD_DISPLAY_NAME)) {
|
||||
String fieldPath =
|
||||
getFieldPath(entity.getEntityReference().getType(), field.getName());
|
||||
|
Loading…
x
Reference in New Issue
Block a user