-
Notifications
You must be signed in to change notification settings - Fork 223
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
fix: from_dataframe with numpy==1.26.1 and type handling in python 3.9 #1823
Conversation
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1823 +/- ##
==========================================
+ Coverage 84.48% 85.04% +0.55%
==========================================
Files 135 135
Lines 9006 9028 +22
==========================================
+ Hits 7609 7678 +69
+ Misses 1397 1350 -47
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
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.
Will a np.array of one dimension with 0 be considered a None?
No, it will not. It also wasn't before. |
can we add a test for it? |
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
📝 Docs are deployed on https://ft-fix-from-dataframe--jina-docs.netlify.app 🎉 |
We need to add a matrix and test with python 3.8, since is the minimal version we mantained we need to make sure we test it. |
We perform a check that doesn't work anymore with new versions of numpy, because they switches equality semantics to broadcast over every element in the array.
This PR fixes that by treating np arrays as a special cases in the affected check. It also does the same for tf, torch, and jax, just because == semantics on tensor-like objects can always be a bit surprising.
The numpy version in question (
1.26.1
) doesn't support Python 3.8 or down, but we do. Therefore, poetry can't lock to that version. To circumvent this, I am here manually installing the "problematic" numpy version in the CI. For the same reason I am bumping some tests to run on Python 3.9.No new tests since the existing tests already fail with the numpy version in question, and are fixed by the fix (see failing check of the CI run after the new numpy version, but before the fix was pushed, here).
Also includes a fix to handle typing changes in python 3.9 and above, by using the
get_args
helper instead of.__args__
.closes #1821