Area: API
Sub-Area: Python SDK
Issue
When using the Python SDK to update field (column) descriptions on datasets, users discovered that existing tags and glossary terms associated with those fields were being unintentionally removed. This data loss occurred because the SDK was not properly merging the new description with existing field metadata, instead performing a full replacement operation.
You Might Be Asking:
- Why are my tags disappearing when I update field descriptions?
- How can I update descriptions without losing other metadata?
- What's the difference between v1 and v2 field aspects?
Solution
This issue has been resolved with improvements to the Python SDK's handling of field metadata. The fix ensures that partial updates to field properties (like descriptions) properly merge with existing metadata rather than replacing it entirely.
When updating field descriptions, use the latest SDK version:
from datahub.emitter.mce_builder import make_dataset_urn
from datahub.metadata.schema_classes import EditableSchemaMetadataClass
# Create or update field description
field_info = EditableSchemaMetadataClass(
editableSchemaFieldInfo=[
{
"fieldPath": "column_name",
"description": "New description",
# Tags and glossary terms are preserved automatically
}
]
)
Additional Notes
Fixed in version v0.3.11. This was particularly relevant for organizations migrating between v1 and v2 field aspect schemas. Ensure you're using SDK version 0.11.0 or later with your DataHub v0.3.11+ instance.
Related Documentation
Tags:
python-sdk, field-descriptions, tags, glossary-terms, metadata-loss, bug-fix, v0.3.11