Skip to content

Add Database Reco Counts report client support #3134

Description

@adamtheturtle

Summary

VWS can generate a per-database recognition counts report: POST /imagetargets/databases/<database_id>/reports/recoCounts with a {"month": "YYYY-mm"} body returns a presigned_url, and that URL serves a CSV report (target_id,reco_count) once generation has finished. The client library has no support for this.

vws-python-mock implements the endpoint, including the report-generation delay, the 404 returned while the report is not yet available, the text/plain content type the presigned URL actually serves, and validation of the month and the database ID. So the client can be tested through real HTTP transports without bespoke test doubles.

Suggested scope

  • Add synchronous and asynchronous methods for requesting a reco counts report, following the existing VWS / AsyncVWS conventions.
  • Accept the database ID and the month, and return the transaction ID and presigned URL in a typed structure.
  • Add a method for downloading a generated report, and a wait/poll helper for the period during which the presigned URL returns 404, mirroring wait_for_target_processed.
  • Parse the CSV into a typed result, or document why raw content is returned.
  • Raise useful public exceptions for an invalid month, a month outside the requestable range (only the current and previous month are accepted), and an unknown database ID.
  • Add public API documentation, examples, and a news fragment.

Acceptance criteria

  • Both clients cover request → wait → download.
  • Tests exercise both clients against vws-python-mock, including a report which is not yet available.
  • Tests cover the documented failure responses for the month and database ID.

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