File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -751,6 +751,8 @@ class ManagedJobCodeGen:
751
751
752
752
>> codegen = ManagedJobCodeGen.show_jobs(...)
753
753
"""
754
+ # TODO: the try..except.. block is for backward compatibility. Remove it in
755
+ # v0.8.0.
754
756
_PREFIX = textwrap .dedent ("""\
755
757
managed_job_version = 0
756
758
try:
@@ -800,13 +802,17 @@ def stream_logs(cls,
800
802
# We inspect the source code of the function here for backward
801
803
# compatibility.
802
804
# TODO: change to utils.stream_logs(job_id, job_name, follow) in v0.8.0.
803
- # Import libraries required by `stream_logs`
805
+ # Import libraries required by `stream_logs`. The try...except... block
806
+ # should be removed in v0.8.0.
804
807
code = textwrap .dedent ("""\
805
808
import os
806
809
807
810
from sky.skylet import job_lib, log_lib
808
811
from sky.skylet import constants
809
- from sky.jobs.utils import stream_logs_by_id
812
+ try:
813
+ from sky.jobs.utils import stream_logs_by_id
814
+ except ImportError:
815
+ from sky.spot.spot_utils import stream_logs_by_id
810
816
from typing import Optional
811
817
""" )
812
818
code += inspect .getsource (stream_logs )
You can’t perform that action at this time.
0 commit comments