Area: Product
Sub-Area: Governance
Applies to: OSS + Cloud
Issue
Owners you add to a dataset in the UI or through the API disappear after an ingestion run, or an owner change fails.
You Might Be Asking
- How do I add an owner to a dataset with the API?
- Why do my owner assignments keep disappearing after ingestion?
- Can I assign owners in bulk during ingestion?
Cause
- Ownership transformers default to
semantics: OVERWRITE. With this default, the transformer writes the ownership it computes and does not read the owners already on the server. Onlysemantics: PATCHreads the server and merges. - The owner must exist in DataHub. If it does not, the change fails with
Failed to change ownership for resource(s). Owner with urn <urn> does not exist.
Solution
- Add owners with the GraphQL API.
addOwnerstakesowners(a list ofOwnerInput) andresourceUrn. Each owner needsownerUrnandownerEntityType(CORP_USERorCORP_GROUP).ownershipTypeUrnis optional. There is noownerUrnsfield.
mutation addOwners {
addOwners(
input: {
owners: [
{
ownerUrn: "urn:li:corpuser:john.doe",
ownerEntityType: CORP_USER,
ownershipTypeUrn: "urn:li:ownershipType:__system__technical_owner"
},
{
ownerUrn: "urn:li:corpGroup:data-engineering",
ownerEntityType: CORP_GROUP,
ownershipTypeUrn: "urn:li:ownershipType:__system__technical_owner"
}
],
resourceUrn: "urn:li:dataset:(urn:li:dataPlatform:snowflake,db.schema.table,PROD)"
}
)
}
To change many assets in one call, use batchAddOwners. See Add Owners.
-
Make sure each owner exists in DataHub before you add it. If an owner does not exist, the call fails with the error above.
-
To assign owners by pattern during ingestion and keep owners added in the UI, use
pattern_add_ownershipwithsemantics: PATCH. Puttransformersat the top level of the recipe, next tosourceandsink, not insidesource.config. Write regex keys in single quotes. Each rule value is a list.
source:
type: snowflake
config:
# your source settings
transformers:
- type: "pattern_add_ownership"
config:
semantics: PATCH
owner_pattern:
rules:
'.*finance.*': ["urn:li:corpGroup:finance-team"]
'.*marketing.*': ["urn:li:corpGroup:marketing-team"]
-
owner_urnsis not valid in a pattern config. Only the simple ownership transformers use it, and the pattern transformer rejects it. -
ownership_typedefaults toDATAOWNER, which is deprecated. Setownership_typeyourself if you need a different type. -
pattern_add_dataset_ownershipandsimple_add_dataset_ownershipstill exist, but they are deprecated and raise a deprecation warning. Use the non-Dataset transformers. - Snowflake has no
extract_ownerssetting that protects manual owners. Usesemantics: PATCH. - See Current domain and ownership transformers and Dataset transformers.
- If you use the LDAP source, the recipe requires
ldap_server,ldap_userandldap_password. None has a default, so the recipe fails validation if you leave one out.
Additional Notes
Owner types include TECHNICAL_OWNER, BUSINESS_OWNER, DATA_STEWARD and NONE. DATA_STEWARD means a steward, expert or delegate responsible for the asset. NONE means no specific type is associated with the owner. DEVELOPER and DATAOWNER are deprecated. To add or remove owners you need the Edit Owners privilege.
Related Documentation
Tags: ownership, owners, governance, technical-owner, business-owner, data-steward, transformers, ldap