DELETE /v1/dataQuality/testCases/{id}
from metadata.sdk import configure
from metadata.sdk.entities import TestCases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
TestCases.delete("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
# Hard delete
TestCases.delete(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
hard_delete=True
)
# Delete by name
test_case = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
fields=["testDefinition", "testSuite"]
)
TestCases.delete(test_case.id)
# Restore a soft-deleted test case
TestCases.restore("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
import java.util.Map;
// client is an initialized OpenMetadataClient.
var id = "c1bce355-fa2f-48c6-ab4d-fad722a56ed7";
// Soft delete
client.testCases().delete(id);
// Restore
client.testCases().restore(id);
// Hard delete
client.testCases().delete(id, Map.of("hardDelete", "true"));
// Delete by name: look up the ID first
var testCase = client.testCases().getByName("sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between");
client.testCases().delete(testCase.getId().toString());
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/name/sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted test case
curl -X PUT "{base_url}/api/v1/dataQuality/testCases/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7"}'
{
"id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
"name": "column_value_max_to_be_between",
"fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
"version": 0.2,
"updatedAt": 1769982800000,
"updatedBy": "admin",
"testDefinition": {
"id": "def-id",
"type": "testDefinition",
"name": "columnValueMaxToBeBetween"
},
"testSuite": {
"id": "suite-id",
"type": "testSuite",
"name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592"
},
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
"deleted": true,
"owners": []
}
Delete a Test Case
Delete a test case by ID or name, with soft/hard delete options
DELETE
/
v1
/
dataQuality
/
testCases
/
{id}
DELETE /v1/dataQuality/testCases/{id}
from metadata.sdk import configure
from metadata.sdk.entities import TestCases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
TestCases.delete("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
# Hard delete
TestCases.delete(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
hard_delete=True
)
# Delete by name
test_case = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
fields=["testDefinition", "testSuite"]
)
TestCases.delete(test_case.id)
# Restore a soft-deleted test case
TestCases.restore("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
import java.util.Map;
// client is an initialized OpenMetadataClient.
var id = "c1bce355-fa2f-48c6-ab4d-fad722a56ed7";
// Soft delete
client.testCases().delete(id);
// Restore
client.testCases().restore(id);
// Hard delete
client.testCases().delete(id, Map.of("hardDelete", "true"));
// Delete by name: look up the ID first
var testCase = client.testCases().getByName("sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between");
client.testCases().delete(testCase.getId().toString());
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/name/sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted test case
curl -X PUT "{base_url}/api/v1/dataQuality/testCases/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7"}'
{
"id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
"name": "column_value_max_to_be_between",
"fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
"version": 0.2,
"updatedAt": 1769982800000,
"updatedBy": "admin",
"testDefinition": {
"id": "def-id",
"type": "testDefinition",
"name": "columnValueMaxToBeBetween"
},
"testSuite": {
"id": "suite-id",
"type": "testSuite",
"name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592"
},
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
"deleted": true,
"owners": []
}
Delete a Test Case
Delete a test case by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.Delete by ID
Permanently delete the test case. If
false, the test case is soft-deleted and can be restored.Delete by Name
UseDELETE /v1/dataQuality/testCases/name/{fqn} to delete by fully qualified name.
Restore a Soft-Deleted Test Case
UsePUT /v1/dataQuality/testCases/restore to restore a soft-deleted test case.
DELETE /v1/dataQuality/testCases/{id}
from metadata.sdk import configure
from metadata.sdk.entities import TestCases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
TestCases.delete("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
# Hard delete
TestCases.delete(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
hard_delete=True
)
# Delete by name
test_case = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
fields=["testDefinition", "testSuite"]
)
TestCases.delete(test_case.id)
# Restore a soft-deleted test case
TestCases.restore("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
import java.util.Map;
// client is an initialized OpenMetadataClient.
var id = "c1bce355-fa2f-48c6-ab4d-fad722a56ed7";
// Soft delete
client.testCases().delete(id);
// Restore
client.testCases().restore(id);
// Hard delete
client.testCases().delete(id, Map.of("hardDelete", "true"));
// Delete by name: look up the ID first
var testCase = client.testCases().getByName("sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between");
client.testCases().delete(testCase.getId().toString());
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/dataQuality/testCases/name/sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted test case
curl -X PUT "{base_url}/api/v1/dataQuality/testCases/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7"}'
{
"id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
"name": "column_value_max_to_be_between",
"fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
"version": 0.2,
"updatedAt": 1769982800000,
"updatedBy": "admin",
"testDefinition": {
"id": "def-id",
"type": "testDefinition",
"name": "columnValueMaxToBeBetween"
},
"testSuite": {
"id": "suite-id",
"type": "testSuite",
"name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592"
},
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
"deleted": true,
"owners": []
}
Returns
Soft delete returns the test case object withdeleted: true. Hard delete returns no content (204). Restore returns the restored test case object.
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to delete this test case |
404 | NOT_FOUND | Test case with given ID or FQN does not exist |
Was this page helpful?