def METHOD_NAME(
    project_ids: List[int],
    start: datetime,
) -> Generator[DetectorPayload, None, None]:
    projects_per_query = options.get("statistical_detectors.query.batch_size")
    assert projects_per_query > 0
    for projects in chunked(Project.objects.filter(id__in=project_ids), projects_per_query):
        try:
            function_payloads = query_functions(projects, start)
        except Exception as e:
            sentry_sdk.capture_exception(e)
            continue
        yield from function_payloads