Commit 3b70023
_format_api_dates: materialize iterable inputs (Copilot #4)
Previously `time`/`datetime`/`last_modified`/`begin`/`end` were typed
as `str | Iterable[str] | None`, but the implementation used `len(...)`
and subscripting — generators and other non-Sequence iterables would
have raised at runtime, contradicting the annotation.
Add a single `list(...)` materialization line right after the str
wrap, so any iterable (pandas.Series, numpy.ndarray, generators,
sets) flows through cleanly. The half-bounded NaT/None range form
is preserved.
Verified by passing list / tuple / Series / generator / `[pd.NaT, ...]`
through and getting the expected formatted output in each case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 62a58cf commit 3b70023
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
0 commit comments