Area: Product Issues
Sub-Area: Metadata Tests UI
Applies to: Cloud
Issue
You build a Metadata Test condition on a Structured Property and pick the "Exists" operator. The "Select a value..." field stays visible next to it.
Other properties, such as Owners, hide the value field when you pick "Exists". "Exists" only checks that the property is present, so it takes no value.
You Might Be Asking
- Why does the value field still appear when I pick "Exists" for a structured property?
- Are my existing Metadata Tests affected?
- Why can't I save my test after I picked "Exists" and entered a value?
- How do I check that a structured property does not exist?
Cause
This is a UI bug in DataHub Cloud releases before v1.0.0. The structured property condition builder showed the value field for every operator. It did not check whether the operator takes a value. The builder for other properties already did this check.
The bug is not only visual. When you pick "Exists", the builder clears any value. But if you then enter a value in the visible field, the builder saves it with the condition. "Exists" accepts no value, so DataHub rejects the test definition. Saving the test fails with an error that starts with Failed to validate test definition.
Tests you already saved are not affected. DataHub validates every test definition when you create or update it, so a saved test has no value on an "Exists" condition.
Solution
- Use DataHub Cloud v1.0.0 or later. In these versions the value field is hidden when you pick "Exists" on a structured property. If your instance runs an older version, contact DataHub Support about an upgrade.
- If you can't save a test because of this error on an older version, clear the value. Change the condition's operator to a different one, then change it back to "Exists". Changing the operator clears the value. Leave the value field empty and save again.
- To check that a structured property does not exist, there is no separate "Does not exist" operator. Add a NOT logical condition and put the "Exists" condition for the property inside it. See Building Conditions in the Metadata Tests guide.