GET /v1/dataQuality/testCases/{id}/testCaseResult
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"
)
# Get test case results
results = TestCases.get_test_case_results("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
for r in results.data:
print(f"{r.timestamp}: {r.testCaseStatus} - {r.result}")
# Get results within a time range
results = TestCases.get_test_case_results(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
start_ts=1769900000000,
end_ts=1769990000000
)
# Add a test result
TestCases.add_test_case_result(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
timestamp=1769982800000,
testCaseStatus="Success",
result="Max value 42 is between 1 and 100",
testResultValue=[
{"name": "maxValue", "value": "42"}
]
)
import static org.openmetadata.sdk.fluent.TestCases.*;
// Get test case results
var results = TestCases.getTestCaseResults("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
for (var r : results.getData()) {
System.out.println(r.getTimestamp() + ": " + r.getTestCaseStatus());
}
// Add a test result
TestCases.addTestCaseResult(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
new TestCaseResult()
.timestamp(1769982800000L)
.testCaseStatus("Success")
.result("Max value 42 is between 1 and 100")
);
# Get test results
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult" \
-H "Authorization: Bearer {access_token}"
# Get results with time range
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult?startTs=1769900000000&endTs=1769990000000" \
-H "Authorization: Bearer {access_token}"
# Add a test result
curl -X PUT "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"timestamp": 1769982800000,
"testCaseStatus": "Success",
"result": "Max value 42 is between 1 and 100",
"testResultValue": [
{"name": "maxValue", "value": "42"}
]
}'
{
"data": [
{
"timestamp": 1769982800000,
"testCaseStatus": "Success",
"result": "Max value 42 is between 1 and 100",
"testResultValue": [
{
"name": "maxValue",
"value": "42"
}
]
},
{
"timestamp": 1769896400000,
"testCaseStatus": "Failed",
"result": "Max value 150 is not between 1 and 100",
"testResultValue": [
{
"name": "maxValue",
"value": "150"
}
]
}
],
"paging": {
"total": 2
}
}
Test Case Results
Get and add test case execution results
GET
/
v1
/
dataQuality
/
testCases
/
{id}
/
testCaseResult
GET /v1/dataQuality/testCases/{id}/testCaseResult
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"
)
# Get test case results
results = TestCases.get_test_case_results("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
for r in results.data:
print(f"{r.timestamp}: {r.testCaseStatus} - {r.result}")
# Get results within a time range
results = TestCases.get_test_case_results(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
start_ts=1769900000000,
end_ts=1769990000000
)
# Add a test result
TestCases.add_test_case_result(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
timestamp=1769982800000,
testCaseStatus="Success",
result="Max value 42 is between 1 and 100",
testResultValue=[
{"name": "maxValue", "value": "42"}
]
)
import static org.openmetadata.sdk.fluent.TestCases.*;
// Get test case results
var results = TestCases.getTestCaseResults("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
for (var r : results.getData()) {
System.out.println(r.getTimestamp() + ": " + r.getTestCaseStatus());
}
// Add a test result
TestCases.addTestCaseResult(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
new TestCaseResult()
.timestamp(1769982800000L)
.testCaseStatus("Success")
.result("Max value 42 is between 1 and 100")
);
# Get test results
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult" \
-H "Authorization: Bearer {access_token}"
# Get results with time range
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult?startTs=1769900000000&endTs=1769990000000" \
-H "Authorization: Bearer {access_token}"
# Add a test result
curl -X PUT "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"timestamp": 1769982800000,
"testCaseStatus": "Success",
"result": "Max value 42 is between 1 and 100",
"testResultValue": [
{"name": "maxValue", "value": "42"}
]
}'
{
"data": [
{
"timestamp": 1769982800000,
"testCaseStatus": "Success",
"result": "Max value 42 is between 1 and 100",
"testResultValue": [
{
"name": "maxValue",
"value": "42"
}
]
},
{
"timestamp": 1769896400000,
"testCaseStatus": "Failed",
"result": "Max value 150 is not between 1 and 100",
"testResultValue": [
{
"name": "maxValue",
"value": "150"
}
]
}
],
"paging": {
"total": 2
}
}
Test Case Results
Retrieve test case execution results or add new results programmatically. Each result includes a status, timestamp, and detailed result values.Get Test Case Results
UUID of the test case.
Start timestamp (epoch milliseconds) to filter results.
End timestamp (epoch milliseconds) to filter results.
Add a Test Case Result
UsePUT /v1/dataQuality/testCases/{id}/testCaseResult to add a new test result.
UUID of the test case.
Body Parameters
Epoch timestamp (milliseconds) of the test execution.
Status of the test execution:
Success, Failed, or Aborted.Human-readable summary of the test result.
GET /v1/dataQuality/testCases/{id}/testCaseResult
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"
)
# Get test case results
results = TestCases.get_test_case_results("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
for r in results.data:
print(f"{r.timestamp}: {r.testCaseStatus} - {r.result}")
# Get results within a time range
results = TestCases.get_test_case_results(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
start_ts=1769900000000,
end_ts=1769990000000
)
# Add a test result
TestCases.add_test_case_result(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
timestamp=1769982800000,
testCaseStatus="Success",
result="Max value 42 is between 1 and 100",
testResultValue=[
{"name": "maxValue", "value": "42"}
]
)
import static org.openmetadata.sdk.fluent.TestCases.*;
// Get test case results
var results = TestCases.getTestCaseResults("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
for (var r : results.getData()) {
System.out.println(r.getTimestamp() + ": " + r.getTestCaseStatus());
}
// Add a test result
TestCases.addTestCaseResult(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
new TestCaseResult()
.timestamp(1769982800000L)
.testCaseStatus("Success")
.result("Max value 42 is between 1 and 100")
);
# Get test results
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult" \
-H "Authorization: Bearer {access_token}"
# Get results with time range
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult?startTs=1769900000000&endTs=1769990000000" \
-H "Authorization: Bearer {access_token}"
# Add a test result
curl -X PUT "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7/testCaseResult" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"timestamp": 1769982800000,
"testCaseStatus": "Success",
"result": "Max value 42 is between 1 and 100",
"testResultValue": [
{"name": "maxValue", "value": "42"}
]
}'
{
"data": [
{
"timestamp": 1769982800000,
"testCaseStatus": "Success",
"result": "Max value 42 is between 1 and 100",
"testResultValue": [
{
"name": "maxValue",
"value": "42"
}
]
},
{
"timestamp": 1769896400000,
"testCaseStatus": "Failed",
"result": "Max value 150 is not between 1 and 100",
"testResultValue": [
{
"name": "maxValue",
"value": "150"
}
]
}
],
"paging": {
"total": 2
}
}
Returns
Get results returns a paginated list of test case result objects, ordered by timestamp (newest first). Add result returns the test case result object that was created.Response
Array of test case result objects.
Show properties
Show properties
Epoch timestamp (milliseconds) of the test execution.
Status of the test:
Success, Failed, or Aborted.Human-readable summary of the test result.
Test Case Status Values
| Status | Description |
|---|---|
Success | The test passed — all assertions were met |
Failed | The test failed — one or more assertions were not met |
Aborted | The test was aborted due to an error or timeout |
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to view or add test results |
404 | NOT_FOUND | Test case with given ID does not exist |
Was this page helpful?
⌘I