fix: fix Series construction with data as an iterator#1377
fix: fix Series construction with data as an iterator#1377terencehonles wants to merge 1 commit into
Conversation
cmp0xff
left a comment
There was a problem hiding this comment.
Hi @terencehonles , thank you for the proposal. Having checked the Pandas documentation, and it seems that data can indeed be an Iterator.
| check( | ||
| assert_type(pd.Series(iter([1.0])), "pd.Series[float]"), | ||
| pd.Series, | ||
| float, | ||
| ) |
There was a problem hiding this comment.
Several __new__'s have been retyped, but only one test has been added. Please complete the new tests. Alternatively, you can split the old test function into two.
| def __new__( | ||
| cls, | ||
| data: Sequence[_str], | ||
| data: Iterator[_str], |
There was a problem hiding this comment.
Iterator[_str] can be ambiguous, because _str is an Iterable in its own right. However, I don't have more insights how to improve this.
There was a problem hiding this comment.
You can use Iterator[SequenceNotStr[_str]]
|
Hi @terencehonles , would you be able to follow up on this? |
|
Unless we have some changes in the next few days on this one I would consider closing it since the codebase has drifted a lot and it would be a lot of effort to reconcile them, more than just starting from scratch again. |
|
Will close for now, it has diverged too much, please reopen a fresh PR so we can more easily review it. |
assert_type()to assert the type of any return value