File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ def __exit__(
257
257
) -> None :
258
258
logger .debug (
259
259
"Automatically closing run '%s' in status %s" ,
260
- self .id if self ._user_config .run .mode == "online" else "unregistered" ,
260
+ self .id
261
+ if self ._user_config .run .mode == "online" and self ._sv_obj
262
+ else "unregistered" ,
261
263
self ._status ,
262
264
)
263
265
@@ -940,7 +942,10 @@ def executor(self) -> Executor:
940
942
def name (self ) -> str | None :
941
943
"""Return the name of the run"""
942
944
if not self ._sv_obj :
943
- raise RuntimeError ("Run has not been initialised" )
945
+ logger .warning (
946
+ "Attempted to get name on non initialized run - returning None"
947
+ )
948
+ return None
944
949
return self ._sv_obj .name
945
950
946
951
@property
@@ -954,7 +959,10 @@ def status(
954
959
):
955
960
"""Return the status of the run"""
956
961
if not self ._sv_obj :
957
- raise RuntimeError ("Run has not been initialised" )
962
+ logger .warning (
963
+ "Attempted to get name on non initialized run - returning cached value"
964
+ )
965
+ return self ._status
958
966
return self ._sv_obj .status
959
967
960
968
@property
@@ -966,7 +974,10 @@ def uid(self) -> str:
966
974
def id (self ) -> str | None :
967
975
"""Return the unique id of the run"""
968
976
if not self ._sv_obj :
969
- raise RuntimeError ("Run has not been initialised" )
977
+ logger .warning (
978
+ "Attempted to get name on non initialized run - returning None"
979
+ )
980
+ return None
970
981
return self ._sv_obj .id
971
982
972
983
@skip_if_failed ("_aborted" , "_suppress_errors" , False )
You can’t perform that action at this time.
0 commit comments