high-toothbrush-90528
03/08/2022, 9:11 PMimport datahub.emitter.mce_builder as builder
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.metadata.schema_classes import ChangeTypeClass, ContainerPropertiesClass
from datahub.emitter.rest_emitter import DatahubRestEmitter
emitter = DatahubRestEmitter(gms_server="<http://localhost:8080>", extra_headers={})
emitter.test_connection()
metadata_event = MetadataChangeProposalWrapper(
aspect=ContainerPropertiesClass(
name="DataProduct1",
description="original description for dp1"
),
entityType="container",
changeType=ChangeTypeClass.UPSERT,
entityUrn="urn:li:container:DATAPROD",
aspectName="containerProperties",
)
# Emit metadata! This is a blocking call
emitter.emit(metadata_event)
I receive:
The field at path '/search/searchResults[0]/entity' was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value. The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is 'Entity' within parent type 'SearchResult' (code undefined)
To be mentioned is that I have created the container before ingesting any data.green-football-43791
03/09/2022, 12:55 AMnull
in this case. @big-carpet-38439 is going to submit a PR to have the container fallback to a default data platform instance in the case one is not set.green-football-43791
03/09/2022, 12:56 AM