Skip to content

Commit

Permalink
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions beaker/services/experiment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Sequence, Set, Union

from ..aliases import PathOrStr
@@ -7,8 +8,6 @@
from .service_client import ServiceClient

if TYPE_CHECKING:
from datetime import datetime, timedelta

from rich.progress import TaskID


@@ -235,10 +234,10 @@ def logs(
:param task: The task ID, name, or object of a specific task from the Beaker experiment
to fetch logs for. Required if there are multiple tasks in the experiment.
:param quiet: If ``True``, progress won't be displayed.
:param since: Only show logs since a particular time. Could be a UTC `datetime` object,
(naive datetimes will be treated as UTC), a timestamp in the form of RFC 3339
:param since: Only show logs since a particular time. Could be a :class:`~datetime.datetime` object
(naive datetimes will be treated as UTC), a timestamp string in the form of RFC 3339
(e.g. "2013-01-02T13:23:37Z"), or a relative time
(e.g. a timedelta or a string like "42m").
(e.g. a :class:`~datetime.timedelta` or a string like "42m").
:raises ValueError: The experiment has no tasks or jobs, or the experiment has multiple tasks but
``task`` is not specified.
9 changes: 4 additions & 5 deletions beaker/services/job.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import time
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Union

from ..data_model import *
from ..exceptions import *
from .service_client import ServiceClient

if TYPE_CHECKING:
from datetime import datetime, timedelta

from rich.progress import Progress, TaskID


@@ -109,7 +108,7 @@ def logs(
self,
job: Union[str, Job],
quiet: bool = False,
since: Optional[Union[str, "datetime", "timedelta"]] = None,
since: Optional[Union[str, datetime, timedelta]] = None,
) -> Generator[bytes, None, None]:
"""
Download the logs for a job.
@@ -122,10 +121,10 @@ def logs(
:param job: The Beaker job ID or object.
:param quiet: If ``True``, progress won't be displayed.
:param since: Only show logs since a particular time. Could be a :class:`~datetime.datetime` object,
:param since: Only show logs since a particular time. Could be a :class:`~datetime.datetime` object
(naive datetimes will be treated as UTC), a timestamp string in the form of RFC 3339
(e.g. "2013-01-02T13:23:37Z"), or a relative time
(e.g. a `~datetime.timedelta` or a string like "42m").
(e.g. a :class:`~datetime.timedelta` or a string like "42m").
:raises JobNotFound: If the job can't be found.
:raises HTTPError: Any other HTTP exception that can occur.

0 comments on commit 6e38e46

Please sign in to comment.