Skip to content

Reports

Published Reports

Reports is a thin wrapper over the DataFrame Store that scopes every operation to the /reports subtree.

Writers publish analysis reports (for example, the promotion arbiter publishing contest results) and readers (dashboards, scripts) list and retrieve them. Reads are uncached, so every get() reflects the latest published report.

Workbench REPL

Experiment with the Reports() class in the Workbench REPL.

Reports: Published analysis reports (DataFrames) stored in the Workbench DataFrame Store

Reports

Bases: DFStore

Reports: Published analysis reports stored under the /reports subtree of the DataFrame Store.

A thin wrapper over DFStore that scopes every operation (list/get/upsert/delete) to the /reports subtree. Writers publish reports (e.g. the promotion arbiter publishing contest results); readers (dashboards, scripts) list and get them. Reads are uncached: every get() hits S3.

Common Usage
reports = Reports()

# List all published reports
reports.list()

# Publish a report
reports.upsert("/contests/my-endpoint", ranked_df)

# Retrieve a report
df = reports.get("/contests/my-endpoint")

# Delete a report
reports.delete("/contests/my-endpoint")
Source code in src/workbench/api/reports.py
class Reports(DFStore):
    """Reports: Published analysis reports stored under the /reports subtree of the DataFrame Store.

    A thin wrapper over DFStore that scopes every operation (list/get/upsert/delete)
    to the /reports subtree. Writers publish reports (e.g. the promotion arbiter
    publishing contest results); readers (dashboards, scripts) list and get them.
    Reads are uncached: every get() hits S3.

    Common Usage:
        ```python
        reports = Reports()

        # List all published reports
        reports.list()

        # Publish a report
        reports.upsert("/contests/my-endpoint", ranked_df)

        # Retrieve a report
        df = reports.get("/contests/my-endpoint")

        # Delete a report
        reports.delete("/contests/my-endpoint")
        ```
    """

    def __init__(self):
        """Reports Init: a DFStore scoped to the /reports subtree"""
        super().__init__(path_prefix="/reports")

__init__()

Reports Init: a DFStore scoped to the /reports subtree

Source code in src/workbench/api/reports.py
def __init__(self):
    """Reports Init: a DFStore scoped to the /reports subtree"""
    super().__init__(path_prefix="/reports")