Python
from openlayer import Openlayer
client = Openlayer()
test_results = client.tests.list_results(
"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
inference_pipeline_id="c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
)
for test_result in test_results.items:
print(test_result.id, test_result.status)
import Openlayer from 'openlayer';
const client = new Openlayer();
const testResults = await client.tests.listResults('9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d', {
inferencePipelineId: 'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f',
});
console.log(testResults.items);
package main
import (
"context"
"fmt"
"github.com/openlayer-ai/openlayer-go"
)
client := openlayer.NewClient()
results, err := client.Tests.ListResults(
context.TODO(),
"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
openlayer.TestListResultsParams{
InferencePipelineID: openlayer.F("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"),
IncludeInsights: openlayer.F(true),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", results.Items)
import com.openlayer.api.client.OpenlayerClient;
import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
import com.openlayer.api.models.tests.TestListResultsParams;
import com.openlayer.api.models.tests.TestListResultsResponse;
OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();
TestListResultsParams params = TestListResultsParams.builder()
.testId("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
.inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
.addStatus("failing")
.build();
TestListResultsResponse testResults = client.tests().listResults(params);
require "openlayer"
openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])
test_results = openlayer.tests.list_results(
"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
inference_pipeline_id: "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
)
puts(test_results)
curl --request GET \
--url 'https://api.openlayer.com/v1/tests/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d/results?page=1&perPage=25' \
--header 'Authorization: Bearer <token>'
{
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"projectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"inferencePipelineId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"dateDataStarts": "2024-03-22T11:31:01.185Z",
"dateDataEnds": "2024-03-22T11:31:01.185Z",
"status": "passing",
"statusMessage": "Test successfully processed.",
"goal": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number": 1,
"name": "No duplicate rows",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"description": "This test checks for duplicate rows in the dataset.",
"type": "integrity",
"subtype": "duplicateRowCount",
"creatorId": "589ece63-49a2-41b4-98e1-10547761d4b0",
"originProjectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"thresholds": [
{
"measurement": "duplicateRowCount",
"insightName": "duplicateRowCount",
"insightParameters": [
{
"name": "column_name",
"value": "<unknown>"
}
],
"thresholdMode": "manual",
"operator": "<=",
"value": 0
}
],
"dateArchived": "2024-03-22T11:31:01.185Z",
"suggested": false,
"commentCount": 0,
"evaluationWindow": 3600,
"delayWindow": 0,
"archived": false,
"usesMlModel": false,
"usesValidationDataset": true,
"usesTrainingDataset": false,
"usesReferenceDataset": false,
"usesProductionData": false
},
"goalId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"expectedValues": [
{
"measurement": "<string>",
"upperThreshold": 123,
"lowerThreshold": 123
}
],
"rows": "https://api.openlayer.com/v1/versions/3fa85f64-5717-4562-b3fc-2c963f66afa6/rows?label=validation",
"rowsBody": {
"columnFilters": [
{
"measurement": "openlayer_token_set",
"operator": "contains_none",
"value": [
"cat"
]
}
],
"searchQueryOr": [
"<string>"
],
"searchQueryAnd": [
"<string>"
],
"notSearchQueryOr": [
"<string>"
],
"notSearchQueryAnd": [
"<string>"
],
"rowIdList": [
123
],
"excludeRowIdList": [
123
]
}
}
],
"lastUnskippedResult": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"projectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"inferencePipelineId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"dateDataStarts": "2024-03-22T11:31:01.185Z",
"dateDataEnds": "2024-03-22T11:31:01.185Z",
"status": "passing",
"statusMessage": "Test successfully processed.",
"goal": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number": 1,
"name": "No duplicate rows",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"description": "This test checks for duplicate rows in the dataset.",
"type": "integrity",
"subtype": "duplicateRowCount",
"creatorId": "589ece63-49a2-41b4-98e1-10547761d4b0",
"originProjectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"thresholds": [
{
"measurement": "duplicateRowCount",
"insightName": "duplicateRowCount",
"insightParameters": [
{
"name": "column_name",
"value": "<unknown>"
}
],
"thresholdMode": "manual",
"operator": "<=",
"value": 0
}
],
"dateArchived": "2024-03-22T11:31:01.185Z",
"suggested": false,
"commentCount": 0,
"evaluationWindow": 3600,
"delayWindow": 0,
"archived": false,
"usesMlModel": false,
"usesValidationDataset": true,
"usesTrainingDataset": false,
"usesReferenceDataset": false,
"usesProductionData": false
},
"goalId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"expectedValues": [
{
"measurement": "<string>",
"upperThreshold": 123,
"lowerThreshold": 123
}
],
"rows": "https://api.openlayer.com/v1/versions/3fa85f64-5717-4562-b3fc-2c963f66afa6/rows?label=validation",
"rowsBody": {
"columnFilters": [
{
"measurement": "openlayer_token_set",
"operator": "contains_none",
"value": [
"cat"
]
}
],
"searchQueryOr": [
"<string>"
],
"searchQueryAnd": [
"<string>"
],
"notSearchQueryOr": [
"<string>"
],
"notSearchQueryAnd": [
"<string>"
],
"rowIdList": [
123
],
"excludeRowIdList": [
123
]
}
}
}{
"message": "<string>"
}{
"code": 123,
"error": "<string>"
}Tests
List the test results for a test
List the test results for a test.
Python
from openlayer import Openlayer
client = Openlayer()
test_results = client.tests.list_results(
"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
inference_pipeline_id="c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
)
for test_result in test_results.items:
print(test_result.id, test_result.status)
import Openlayer from 'openlayer';
const client = new Openlayer();
const testResults = await client.tests.listResults('9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d', {
inferencePipelineId: 'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f',
});
console.log(testResults.items);
package main
import (
"context"
"fmt"
"github.com/openlayer-ai/openlayer-go"
)
client := openlayer.NewClient()
results, err := client.Tests.ListResults(
context.TODO(),
"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
openlayer.TestListResultsParams{
InferencePipelineID: openlayer.F("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"),
IncludeInsights: openlayer.F(true),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", results.Items)
import com.openlayer.api.client.OpenlayerClient;
import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
import com.openlayer.api.models.tests.TestListResultsParams;
import com.openlayer.api.models.tests.TestListResultsResponse;
OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();
TestListResultsParams params = TestListResultsParams.builder()
.testId("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
.inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
.addStatus("failing")
.build();
TestListResultsResponse testResults = client.tests().listResults(params);
require "openlayer"
openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])
test_results = openlayer.tests.list_results(
"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
inference_pipeline_id: "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
)
puts(test_results)
curl --request GET \
--url 'https://api.openlayer.com/v1/tests/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d/results?page=1&perPage=25' \
--header 'Authorization: Bearer <token>'
{
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"projectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"inferencePipelineId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"dateDataStarts": "2024-03-22T11:31:01.185Z",
"dateDataEnds": "2024-03-22T11:31:01.185Z",
"status": "passing",
"statusMessage": "Test successfully processed.",
"goal": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number": 1,
"name": "No duplicate rows",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"description": "This test checks for duplicate rows in the dataset.",
"type": "integrity",
"subtype": "duplicateRowCount",
"creatorId": "589ece63-49a2-41b4-98e1-10547761d4b0",
"originProjectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"thresholds": [
{
"measurement": "duplicateRowCount",
"insightName": "duplicateRowCount",
"insightParameters": [
{
"name": "column_name",
"value": "<unknown>"
}
],
"thresholdMode": "manual",
"operator": "<=",
"value": 0
}
],
"dateArchived": "2024-03-22T11:31:01.185Z",
"suggested": false,
"commentCount": 0,
"evaluationWindow": 3600,
"delayWindow": 0,
"archived": false,
"usesMlModel": false,
"usesValidationDataset": true,
"usesTrainingDataset": false,
"usesReferenceDataset": false,
"usesProductionData": false
},
"goalId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"expectedValues": [
{
"measurement": "<string>",
"upperThreshold": 123,
"lowerThreshold": 123
}
],
"rows": "https://api.openlayer.com/v1/versions/3fa85f64-5717-4562-b3fc-2c963f66afa6/rows?label=validation",
"rowsBody": {
"columnFilters": [
{
"measurement": "openlayer_token_set",
"operator": "contains_none",
"value": [
"cat"
]
}
],
"searchQueryOr": [
"<string>"
],
"searchQueryAnd": [
"<string>"
],
"notSearchQueryOr": [
"<string>"
],
"notSearchQueryAnd": [
"<string>"
],
"rowIdList": [
123
],
"excludeRowIdList": [
123
]
}
}
],
"lastUnskippedResult": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"projectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"inferencePipelineId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"dateDataStarts": "2024-03-22T11:31:01.185Z",
"dateDataEnds": "2024-03-22T11:31:01.185Z",
"status": "passing",
"statusMessage": "Test successfully processed.",
"goal": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"number": 1,
"name": "No duplicate rows",
"dateCreated": "2024-03-22T11:31:01.185Z",
"dateUpdated": "2024-03-22T11:31:01.185Z",
"description": "This test checks for duplicate rows in the dataset.",
"type": "integrity",
"subtype": "duplicateRowCount",
"creatorId": "589ece63-49a2-41b4-98e1-10547761d4b0",
"originProjectVersionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"thresholds": [
{
"measurement": "duplicateRowCount",
"insightName": "duplicateRowCount",
"insightParameters": [
{
"name": "column_name",
"value": "<unknown>"
}
],
"thresholdMode": "manual",
"operator": "<=",
"value": 0
}
],
"dateArchived": "2024-03-22T11:31:01.185Z",
"suggested": false,
"commentCount": 0,
"evaluationWindow": 3600,
"delayWindow": 0,
"archived": false,
"usesMlModel": false,
"usesValidationDataset": true,
"usesTrainingDataset": false,
"usesReferenceDataset": false,
"usesProductionData": false
},
"goalId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"expectedValues": [
{
"measurement": "<string>",
"upperThreshold": 123,
"lowerThreshold": 123
}
],
"rows": "https://api.openlayer.com/v1/versions/3fa85f64-5717-4562-b3fc-2c963f66afa6/rows?label=validation",
"rowsBody": {
"columnFilters": [
{
"measurement": "openlayer_token_set",
"operator": "contains_none",
"value": [
"cat"
]
}
],
"searchQueryOr": [
"<string>"
],
"searchQueryAnd": [
"<string>"
],
"notSearchQueryOr": [
"<string>"
],
"notSearchQueryAnd": [
"<string>"
],
"rowIdList": [
123
],
"excludeRowIdList": [
123
]
}
}
}{
"message": "<string>"
}{
"code": 123,
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your workspace API key. See Find your API key for more information.
Path Parameters
The test id.
Query Parameters
The page to return in a paginated query.
Required range:
x >= 1Maximum number of items to return per page.
Required range:
1 <= x <= 100Retrive test results for a specific project version.
Retrive test results for a specific inference pipeline.
Include the insights linked to each test result
Filter by status(es).
Filter for results that use data ending after the start timestamp.
Filter for results that use data starting before the end timestamp.
Was this page helpful?