Skip to content

Commit 4169b72

Browse files
authored
Fix: DataContract entity endpoint fails with 400 for entities without dataProducts field (open-metadata#27861)
1 parent ecc4b17 commit 4169b72

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

openmetadata-service/src/main/java/org/openmetadata/service/resources/data/DataContractResource.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,13 @@ public DataContract getByEntityId(
330330
// the entity (e.g. a parquet container's dataModel can be MBs of column-schema
331331
// metadata). For containers this single line drove the endpoint past the
332332
// 1-minute timeout in production. Limit the fetch to the only field we need.
333+
boolean supportsDataProducts =
334+
Entity.getEntityRepository(entityType)
335+
.getAllowedFields()
336+
.contains(Entity.FIELD_DATA_PRODUCTS);
333337
EntityInterface entity =
334-
Entity.getEntity(entityType, entityId, "dataProducts", Include.NON_DELETED);
338+
Entity.getEntity(
339+
entityType, entityId, supportsDataProducts ? "dataProducts" : "", Include.NON_DELETED);
335340
DataContract dataContract = repository.getEffectiveDataContract(entity);
336341

337342
if (dataContract == null) {

0 commit comments

Comments
 (0)