Skip to content

Add a Database Reco Counts report command #2441

Description

@adamtheturtle

Summary

Add a command for the Database Reco Counts report once vws-python supports it.

Real Vuforia exposes POST /imagetargets/databases/{database_id}/reports/recoCounts, which asks for a per-target recognition-count report for a month and returns a presigned URL. That URL serves a CSV with a target_id,reco_count header once the report has been generated, and 404s until then.

Blocked on VWS-Python/vws-python#3133, which adds the client support. vws-python-mock implements both halves of the endpoint as of VWS-Python/vws-python-mock#3357, so the command can be tested end to end.

Suggested scope

A vws get-database-reco-counts-report command, following the conventions of get-database-summary-report:

  • --server-access-key / --server-secret-key as usual.
  • --month, taking YYYY-mm. Only the current month and the previous month are accepted by Vuforia; anything else is a Fail. Defaulting to the current month is worth considering.
  • --database-id, which this endpoint needs and no other command does. It is not derivable from the server keys and no VWS endpoint returns it — the target manager shows it, and vws-web-tools exposes it via get_database_details. It should be required=True with an envvar alongside the credential options.
  • Waiting for the report to become available, since the download 404s until it is ready. Either wait by default with a --timeout-seconds option in the style of wait-for-target-processed, or make waiting opt-in — worth deciding explicitly rather than by accident.

Output shape needs a decision too. Every existing report command dumps a dataclass as YAML, but this report is a table of rows and the natural artefact is the CSV itself. Writing the CSV to a path via an --output-file-path option, as generate-vumark does, is probably the better fit; emitting YAML rows to stdout for consistency with the sibling commands is the alternative. Either way, a report for a database with no recognitions should produce an empty table rather than an error.

Acceptance criteria

  • The command requests, waits for and retrieves a report.
  • Tests cover a successful report, a rejected month, and a mismatched database ID, running against vws-python-mock.
  • A database with no recognitions produces an empty report rather than a failure.
  • Documentation, --help output and a news fragment are included.

Notes

The mock's coverage of this endpoint is not verified against real Vuforia yet — the shared test credentials carry no database ID, so the tests are mock-only (VWS-Python/vws-python-mock#3359, VWS-Python/vws-python-mock#3360). The mock's reports are always header-only until VWS-Python/vws-python-mock#3356 lands, so tests cannot yet assert on non-empty report bodies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions