Area: Product Issues
Sub-Area: Metadata Tests
Applies to: Cloud
Issue
You set up a Metadata Test with a "Set Structured Property" action, but the structured property is not set on the assets the test applies to.
Metadata Tests are not assertions. Assertions have their own actions (raise incident and resolve incident). Setting a structured property is a Metadata Test action.
You Might Be Asking
- Why is my Metadata Test passing but the structured property not being set?
- Are structured property actions supported in Metadata Tests?
- What values does the set structured property action accept?
Cause
Setting a structured property (SET_STRUCTURED_PROPERTY) is a supported Metadata Test action. It needs exactly one of stringValues or numberValues. It fails with one of these errors when the parameters are wrong:
- "Action parameters are missing the required 'stringValues' or 'numberValues' parameter."
- "Action parameters cannot have both 'stringValues' and 'numberValues' parameters."
The action applies the value with batchSetStructuredProperty. If that call fails, the server logs "Failed to set structured property for entities: ...". These failures do not show in assertion run history, because Metadata Tests are not assertions.
Solution
- Open the test from Tests in the left navigation. Go to step 3 of the test builder, "Defining Actions". Test actions apply to assets that pass or fail the test rules. In the builder, the action is labeled "Set Structured Property" and described as "Assign a value to a structured property on an asset."
- Check that the action gives exactly one of
stringValuesornumberValues. Do not give both, and do not give neither. - Check that the structured property exists and applies to the entity type of the assets the test targets. Open Structured Properties in the left navigation. This item shows only when the structured properties feature is on for your instance and you have the manageStructuredProperties or viewStructuredPropertiesPage privilege.
- If the property and the action are correct and the value is still not set, contact DataHub Support. Cloud customers can't read server logs. Include the test name, the structured property URN and an example asset URN.