-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Use isinstance for is_iterator on Cygwin #46477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes pandas-dev#45158 Keep original implementation if not on Cygwin, and choose the implementation at compile time to avoid performance hits from the extra branch. [Test results on Cygwin are available are available here](https://github.com/DWesl/pandas/runs/5648361139?check_suite_focus=true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not really sure what you are trying to fix here, and how this accomplishes it.
As noted in #45158, >>> import pandas as pd
>>> stamp = pd.Timestamp("2010-01-03T07:23:48")
>>> pd._libs.lib.is_iterator(stamp)
True
>>> list(stamp)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'Timestamp' object is not iterable
>>> pd.__version__
'1.3.4'
>>> import collections.abc
>>> isinstance(stamp, collections.abc.Iterator)
False
>>> next(stamp)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'Timestamp' object is not an iterator Since there are multiple places in the code-base that apply
As for how this works, the IF ...:
...
ELSE:
... construct here is a Cython compile-time conditional that "works in a similar way to the |
@DWesl i get your explanation. We don't have any compile time defs like this for cygwin, nor do we test for it at all. This really should be fixed upstream. |
Alternately, you could just declare that Cygwin is an unsupported platform and close as WONTFIX, then perhaps suggest that anyone who needs pandas on Cygwin should use a version from before #31294 went in (probably EDIT: you replied before I finished. I'll report it to CPython once the issue tracker migration is complete. |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Thanks for the PR, but agreed that this should probably be fixed upstream. Since this is unlikely to move forward. Closing |
Fixes #45158
Keep original implementation if not on Cygwin, and choose the implementation at compile time to avoid performance hits from the extra branch.
Test results on Cygwin are available are available here
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.