Area: Ingestion
Sub-Area: Entity Management
Issue
When attempting to implement soft deletion for domain entities using the status aspect in a custom ingestion source, users encounter the error "Unknown aspect status for entity domain." This indicates that domains cannot be soft-deleted using the same mechanism that works for datasets and other entities.
Common Error Messages:
Unknown aspect status for entity domain
You Might Be Asking:
- Does the domain entity support soft deletion?
- How can I delete domains programmatically?
- Why doesn't the status aspect work for domains?
- What's the alternative to soft deletion for domains?
Solution
The domain entity type in DataHub does not support soft deletion because it lacks a status aspect. Only hard deletion is available.
Hard Deletion Options:
- Using GraphQL API:
mutation {
deleteDomain(urn: "urn:li:domain:your-domain-id")
}
- Using Python SDK:
from datahub.emitter.rest_emitter import DatahubRestEmitter
from datahub.metadata.urns import DomainUrn
emitter = DatahubRestEmitter("http://localhost:8080")
domain_urn = DomainUrn("your-domain-id")
emitter.delete_entity(domain_urn)
- Using DataHub CLI:
datahub delete --urn "urn:li:domain:your-domain-id"
Why Soft Deletion Isn't Supported: - Domains are organizational/structural entities rather than data assets - The status aspect is designed for data assets (datasets, charts, dashboards) - Hard deletion ensures domains are completely removed from the system - Prevents orphaned domain references in the metadata graph
Workaround for Soft Deletion Behavior: If you need to "hide" domains without deleting them: - Remove all assets from the domain - Update the domain description to indicate it's deprecated - Use naming conventions (e.g., "[DEPRECATED] Domain Name")
Additional Notes
- Hard deletion of domains will remove domain associations from all assets
- Ensure no assets are assigned to the domain before deletion if you want a clean removal
- Domain deletion requires appropriate permissions (typically admin)
- Deleted domains cannot be recovered; back up metadata if needed
Related Documentation
Related Tickets
- 4979
Tags:
domain, soft-deletion, hard-deletion, entity-management, status-aspect, graphql, ingestion, metadata-deletion