Commit 2973ff8
committed
fix(customer): accurate number_of_purchases type; empty-input percentile test
- find_purchase_percentile's number_of_purchases is now annotated `float`
(ruff PYI041: float subsumes int) with a docstring noting fractional
thresholds are valid and compared against the integer counts — matching
what ensure_number actually accepts. Fractional thresholds like <= 2.5
are well-defined (equivalent to <= 2), so they are accepted, not rejected.
- Add an empty-input test for DaysBetweenPurchases.purchases_percentile
(returns NaN), for parity with the PurchasesPerCustomer case.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G93Y8H2PH8oaNNfKssd99f1 parent 3802851 commit 2973ff8
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
396 | 407 | | |
397 | 408 | | |
398 | 409 | | |
| |||
0 commit comments