Python
from openlayer import Openlayer
client = Openlayer()
test_results = client.commits.test_results.list(
"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
status="failing",
)
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.commits.testResults.list('b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20', {
status: 'failing',
});
console.log(testResults.items);
package main
import (
"context"
"fmt"
"github.com/openlayer-ai/openlayer-go"
)
client := openlayer.NewClient()
results, err := client.Commits.TestResults.List(
context.TODO(),
"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
openlayer.CommitTestResultListParams{
Status: openlayer.F(openlayer.CommitTestResultListParamsStatusFailing),
},
)
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.commits.testresults.TestResultListParams;
import com.openlayer.api.models.commits.testresults.TestResultListResponse;
OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();
TestResultListParams params = TestResultListParams.builder()
.projectVersionId("b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20")
.status(TestResultListParams.Status.FAILING)
.build();
TestResultListResponse testResults = client.commits().testResults().list(params);
require "openlayer"
openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])
test_results = openlayer.commits.test_results.list(
"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
status: :failing
)
puts(test_results)
curl --request GET \
--url https://api.openlayer.com/v1/versions/{projectVersionId}/results \
--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
]
}
}
]
}{
"code": 123,
"error": "<string>"
}Development
List commit test results
List the test results for a project commit (project version).
Python
from openlayer import Openlayer
client = Openlayer()
test_results = client.commits.test_results.list(
"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
status="failing",
)
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.commits.testResults.list('b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20', {
status: 'failing',
});
console.log(testResults.items);
package main
import (
"context"
"fmt"
"github.com/openlayer-ai/openlayer-go"
)
client := openlayer.NewClient()
results, err := client.Commits.TestResults.List(
context.TODO(),
"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
openlayer.CommitTestResultListParams{
Status: openlayer.F(openlayer.CommitTestResultListParamsStatusFailing),
},
)
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.commits.testresults.TestResultListParams;
import com.openlayer.api.models.commits.testresults.TestResultListResponse;
OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();
TestResultListParams params = TestResultListParams.builder()
.projectVersionId("b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20")
.status(TestResultListParams.Status.FAILING)
.build();
TestResultListResponse testResults = client.commits().testResults().list(params);
require "openlayer"
openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])
test_results = openlayer.commits.test_results.list(
"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
status: :failing
)
puts(test_results)
curl --request GET \
--url https://api.openlayer.com/v1/versions/{projectVersionId}/results \
--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
]
}
}
]
}{
"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 project version (commit) 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 <= 100Filter objects by test type. Available types are integrity, consistency, performance, fairness, and robustness.
Available options:
integrity, consistency, performance, fairness, robustness Filter for archived tests.
Response
Status OK.
Show child attributes
Show child attributes
Was this page helpful?