-
Notifications
You must be signed in to change notification settings - Fork 565
PYTHON-1359 Fix for numpy>=1.24.0 #1169
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
The CI fails even after I have reverted my fix commit in 77892a5 for testing, see https://ci.appveyor.com/project/DataStax/python-driver/builds/47482656. |
Minimal `example.py`: ```python from cassandra.cluster import Cluster from cassandra.query import tuple_factory from cassandra.protocol import NumpyProtocolHandler import pandas as pd cluster = Cluster() session = cluster.connect() session.row_factory = tuple_factory session.client_protocol_handler = NumpyProtocolHandler print(pd.DataFrame(session.execute("SELECT broadcast_port FROM system.local").one())) ``` Result with numpy<1.24.0: ``` $ python3 example.py broadcast_port 0 7000 ``` Result with numpy>=1.24.0: ``` $ python3 example.py /usr/lib/python3/dist-packages/cassandra/io/libevreactor.py:370: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions. self.process_io_buffer() Empty DataFrame Columns: [] Index: [] ```
77892a5
to
39a937e
Compare
Thanks for the PR @weisslj! Have you signed the Contributor License Agreement for contributions to DataStax open source projects? If not you can find it at https://cla.datastax.com/. Thanks! |
@absurdfarce sorry for the long delay, I completely missed the notification! I know have signed the Contributor License Agreement! |
@absurdfarce any chance to get this merged soon? It would help us a lot to have this fix included upstream 🙏 |
This is a very nice find indeed @weisslj ! I just looked over the general context of this change and your PR; everything looks good to me. I'm running a test build on our CI infrastructure to confirm that everything behaves as expected and we get the expected improvements in our tests. Assuming there aren't any surprises there (and I'm really not expecting any) I'll merge this straightaway. |
Confirmed that the test_cython_protocol_handlers issues are addressed by this patch (as expected). Calling it good and ready to merge this one. Thanks for the fix @weisslj! |
Reported also in https://datastax-oss.atlassian.net/browse/PYTHON-1359, minimal
example.py
:Result with numpy<1.24.0:
Result with numpy>=1.24.0: