Skip to content

Commit afbb6d4

Browse files
authored
[AL-7606] Return model run id when running foundry app (#1321)
1 parent 3f894f0 commit afbb6d4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

labelbox/schema/task.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Task(DbObject):
4242
result_url = Field.String("result_url", "result")
4343
errors_url = Field.String("errors_url", "errors")
4444
type = Field.String("type")
45+
metadata = Field.Json("metadata")
4546
_user: Optional["User"] = None
4647

4748
# Relationships

tests/integration/test_foundry.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ def test_run_foundry_app_with_global_key(foundry_client, data_row, app,
9797
assert task.status == 'COMPLETE'
9898

9999

100+
def test_run_foundry_app_returns_model_run_id(foundry_client, data_row, app):
101+
data_rows = lb.GlobalKeys([data_row.global_key])
102+
task = foundry_client.run_app(
103+
model_run_name=f"test-app-with-global-key-{random_str}",
104+
data_rows=data_rows,
105+
app_id=app.id)
106+
model_run_id = task.metadata['modelRunId']
107+
model_run = foundry_client.client.get_model_run(model_run_id)
108+
assert model_run.uid == model_run_id
109+
110+
100111
def test_run_foundry_app_with_non_existent_data_rows(foundry_client, data_row,
101112
app, random_str):
102113
data_rows = lb.GlobalKeys([data_row.global_key, "non-existent-global-key"])

0 commit comments

Comments
 (0)