Hi guys, its posible to add owners to a dataset us...
# ingestion
f
Hi guys, its posible to add owners to a dataset using the python emmiter?
b
yes
f
Do you have any docs/example ๐Ÿ˜„ ?
b
metadata-ingestion/examples/library/dataset_add_owner.py
f
thx โค๏ธ
i got this error
Copy code
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: <http://localhost:8080/aspects/urn%3Ali%3Adataset%3A%28urn%3Ali%3AdataPlatform%3Abiguqery%2Cam-dwh-t1%2CPROD%29?aspect=ownership&version=0>
i added in datahub init the Personal Access Token
b
no, i think need to add in the script
f
oh, make sens
b
it doesnt use the info inside ~/.datahubev
f
yea, its the python package, not the cli
it works now
but it will create another dataset with the same name
problably because i have a dataset in a dataset
b
hmmm if you inspect the MySQL DB, is the new aspect having the same urn as the existing rows?
how does a dataset in a dataset work?๐Ÿคจ
f
๐Ÿ˜‚
normaly is biguqery project.dataset
but datahub ingest the project like its a dataset
b
by right, if you specify the urn of the existing dataset in the script, it shouldnt create a new dataset
Copy code
# Inputs -> owner, ownership_type, dataset
owner_to_add = make_user_urn("jdoe")
ownership_type = OwnershipTypeClass.DATAOWNER
dataset_urn = make_dataset_urn(platform="hive", name="realestate_db.sales", env="PROD")  => if you replace this with the urn of the existing datast instead of calling the make_dataset_urn function
f
i tried
Copy code
dataset_urn = "urn:li:dataset:(urn:li:dataPlatform:bigquery,test-dataset-creation,PROD)"
end it will create a new dataset. I think bacause i have a dataset in another dataset , the urn for the first dataset dosent exist
b
im not very familiar with how bigquery datasets urn will look like when you have different BQ projects ๐Ÿคทโ€โ™‚๏ธ, but i hope you found what you needed? else you might want to consider starting a new question thread