Hi i try to use ptyhon emitter like this example <...
# ingestion
k
Hi i try to use ptyhon emitter like this example https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/library/lineage_emitter_mcpw_rest.py i need to config the emitter connection correctly as i have domain name for datahub server and token for authentication! i already tried this emitter = DatahubRestEmitter("https://example.com/api/gms", "extra_headers={Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxx}") but didnot works to connect with datahub server
b
What error msg did you get
k
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for urlstatus code 401. Maybe you need to set up authentication? Please check your configuration and make sure you are talking to the DataHub GMS (usually <datahub-gms-host>:8080) or Frontend GMS API (usually <frontend>:9002/api/gms).
i beilive its SyntaxError: invalid syntax
need to write propore connection string with token parameter so can authenticate with datahub server! didnot find any example use token with REST API emiiter
b
Something like token = "xx" graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint, token=token)) graph.emit(mcp)
from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph
Use the DatahubGraph class instead
k
thanks for response do you have link for example using DatahubGraph class
b
Check the examples/library folder in metadata ingestion folder of the repo, they all use the class
k
@better-orange-49102 thanks thats really solve the issue
a
Hello @kind-helicopter-53206, I have the same problem as you. Can you give more details on how to resolve it?
r
Hey there! 👋 Make sure your message includes the following information if relevant, so we can help more effectively! 1. Are you using UI or CLI for ingestion? 2. Which DataHub version are you using? (e.g. 0.12.0) 3. What data source(s) are you integrating with DataHub? (e.g. BigQuery)