From 995857c8bb0fbab90967f989ebfa981bb86bbe2a Mon Sep 17 00:00:00 2001 From: Shirshanka Das Date: Tue, 21 Jan 2025 13:58:31 -0800 Subject: [PATCH] fix(ci): remove platform from dataprocessinstance gql (#12408) --- .../com/linkedin/datahub/graphql/GmsGraphQLEngine.java | 10 ---------- .../mappers/DataProcessInstanceMapper.java | 5 ----- datahub-graphql-core/src/main/resources/entity.graphql | 5 ----- .../mappers/DataProcessInstanceMapperTest.java | 7 ++++--- .../dataProcessInstance/DataProcessInstanceEntity.tsx | 10 ++++++---- .../src/graphql/dataProcessInstance.graphql | 6 ------ docs/how/updating-datahub.md | 2 ++ .../test_data_process_instance.py | 7 ------- 8 files changed, 12 insertions(+), 40 deletions(-) diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java index 403e80a71380b..2c5e841322f45 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java @@ -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", diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapper.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapper.java index 28c9c8936fdbf..d721f5a5fb522 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapper.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapper.java @@ -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; @@ -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, diff --git a/datahub-graphql-core/src/main/resources/entity.graphql b/datahub-graphql-core/src/main/resources/entity.graphql index 51909ae72c56b..64c79b05745de 100644 --- a/datahub-graphql-core/src/main/resources/entity.graphql +++ b/datahub-graphql-core/src/main/resources/entity.graphql @@ -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 """ diff --git a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapperTest.java b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapperTest.java index dc1ce935ad5ec..cd9d58b54e6b3 100644 --- a/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapperTest.java +++ b/datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/types/dataprocessinst/mappers/DataProcessInstanceMapperTest.java @@ -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 diff --git a/datahub-web-react/src/app/entity/dataProcessInstance/DataProcessInstanceEntity.tsx b/datahub-web-react/src/app/entity/dataProcessInstance/DataProcessInstanceEntity.tsx index 4834a026ad94a..d58c8ed537f61 100644 --- a/datahub-web-react/src/app/entity/dataProcessInstance/DataProcessInstanceEntity.tsx +++ b/datahub-web-react/src/app/entity/dataProcessInstance/DataProcessInstanceEntity.tsx @@ -161,6 +161,7 @@ export class DataProcessInstanceEntity implements Entity { return { name, externalUrl, + platform: processInstance?.dataPlatformInstance?.platform, }; }; @@ -201,9 +202,10 @@ export class DataProcessInstanceEntity implements Entity { 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} @@ -231,8 +233,8 @@ export class DataProcessInstanceEntity implements Entity { 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, }; diff --git a/datahub-web-react/src/graphql/dataProcessInstance.graphql b/datahub-web-react/src/graphql/dataProcessInstance.graphql index 8f55ca4903d52..442f8db0a933b 100644 --- a/datahub-web-react/src/graphql/dataProcessInstance.graphql +++ b/datahub-web-react/src/graphql/dataProcessInstance.graphql @@ -67,9 +67,6 @@ fragment processInstanceRelationshipResults on EntityRelationshipsResult { fragment dataProcessInstanceFields on DataProcessInstance { urn type - platform { - ...platformFields - } parentContainers { ...parentContainersFields } @@ -125,9 +122,6 @@ query getDataProcessInstance($urn: String!) { dataProcessInstance(urn: $urn) { urn type - platform { - ...platformFields - } parentContainers { ...parentContainersFields } diff --git a/docs/how/updating-datahub.md b/docs/how/updating-datahub.md index b887ca999c404..945a00088f1f7 100644 --- a/docs/how/updating-datahub.md +++ b/docs/how/updating-datahub.md @@ -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 diff --git a/smoke-test/tests/data_process_instance/test_data_process_instance.py b/smoke-test/tests/data_process_instance/test_data_process_instance.py index bad945f878562..c0d2c62ba404a 100644 --- a/smoke-test/tests/data_process_instance/test_data_process_instance.py +++ b/smoke-test/tests/data_process_instance/test_data_process_instance.py @@ -210,13 +210,6 @@ def test_search_dpi(auth_session, ingest_cleanup_data): name } } - platform { - urn - name - properties { - type - } - } subTypes { typeNames }