Skip to content

Commit

Permalink
fix(ci): remove platform from dataprocessinstance gql (#12408)
Browse files Browse the repository at this point in the history
  • Loading branch information
shirshanka authored Jan 21, 2025
1 parent c2a071b commit 995857c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3108,16 +3108,6 @@ private void configureDataProcessInstanceResolvers(final RuntimeWiring.Builder b
? dataProcessInstance.getDataPlatformInstance().getUrn()
: null;
}))
.dataFetcher(
"platform",
new LoadableTypeResolver<>(
dataPlatformType,
(env) -> {
final DataProcessInstance dataProcessInstance = env.getSource();
return dataProcessInstance.getPlatform() != null
? dataProcessInstance.getPlatform().getUrn()
: null;
}))
.dataFetcher("parentContainers", new ParentContainersResolver(entityClient))
.dataFetcher(
"container",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.linkedin.data.DataMap;
import com.linkedin.data.template.RecordTemplate;
import com.linkedin.datahub.graphql.QueryContext;
import com.linkedin.datahub.graphql.generated.DataPlatform;
import com.linkedin.datahub.graphql.generated.DataProcessInstance;
import com.linkedin.datahub.graphql.generated.EntityType;
import com.linkedin.datahub.graphql.types.common.mappers.AuditStampMapper;
Expand Down Expand Up @@ -80,10 +79,6 @@ public DataProcessInstance apply(
DataPlatformInstance dataPlatformInstance = new DataPlatformInstance(dataMap);
dataProcessInstance.setDataPlatformInstance(
DataPlatformInstanceAspectMapper.map(context, dataPlatformInstance));
DataPlatform dataPlatform = new DataPlatform();
dataPlatform.setUrn(dataPlatformInstance.getPlatform().toString());
dataPlatform.setType(EntityType.DATA_PLATFORM);
dataProcessInstance.setPlatform(dataPlatform);
});
mappingHelper.mapToResult(
SUB_TYPES_ASPECT_NAME,
Expand Down
5 changes: 0 additions & 5 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13029,11 +13029,6 @@ extend type DataProcessInstance {
"""
container: Container

"""
Standardized platform urn where the data process instance is defined
"""
platform: DataPlatform!

"""
Recursively get the lineage of containers for this entity
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ public void testMapPlatformInstance() throws Exception {
DataProcessInstance instance = DataProcessInstanceMapper.map(null, entityResponse);

assertNotNull(instance.getDataPlatformInstance());
assertNotNull(instance.getPlatform());
assertEquals(instance.getPlatform().getUrn(), TEST_PLATFORM_URN);
assertEquals(instance.getPlatform().getType(), EntityType.DATA_PLATFORM);
assertNotNull(instance.getDataPlatformInstance().getPlatform());
assertEquals(instance.getDataPlatformInstance().getPlatform().getUrn(), TEST_PLATFORM_URN);
assertEquals(
instance.getDataPlatformInstance().getPlatform().getType(), EntityType.DATA_PLATFORM);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
return {
name,
externalUrl,
platform: processInstance?.dataPlatformInstance?.platform,
};
};

Expand Down Expand Up @@ -201,9 +202,10 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
subType={data.subTypes?.typeNames?.[0]}
description=""
platformName={
data?.platform?.properties?.displayName || capitalizeFirstLetterOnly(data?.platform?.name)
data?.dataPlatformInstance?.platform?.properties?.displayName ||
capitalizeFirstLetterOnly(data?.dataPlatformInstance?.platform?.name)
}
platformLogo={data.platform.properties?.logoUrl}
platformLogo={data.dataPlatformInstance?.platform?.properties?.logoUrl}
platformInstanceId={data.dataPlatformInstance?.instanceId}
owners={null}
globalTags={null}
Expand Down Expand Up @@ -231,8 +233,8 @@ export class DataProcessInstanceEntity implements Entity<DataProcessInstance> {
name: this.displayName(entity),
type: EntityType.DataProcessInstance,
subtype: entity?.subTypes?.typeNames?.[0],
icon: entity?.platform?.properties?.logoUrl || undefined,
platform: entity?.platform,
icon: entity?.dataPlatformInstance?.platform?.properties?.logoUrl || undefined,
platform: entity?.dataPlatformInstance?.platform,
container: entity?.container,
// health: entity?.health || undefined,
};
Expand Down
6 changes: 0 additions & 6 deletions datahub-web-react/src/graphql/dataProcessInstance.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ fragment processInstanceRelationshipResults on EntityRelationshipsResult {
fragment dataProcessInstanceFields on DataProcessInstance {
urn
type
platform {
...platformFields
}
parentContainers {
...parentContainersFields
}
Expand Down Expand Up @@ -125,9 +122,6 @@ query getDataProcessInstance($urn: String!) {
dataProcessInstance(urn: $urn) {
urn
type
platform {
...platformFields
}
parentContainers {
...parentContainersFields
}
Expand Down
2 changes: 2 additions & 0 deletions docs/how/updating-datahub.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ This file documents any backwards-incompatible changes in DataHub and assists pe

### Breaking Changes

- #12408: The `platform` field in the DataPlatformInstance GraphQL type is removed. Clients need to retrieve the platform via the optional `dataPlatformInstance` field.

### Potential Downtime

### Deprecations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@ def test_search_dpi(auth_session, ingest_cleanup_data):
name
}
}
platform {
urn
name
properties {
type
}
}
subTypes {
typeNames
}
Expand Down

0 comments on commit 995857c

Please sign in to comment.