@@ -1799,7 +1799,7 @@ def scenario_test(self, scenario_test_id: str) -> BatchExperiment:
1799
1799
1800
1800
return self .batch_experiment (batch_id = scenario_test_id )
1801
1801
1802
- def track_run (self , tracked_run : TrackedRun ) -> str :
1802
+ def track_run (self , tracked_run : TrackedRun , instance_id : Optional [ str ] = None ) -> str :
1803
1803
"""
1804
1804
Track an external run.
1805
1805
@@ -1812,6 +1812,9 @@ def track_run(self, tracked_run: TrackedRun) -> str:
1812
1812
----------
1813
1813
tracked_run : TrackedRun
1814
1814
The run to track.
1815
+ instance_id: Optional[str]
1816
+ Optional instance ID if you want to associate your tracked run with
1817
+ an instance.
1815
1818
1816
1819
Returns
1817
1820
-------
@@ -1855,12 +1858,17 @@ def track_run(self, tracked_run: TrackedRun) -> str:
1855
1858
if tracked_run .error is not None and tracked_run .error != "" :
1856
1859
external_result .error_message = tracked_run .error
1857
1860
1858
- return self .new_run (upload_id = url_input .upload_id , external_result = external_result )
1861
+ return self .new_run (
1862
+ upload_id = url_input .upload_id ,
1863
+ external_result = external_result ,
1864
+ instance_id = instance_id ,
1865
+ )
1859
1866
1860
1867
def track_run_with_result (
1861
1868
self ,
1862
1869
tracked_run : TrackedRun ,
1863
1870
polling_options : PollingOptions = _DEFAULT_POLLING_OPTIONS ,
1871
+ instance_id : Optional [str ] = None ,
1864
1872
) -> RunResult :
1865
1873
"""
1866
1874
Track an external run and poll for the result. This is a convenience
@@ -1874,6 +1882,9 @@ def track_run_with_result(
1874
1882
The run to track.
1875
1883
polling_options : PollingOptions
1876
1884
Options to use when polling for the run result.
1885
+ instance_id: Optional[str]
1886
+ Optional instance ID if you want to associate your tracked run with
1887
+ an instance.
1877
1888
1878
1889
Returns
1879
1890
-------
@@ -1893,7 +1904,7 @@ def track_run_with_result(
1893
1904
If the run does not succeed after the polling strategy is
1894
1905
exhausted based on number of tries.
1895
1906
"""
1896
- run_id = self .track_run (tracked_run = tracked_run )
1907
+ run_id = self .track_run (tracked_run = tracked_run , instance_id = instance_id )
1897
1908
1898
1909
return self .run_result_with_polling (
1899
1910
run_id = run_id ,
0 commit comments