Hello, I ran an ingestion and it picked up a datab...
# ingestion
b
Hello, I ran an ingestion and it picked up a database that we don't want to show with hundreds of tables. Is there a way that I can remove all the datasets in that database? (it's a snowflake database). Thank you
b
you could rollback the specific ingestion run, and rerun ingestion with a better whitelist list runs first to get the id,
datahub ingest list-runs
rollback:
datahub ingest rollback --run-id
b
hmm the database has been there for weeks, so roughly 15 ingestions ago. I don't really wanna go back that far
is there a way to get all of the urns for a database and hit /entities?action=delete on all of them?
i can write. a python script to delete a set of records, im just not sure how to extract the urns i want
b
hmmm... there might be a more elegant way, but i guess you can search for snowflake datasets in search, filter by the "container", then export out all the listings using the export results button. the exported file has the urns you would need
the delete cli has a filter option but i have not used it before
b
i got a query that looks like this
Copy code
import requests, json
url = '<http://datahub-gms.metigy.com:8080/entities?action=search>'
body = {
    "input": "",
    "entity": "dataset",
    "container": "bi_staging",
    "env": "PROD",
    "start": 0,
    "count": 10,
    # "filter": {
    #     "criteria": [
    #        {
    #             "field": "title",
    #             "value": "Baz Chart 1",
    #             "condition": "EQUAL"
    #        }
    #     ]
    # }
}
but container and env attribute makes no difference, is there an api doc how to use this endpoint, I can't find i
b
i have not really used this mode of query before..
b
i ended up just exporting all the urns and then deleting based on regex
b
hmmm if its just to query the list of urns, the graphql endpoint would also work rather than querying GMS. but probably too late for your use case 😛