Area: Product
Sub-Area: Governance
Applies to: OSS + Cloud
Issue
Tags on an upstream dataset don't show up on downstream datasets, or tags are copying to assets where you don't want them. Tag propagation isn't a setting on the tag. It is a separate automation (Cloud) or action (OSS) that you set up and control.
You Might Be Asking
- Do tags propagate through lineage on their own?
- How do I turn on tag propagation?
- Can I control which tags propagate?
- How do I tell whether a tag was propagated or added directly?
- How do I apply tags during ingestion without losing tags added in the UI?
Cause
Tags have no "propagate" option. The updateTag mutation takes urn, name, description and ownership only, so editing a tag can't enable propagation. Propagation comes from the Tag Propagation automation in DataHub Cloud, or from the tag_propagation action in acryl-datahub-actions for OSS. Policies only grant privileges. They don't make tags propagate.
Solution
DataHub Cloud
- Go to Govern > Automations. Tag propagation is set up as an automation there.
- Set the tags to propagate. By default the automation propagates all tags. You can limit it to tags whose names start with given prefixes (
tag_prefixes). - Choose where tags go. The automation can propagate to downstream assets and to sibling assets. Both are on by default. You must select at least one direction.
- Know the limits of the standard Tag Propagation automation:
- It copies dataset-level tags only. Tags on columns, and tags on anything that isn't a dataset, are skipped.
- Downstream targets must be the same entity type as the source.
- It follows up to 5 hops by default. It copies to at most 1000 downstream assets per change and logs a warning when there are more.
- It reacts to tag add and remove events made after the automation is running. Removing a tag also propagates.
- Initialize does not backfill tags for this automation. Tags applied before the automation was running are not copied by Initialize.
- Newer Cloud deployments use Lineage Propagation instead. It propagates tags, glossary terms and documentation across lineage and siblings. Where it is enabled (the v2.2.0 and later behavior), new automations are created as Lineage Propagation, and existing Tag Propagation automations can still be run and edited. If you need column-level or upstream tag propagation, or you don't see the option you expect, contact DataHub Support.
You can also create and change automations through the Cloud GraphQL API with createActionPipeline(input: UpdateActionPipelineInput!) and upsertActionPipeline(urn: String!, input: UpdateActionPipelineInput!). The type must match the recipe (for example tag-propagation), and config.recipe is a JSON-encoded string. The UI under Govern > Automations is the normal route. See DataHub Cloud GraphQL getting started.
To read an automation's settings, query actionPipeline(urn: String!) and select details { type name config { recipe } }.
OSS
Run the tag_propagation action from acryl-datahub-actions. Its config has enabled (default true) and tag_prefixes (default none, which means all tags). It reacts to tag add and remove events and propagates to downstream entities.
See whether a tag was propagated
In GraphQL, each TagAssociation has an attribution field. Read attribution.source. For a propagated tag, the source is the action. Don't use associatedUrn for this. It is the URN of the tagged entity, used for example when sibling nodes are merged.
Apply tags during ingestion instead
Tag transformers are an alternative to propagation. transformers is a top-level key in the recipe, next to source and sink.
Use simple_add_dataset_tags with tag_urns:
transformers:
- type: simple_add_dataset_tags
config:
semantics: PATCH
tag_urns:
- "urn:li:tag:Sensitive"
Use pattern_add_dataset_tags with tag_pattern, not tag_urns. Each rule maps a regex to a list of tag URNs. The regex is matched against the dataset URN from the start, so .*customer.* is the safe form. Use ^...$ for an exact match. first_match_only defaults to true, so only the first matching rule applies. Set it to false to apply all matching rules.
transformers:
- type: pattern_add_dataset_tags
config:
semantics: PATCH
tag_pattern:
rules:
".*customer.*": ["urn:li:tag:PII"]
".*financial.*": ["urn:li:tag:Financial"]
semantics defaults to OVERWRITE. With OVERWRITE, the transformer's tags replace the dataset's tags in DataHub, so tags added in the UI are lost. With PATCH, the transformer keeps the existing tags and adds its own. Unknown config keys fail validation.
Glossary terms
Glossary terms propagate with a separate Glossary Term Propagation automation. See the link below.