Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Feb 8, 2022
1 parent 366de4c commit 0ea47a6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
25 changes: 21 additions & 4 deletions renku/cli/log.py
Expand Up @@ -23,10 +23,27 @@
.. code-block:: console
$ renku log
DATE TYPE DESCRIPTION
------------------- ---- -------------
2021-09-21 15:46:02 Run cp A C
2021-09-21 10:52:51 Run cp A B
Activity /activities/be60896d8d984a0bb585e53f7a3146dc
Start Time: 2022-02-03T13:56:27+01:00
End Time: 2022-02-03T13:56:28+01:00
User: John Doe <John.Doe@example.com>
Renku Version: renku 1.0.5
Command: python test.py
Inputs:
input-1: test.py
Parameters:
text: hello
Dataset testset
Date: 2022-02-03T11:26:55+01:00
Changes: created
Title set to: testset
Creators modified:
+ John Doe <John.Doe@example.com>
To show only dataset entries, use ``-d``, to show only workflows, use ``-w``.
You can select a format using the ``--format <format>`` argument.
.. cheatsheet::
:group: Misc
Expand Down
3 changes: 2 additions & 1 deletion renku/core/commands/log.py
Expand Up @@ -17,6 +17,7 @@
# limitations under the License.
"""Log of renku commands."""

from typing import List
from renku.core.commands.view_model.log import LogViewModel
from renku.core.management.command_builder import Command, inject
from renku.core.management.interface.activity_gateway import IActivityGateway
Expand All @@ -35,7 +36,7 @@ def _log(
dataset_gateway: IDatasetGateway,
workflows_only: bool = False,
datasets_only: bool = False,
):
) -> List[LogViewModel]:
"""Get a log of renku commands."""

def _get_all_dataset_versions(dataset: Dataset):
Expand Down
12 changes: 6 additions & 6 deletions renku/core/commands/view_model/log.py
Expand Up @@ -20,7 +20,7 @@
from dataclasses import asdict, dataclass
from datetime import datetime
from enum import Enum
from typing import TYPE_CHECKING, List, Optional, Tuple
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import inject

Expand Down Expand Up @@ -100,12 +100,12 @@ def __init__(
self.description = description
self.agents = agents

def to_dict(self):
def to_dict(self) -> Dict[str, Any]:
"""Return a dict representation of this view model."""
raise NotImplementedError()

@classmethod
def from_activity(cls, activity: "Activity"):
def from_activity(cls, activity: "Activity") -> "ActivityLogViewModel":
"""Create a log entry from an activity."""
from renku.core.models.provenance.agent import Person, SoftwareAgent

Expand Down Expand Up @@ -144,7 +144,7 @@ def from_activity(cls, activity: "Activity"):
)

@classmethod
def from_dataset(cls, dataset: "Dataset"):
def from_dataset(cls, dataset: "Dataset") -> Optional["DatasetLogViewModel"]:
"""Create a log entry from an activity."""
from renku.core.management.interface.dataset_gateway import IDatasetGateway
from renku.core.models.dataset import DatasetChangeType
Expand Down Expand Up @@ -269,7 +269,7 @@ def __init__(
super().__init__(id, date, description, agents)
self.details = details

def to_dict(self):
def to_dict(self) -> Dict[str, Any]:
"""Return a dict representation of this view model."""
return {
"date": self.date.isoformat(),
Expand All @@ -289,7 +289,7 @@ def __init__(self, id: str, date: datetime, description: str, details: ActivityD
super().__init__(id, date, description, agents)
self.details = details

def to_dict(self):
def to_dict(self) -> Dict[str, Any]:
"""Return a dict representation of this view model."""
return {
"date": self.date.isoformat(),
Expand Down

0 comments on commit 0ea47a6

Please sign in to comment.