PATCH /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"
)
# Retrieve, modify, and update
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
tc.description = "Updated: Validates shop_id max value stays between 1 and 200"
tc.parameterValues = [
{"name": "minValueForMaxInCol", "value": "1"},
{"name": "maxValueForMaxInCol", "value": "200"}
]
updated = TestCases.update(tc)
print(f"Updated to version {updated.version}")
import static org.openmetadata.sdk.fluent.TestCases.*;
var tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
tc.setDescription("Updated: Validates shop_id max value stays between 1 and 200");
var updated = TestCases.update(tc);
# Update by ID
curl -X PATCH "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Validates shop_id max value stays between 1 and 200"},
{"op": "replace", "path": "/parameterValues", "value": [{"name": "minValueForMaxInCol", "value": "1"}, {"name": "maxValueForMaxInCol", "value": "200"}]}
]'
# Update by name
curl -X PATCH "{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}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated description"}
]'
{
"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",
"description": "Updated: Validates shop_id max value stays between 1 and 200",
"version": 0.2,
"updatedAt": 1769982800000,
"updatedBy": "admin",
"testDefinition": {
"id": "def-id",
"type": "testDefinition",
"name": "columnValueMaxToBeBetween",
"fullyQualifiedName": "columnValueMaxToBeBetween",
"deleted": false
},
"testSuite": {
"id": "suite-id",
"type": "testSuite",
"name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592",
"deleted": false
},
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
"parameterValues": [
{"name": "minValueForMaxInCol", "value": "1"},
{"name": "maxValueForMaxInCol", "value": "200"}
],
"deleted": false,
"owners": []
}
Update a Test Case
Update test case properties using JSON Patch
PATCH
/
v1
/
dataQuality
/
testCases
/
{id}
PATCH /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"
)
# Retrieve, modify, and update
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
tc.description = "Updated: Validates shop_id max value stays between 1 and 200"
tc.parameterValues = [
{"name": "minValueForMaxInCol", "value": "1"},
{"name": "maxValueForMaxInCol", "value": "200"}
]
updated = TestCases.update(tc)
print(f"Updated to version {updated.version}")
import static org.openmetadata.sdk.fluent.TestCases.*;
var tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
tc.setDescription("Updated: Validates shop_id max value stays between 1 and 200");
var updated = TestCases.update(tc);
# Update by ID
curl -X PATCH "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Validates shop_id max value stays between 1 and 200"},
{"op": "replace", "path": "/parameterValues", "value": [{"name": "minValueForMaxInCol", "value": "1"}, {"name": "maxValueForMaxInCol", "value": "200"}]}
]'
# Update by name
curl -X PATCH "{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}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated description"}
]'
{
"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",
"description": "Updated: Validates shop_id max value stays between 1 and 200",
"version": 0.2,
"updatedAt": 1769982800000,
"updatedBy": "admin",
"testDefinition": {
"id": "def-id",
"type": "testDefinition",
"name": "columnValueMaxToBeBetween",
"fullyQualifiedName": "columnValueMaxToBeBetween",
"deleted": false
},
"testSuite": {
"id": "suite-id",
"type": "testSuite",
"name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592",
"deleted": false
},
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
"parameterValues": [
{"name": "minValueForMaxInCol", "value": "1"},
{"name": "maxValueForMaxInCol", "value": "200"}
],
"deleted": false,
"owners": []
}
Update a Test Case
Update a test case’s properties using JSON Merge Patch. You can update by ID or by fully qualified name.Update by ID
UUID of the test case to update.
Update by Name
UsePATCH /v1/dataQuality/testCases/name/{fqn} to update by fully qualified name.
Fully qualified name of the test case.
Body Parameters
Send a JSON object with the fields to update. Only provided fields are changed.Updated description in Markdown format.
PATCH /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"
)
# Retrieve, modify, and update
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
tc.description = "Updated: Validates shop_id max value stays between 1 and 200"
tc.parameterValues = [
{"name": "minValueForMaxInCol", "value": "1"},
{"name": "maxValueForMaxInCol", "value": "200"}
]
updated = TestCases.update(tc)
print(f"Updated to version {updated.version}")
import static org.openmetadata.sdk.fluent.TestCases.*;
var tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
tc.setDescription("Updated: Validates shop_id max value stays between 1 and 200");
var updated = TestCases.update(tc);
# Update by ID
curl -X PATCH "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Validates shop_id max value stays between 1 and 200"},
{"op": "replace", "path": "/parameterValues", "value": [{"name": "minValueForMaxInCol", "value": "1"}, {"name": "maxValueForMaxInCol", "value": "200"}]}
]'
# Update by name
curl -X PATCH "{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}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated description"}
]'
{
"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",
"description": "Updated: Validates shop_id max value stays between 1 and 200",
"version": 0.2,
"updatedAt": 1769982800000,
"updatedBy": "admin",
"testDefinition": {
"id": "def-id",
"type": "testDefinition",
"name": "columnValueMaxToBeBetween",
"fullyQualifiedName": "columnValueMaxToBeBetween",
"deleted": false
},
"testSuite": {
"id": "suite-id",
"type": "testSuite",
"name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592",
"deleted": false
},
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
"parameterValues": [
{"name": "minValueForMaxInCol", "value": "1"},
{"name": "maxValueForMaxInCol", "value": "200"}
],
"deleted": false,
"owners": []
}
Returns
Returns the updated test case object with the new version number.Response
Unique identifier for the test case (UUID format).
Test case name.
Fully qualified name of the test case.
Updated description.
Incremented version number.
Error Handling
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid JSON patch or malformed request |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to update this test case |
404 | NOT_FOUND | Test case with given ID or FQN does not exist |
409 | CONFLICT | Concurrent modification detected |
Was this page helpful?
⌘I