Skip to content

Commit

Permalink
fix(cli): don't use env for container, add example
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed May 26, 2022
1 parent 21f8d4b commit 10394e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/how/delete-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ _Note: All these commands below support the soft-delete option (`-s/--soft`) as
datahub delete --env DEV --entity_type dataset
```

### Delete all containers for a particular platform
```
datahub delete --entity_type container --platform s3
```

### Delete all Pipelines and Tasks in the DEV environment
```
datahub delete --env DEV --entity_type "datajob"
Expand Down
4 changes: 2 additions & 2 deletions metadata-ingestion/src/datahub/cli/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ def get_urns_by_filter(
endpoint: str = "/entities?action=search"
url = gms_host + endpoint
filter_criteria = []
if env:
filter_criteria.append({"field": "origin", "value": env, "condition": "EQUAL"})
entity_type_lower = entity_type.lower()
if env and entity_type_lower != "container":
filter_criteria.append({"field": "origin", "value": env, "condition": "EQUAL"})
if (
platform is not None
and entity_type_lower == "dataset"
Expand Down

0 comments on commit 10394e0

Please sign in to comment.