Skip to content

Commit

Permalink
feat(workflow): added view to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
shinybrar committed Jan 19, 2023
1 parent 92e5be3 commit 56810e8
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion chime_frb_api/workflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, Dict, List, Optional

import click
from rich import pretty
from rich import pretty, print
from rich.console import Console
from rich.table import Table

Expand Down Expand Up @@ -89,6 +89,29 @@ def details(name: Optional[str] = None, all: bool = False):
console.print(table)


@buckets.command("view", help="View work in a bucket.")
@click.argument("name", type=str, required=True)
@click.option(
"count",
"-c",
"--count",
type=int,
required=False,
default=3,
help="Number of work to show.",
)
def view(name: str, count: int = 3):
"""View work in a bucket.
Args:
name (str): Name of the bucket.
count (int, optional): Number of work to show. Defaults to 3.
"""
buckets = Buckets()
work = buckets.view(query={"pipeline": name}, projection={}, limit=count)
print(work)


def create_row(details: Dict[str, Any]) -> List[str]:
"""Create a row of data for the table.
Expand Down

0 comments on commit 56810e8

Please sign in to comment.