mozilla/mozanalysis

Clarify custom_enrollments_query docs

Closed this issue · 0 comments

These docs are a bit confusing and incomplete for custom_enrollments_query:

A full SQL query to be used in the main query:

`WITH raw_enrollments AS ({custom_enrollments_query})`

N.B. this query’s results must be uniquely keyed by (client_id, branch), or else your results will be subtly wrong.

This text (or similar) is copied for multiple functions within this package, any updates should be made to all relevant function docs.

We should make the following updates to clarify:

  • make it more clear that the custom_enrollments_query is only the part inside the parens (i.e., should not include "WITH raw_enrollments AS"
  • per #93, the query needs to produce columns client_id, branch, enrollment_date, and num_enrollment_events
  • per #93, it should have no more than one row per (client_id, branch)