Querying for Specific S3 Bucket Using DataHub Python Client

Original Slack Thread

Hi guys, regarding the python client, for get_urns_by_filter: How will the query look like? Does anyone have simple example on how to query for a specific s3 bucket? Datahub 0.13.0

Hey there! :wave: Make sure your message includes the following information if relevant, so we can help more effectively!

  1. Which DataHub version are you using? (e.g. 0.12.0)
  2. Please post any relevant error logs on the thread!

here is a sample


datahub_graph = DataHubGraph(DataHubGraphConfig(server="<http://localhost:8080>"))


dataset_urns = datahub_graph.get_urns_by_filter(
            entity_types=["dataset"],
            env="PROD",
            platform="S3",
            extraFilters=[{'field': 'domains', 'values': [domain_urn]}])]
)

for urn in dataset_urns:
    print(urn)```

Please find the working function call. You need to change platform to lowercase

 entity_types=["dataset"],
 env="PROD",
 platform="s3",
 extraFilters=[
 {
 'field': 'domains', 
 'values': ['urn:li:domain:be0b6a98-b5a3-485b-91e2-6ac9eb4327fa']
 }
 ]
)