(
*,
environment_key: str,
feature_name: str,
window_start: datetime,
window_end: datetime,
granularity: ExposureGranularity,
)
| 219 | |
| 220 | |
| 221 | def get_exposure_buckets( |
| 222 | *, |
| 223 | environment_key: str, |
| 224 | feature_name: str, |
| 225 | window_start: datetime, |
| 226 | window_end: datetime, |
| 227 | granularity: ExposureGranularity, |
| 228 | ) -> list[ExposureBucket]: |
| 229 | rows = _get_clickhouse_client().execute( |
| 230 | EXPOSURE_BUCKETS_QUERY.format( |
| 231 | bucket_function=_EXPOSURE_BUCKET_FUNCTIONS[granularity] |
| 232 | ), |
| 233 | { |
| 234 | "environment_key": environment_key, |
| 235 | "exposure_event": EXPOSURE_EVENT_NAME, |
| 236 | "feature_name": feature_name, |
| 237 | "window_start": window_start, |
| 238 | "window_end": window_end, |
| 239 | }, |
| 240 | ) |
| 241 | return [ |
| 242 | ExposureBucket( |
| 243 | variant=variant, |
| 244 | bucket=bucket, |
| 245 | first_exposed_identities=int(first_exposed_identities), |
| 246 | quarantined=bool(quarantined), |
| 247 | ) |
| 248 | for quarantined, variant, bucket, first_exposed_identities in rows |
| 249 | ] |
| 250 | |
| 251 | |
| 252 | def get_metric_variant_stats( |
no test coverage detected
searching dependent graphs…