calm-balloon-31412
02/03/2023, 4:49 PMAvroException: ('Datum union type not in schema: %s', None) when running graph.get_aspect_v2(entity_urn=urn, aspect="dataJobInfo", aspect_type=DataJobInfoClass)
I see someone brought this up in the past but not sure if it was ever resolved. I'm trying to write a job that updates the datajobInfo aspect of a data job instead of overwriting it, so I need to access this aspect. Any help would be appreciated! cc @big-carpet-38439 who looked at this issue beforebulky-soccer-26729
02/03/2023, 5:24 PMcalm-balloon-31412
02/03/2023, 5:27 PMgms_endpoint = "<http://datahub-gms.service.envoy:10080>"
graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint))
urn = "..."
info = graph.get_aspect_v2(entity_urn=urn, aspect="dataJobInfo", aspect_type=DataJobInfoClass)bulky-soccer-26729
02/03/2023, 5:34 PMaspect="dataJobInfo" piece? so just info = graph.get_aspect_v2(entity_urn=urn, aspect_type=DataJobInfoClass)calm-balloon-31412
02/03/2023, 5:35 PMget_aspect_v2() missing 1 required positional argument: 'aspect'bulky-soccer-26729
02/03/2023, 5:36 PMbulky-soccer-26729
02/03/2023, 5:37 PMcalm-balloon-31412
02/03/2023, 5:37 PMget_aspect() as wellcalm-balloon-31412
02/03/2023, 5:37 PMbulky-soccer-26729
02/03/2023, 5:49 PMget_aspect() as well!mammoth-bear-12532
from datahub.metadata.schema_classes import DataJobInfoClass
from datahub.ingestion.graph.client import DataHubGraph, DataHubGraphConfig
graph = DataHubGraph(DataHubGraphConfig())
datajob = graph.get_aspect(entity_urn="urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", aspect_type=DataJobInfoClass)
print(datajob)mammoth-bear-12532
calm-balloon-31412
02/03/2023, 10:03 PMDataHubGraphConfig in datahub.ingestion.graph.clientmammoth-bear-12532
mammoth-bear-12532
mammoth-bear-12532
mammoth-bear-12532
cli_utils methodsmammoth-bear-12532
from datahub.cli.cli_utils import get_aspects_for_entity
from datahub.cli.cli_utils import ENV_METADATA_HOST_URL
import os
def set_host_url(host_url: str):
os.environ.set(ENV_METADATA_HOST_URL, host_url)
set_host_url("<http://localhost:8080>")
aspect_dict = get_aspects_for_entity(entity_urn="urn:li:dataJob:(urn:li:dataFlow:(airflow,dag_abc,PROD),task_123)", aspects=["dataJobInfo"], typed=False)
print(aspect_dict)mammoth-bear-12532
calm-balloon-31412
02/03/2023, 10:18 PMcalm-balloon-31412
02/03/2023, 10:18 PM