Area: API Issues
Sub-Area: Data Product Patch Builder
Issue
When using DataProductPatchBuilder to set structured properties on Data Products with acryl-datahub SDK versions 1.5.0.4 and higher, users encounter a JSON mapping error that prevents successful metadata emission. This is a regression that was introduced in v1.5.0.4 and affects the PATCH operation for structured properties on Data Products.
Error Messages
OperationalError: Unable to emit metadata to DataHub GMS: jakarta.json.JsonException: The JSON Object '{}' contains no mapping for the name 'urn:li:structuredProperty:'
You Might Be Asking
- Why did my DataProductPatchBuilder code stop working after upgrading the SDK?
- Is there something wrong with my structured property configuration?
- Do I need to change how I'm using the patch builder?
Solution
-
Immediate workaround: Downgrade to acryl-datahub SDK v1.5.0.3 where the functionality works correctly:
pip install acryl-datahub==1.5.0.3 -
Verify your code pattern is correct: Your DataProductPatchBuilder usage should follow this pattern:
from datahub.api.entities.dataproduct.dataproduct import DataProduct from datahub.metadata.com.linkedin.pegasus2avro.mxe import MetadataChangeProposal from datahub.specific.dataproduct import DataProductPatchBuilder # Create data product data_product = DataProduct( id="", display_name=" ", domain="urn:li:domain: ", description=" ", properties={ "key": "value", }, external_url=" ", ) changes = list(data_product.generate_mcp(upsert=True)) # Set structured properties using patch builder pb = DataProductPatchBuilder(data_product.urn) pb.set_structured_property( "urn:li:structuredProperty: ", [" "] ) changes.extend(pb.build()) # Emit changes for change in changes: graph.emit(change) -
Test with preview build: If you need to validate the fix, test with the preview build from the fix PR:
pip install --index-url https://ca6868be.datahub-wheels.pages.dev/ acryl-datahub - Monitor for official release: The issue has been identified and a fix is in development. Monitor DataHub releases for the official patch.
Additional Notes
This is a confirmed product regression, not a usage issue. The error occurs because the PATCH operation generates an invalid payload when setting structured properties on Data Products in SDK versions 1.5.0.4 through 1.5.0.6. Your code is correct and follows documented patterns. The structured property must exist and be properly configured, but the SDK bug prevents successful emission regardless of correct configuration. Do not modify your DataProductPatchBuilder usage patterns as the issue will be resolved in a future SDK release.
Related Documentation
Tags: dataproduct, patchbuilder, structuredproperties, sdk, regression, api, json, metadata, ingestion, python