Area: API
Sub-Area: Python SDK
Applies to: OSS + Cloud
Issue
You update column descriptions with the Python SDK. After that, the tags and glossary terms on those columns are gone. Descriptions on other columns can also be gone.
You Might Be Asking
- Why are my tags disappearing when I update field descriptions?
- How can I update a column description without losing its tags and glossary terms?
Cause
DataHub keeps the descriptions, tags and glossary terms that you add to columns in one aspect, editableSchemaMetadata. This aspect has one entry for each column.
When you emit a new EditableSchemaMetadataClass, DataHub replaces the stored aspect with it. Each tag, term and description that your new aspect does not include is removed, on every column. No SDK or DataHub version changes this.
Solution
- To change one column description, read the dataset, change the column, then update the dataset.
- With the Python SDK, use
client.entities.get, thendataset["<column>"].set_description(...), thenclient.entities.update(dataset). This keeps the column's tags and glossary terms. - With GraphQL, use the
updateDescriptionmutation. It changes only the description. - Do not emit a new
EditableSchemaMetadataClassto change a description. It removes all column tags, terms and descriptions that it does not include. - If tags or terms were removed, add them again.
The full steps, with GraphQL, curl and Python examples, are in Add Description on Column.
Related Documentation
Tags: python-sdk, field-descriptions, tags, glossary-terms, metadata-loss