Skip to content

Report Store

ReportStore is the S3-backed PDF store for Workbench, mirroring DFStore (upsert/put, get, list, summary, details, check, delete, delete_recursive).

Storage Layout & Naming Convention

All reports live under the reports/ prefix inside your configured WORKBENCH_BUCKET, organized artifact-first so store.list(prefix="/models/<name>") lists every auto and custom report for that artifact:

  • Auto reports: /<artifact_type>/<artifact_name>/auto/<report_name>
  • /data_sources/aqsol_data/auto/data_quality -> s3://<WORKBENCH_BUCKET>/reports/data_sources/aqsol_data/auto/data_quality.pdf
  • /feature_sets/aqsol_features/auto/data_quality
  • /models/aqsol-regression/auto/model_performance
  • Artifact custom reports: /<artifact_type>/<artifact_name>/custom/<report_name>
  • /models/aqsol-regression/custom/cmax_model -> s3://<WORKBENCH_BUCKET>/reports/models/aqsol-regression/custom/cmax_model.pdf
  • Shared / multi-artifact reports: /shared/<topic>/<report_name>
  • /shared/percent_f_model/percent_f_data_quality
  • Logical locations omit the .pdf extension (trailing .pdf is stripped automatically if passed).
  • Objects are uploaded with ContentType="application/pdf" and ContentDisposition="inline", plus optional ASCII-sanitized S3 Metadata (title, summary, author, artifact, etc.).

Storing Reports

upsert() (and its alias put()) accepts three input types:

  1. A workbench.reports.Report instance (rendered, linted, frames published to DFStore, and uploaded in one call)
  2. A local PDF file path (str or pathlib.Path)
  3. Raw PDF bytes
from workbench.api import ReportStore

store = ReportStore()

# From a workbench.reports.Report instance
loc = store.upsert("/harmony/cmax/cmax_model", report, metadata={"author": "briford"})

# From a local PDF file (put is an alias for upsert)
loc = store.put("/harmony/cmax/cmax_model", "cmax_model.pdf")

# From raw PDF bytes
loc = store.upsert("/harmony/cmax/raw_copy", pdf_bytes)

Listing, Retrieving, and Sharing

# List all reports or filter by namespace prefix
store.list()
store.list(prefix="/harmony")
store.summary(prefix="/auto")

# Check existence and inspect S3 object metadata without downloading the PDF
store.check("/harmony/cmax/cmax_model")
store.metadata("/harmony/cmax/cmax_model")
store.s3_uri("/harmony/cmax/cmax_model")

# Retrieve raw PDF bytes
pdf_bytes = store.get("/harmony/cmax/cmax_model")

# Or download directly to a file or directory
path = store.get("/harmony/cmax/cmax_model", dest_path="/tmp/reports/")

# Generate a time-limited presigned URL for sharing
url = store.presigned_url("/harmony/cmax/cmax_model", expires_in=3600)

# Delete a single report or an entire namespace
store.delete("/harmony/cmax/cmax_model")
store.delete_recursive("/testing/scratch")

Linking Reports to Artifacts

Every Workbench artifact (DataSource, FeatureSet, Model, Endpoint, and local artifacts) supports 0..N linked report locations stored in its workbench_reports metadata:

from workbench.api import DataSource, Model

model = Model("aqsol-regression")

# Inspect current links
model.get_reports()
# ['/models/aqsol-regression/auto/model_performance']

# Attach a custom report (deduplicated, normalized)
model.add_report("/models/aqsol-regression/custom/cmax_model")

# Remove a link (does not delete the PDF from ReportStore)
model.remove_report("/models/aqsol-regression/custom/cmax_model")

# Replace the full list
model.set_reports([
    "/models/aqsol-regression/auto/model_performance",
    "/models/aqsol-regression/custom/cmax_model",
])

Any report linked on an artifact automatically appears as a clickable PDF link in the Workbench Dashboard's details panel for that artifact.

Endpoint-Safe Core Class

Like DFStoreCore, workbench.core.report_store_core.ReportStoreCore accepts explicit s3_bucket and boto3_session arguments (falling back to WORKBENCH_BUCKET / Parameter Store) so it can be used safely inside lightweight containers without ConfigManager or AWSAccountClamp.