GET /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"
)
# Get by ID
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
print(f"{tc.fullyQualifiedName.root}: {tc.entityLink.root}")
# Get by ID with fields
tc = TestCases.retrieve(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
fields=["owners", "testDefinition", "testCaseResult"]
)
# Get by fully qualified name
tc = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between"
)
# Get by name with fields
tc = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
fields=["testCaseResult", "testDefinition"]
)
// client is an initialized OpenMetadataClient.
var testCase = client.testCases().get("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
// Get by ID with fields
var testCaseWithFields = client.testCases().get(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
"testCaseResult,testDefinition");
// Get by fully qualified name
var testCaseByName = client.testCases().getByName("sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between");
// Get by name with fields
var testCaseByNameWithFields = client.testCases().getByName(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
"testCaseResult,testDefinition");
# Get by ID
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}"
# Get by ID with fields
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7?fields=testCaseResult,testDefinition" \
-H "Authorization: Bearer {access_token}"
# Get by FQN
curl "{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}"
{
"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.1,
"updatedAt": 1769982759035,
"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": "100"}
],
"deleted": false,
"owners": []
}
Retrieve a Test Case
Get a test case by ID or fully qualified name
GET
/
v1
/
dataQuality
/
testCases
/
{id}
GET /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"
)
# Get by ID
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
print(f"{tc.fullyQualifiedName.root}: {tc.entityLink.root}")
# Get by ID with fields
tc = TestCases.retrieve(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
fields=["owners", "testDefinition", "testCaseResult"]
)
# Get by fully qualified name
tc = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between"
)
# Get by name with fields
tc = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
fields=["testCaseResult", "testDefinition"]
)
// client is an initialized OpenMetadataClient.
var testCase = client.testCases().get("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
// Get by ID with fields
var testCaseWithFields = client.testCases().get(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
"testCaseResult,testDefinition");
// Get by fully qualified name
var testCaseByName = client.testCases().getByName("sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between");
// Get by name with fields
var testCaseByNameWithFields = client.testCases().getByName(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
"testCaseResult,testDefinition");
# Get by ID
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}"
# Get by ID with fields
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7?fields=testCaseResult,testDefinition" \
-H "Authorization: Bearer {access_token}"
# Get by FQN
curl "{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}"
{
"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.1,
"updatedAt": 1769982759035,
"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": "100"}
],
"deleted": false,
"owners": []
}
Retrieve a Test Case
Get a single test case by its unique ID or fully qualified name.Get by ID
string
required
UUID of the test case to retrieve.
string
Comma-separated list of fields to include:
owners, testSuite, testDefinition, testCaseResult.string
default:"non-deleted"
Include
all, deleted, or non-deleted entities.Get by Fully Qualified Name
UseGET /v1/dataQuality/testCases/name/{fqn} to retrieve by fully qualified name.
string
required
Fully qualified name of the test case, for example
sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between.string
Comma-separated list of fields to include:
owners, testSuite, testDefinition, testCaseResult.string
default:"non-deleted"
Include
all, deleted, or non-deleted entities.GET /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"
)
# Get by ID
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
print(f"{tc.fullyQualifiedName.root}: {tc.entityLink.root}")
# Get by ID with fields
tc = TestCases.retrieve(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
fields=["owners", "testDefinition", "testCaseResult"]
)
# Get by fully qualified name
tc = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between"
)
# Get by name with fields
tc = TestCases.retrieve_by_name(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
fields=["testCaseResult", "testDefinition"]
)
// client is an initialized OpenMetadataClient.
var testCase = client.testCases().get("c1bce355-fa2f-48c6-ab4d-fad722a56ed7");
// Get by ID with fields
var testCaseWithFields = client.testCases().get(
"c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
"testCaseResult,testDefinition");
// Get by fully qualified name
var testCaseByName = client.testCases().getByName("sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between");
// Get by name with fields
var testCaseByNameWithFields = client.testCases().getByName(
"sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
"testCaseResult,testDefinition");
# Get by ID
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
-H "Authorization: Bearer {access_token}"
# Get by ID with fields
curl "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7?fields=testCaseResult,testDefinition" \
-H "Authorization: Bearer {access_token}"
# Get by FQN
curl "{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}"
{
"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.1,
"updatedAt": 1769982759035,
"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": "100"}
],
"deleted": false,
"owners": []
}
Returns
Returns a test case object with all requested fields populated.Response
string
Unique identifier for the test case (UUID format).
string
Test case name.
string
Fully qualified name of the test case.
string
Entity link to the target table or column.
object
Reference to the test definition.
object
Reference to the test suite.
array
Parameter values for this test case.
object
Most recent test result. Only included when
fields contains testCaseResult.number
Version number for the entity.
array
List of owners. Only included when
fields contains owners.Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to view this test case |
404 | NOT_FOUND | Test case with given ID or FQN does not exist |
Was this page helpful?