-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Nullable integer/boolean/floating support in lib inferencing functions #40914
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
BooleanArray( | ||
np.array([True, False], dtype="bool"), np.array([False, 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.
do we have tests for maybe_convert_bool already? can you integrate with those
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.
No. maybe_convert_bool is only used by python parser.
@@ -676,7 +676,7 @@ def _infer_types(self, values, na_values, try_num_bool=True): | |||
if try_num_bool and is_object_dtype(values.dtype): | |||
# exclude e.g DatetimeIndex here | |||
try: | |||
result = lib.maybe_convert_numeric(values, na_values, False) | |||
result, _ = lib.maybe_convert_numeric(values, na_values, False) |
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.
This will be addressed in #40687, the main PR.
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.
can you fix the return type in this PR? its very odd now
@jreback Not sure I follow here. I'm just following
so that would be tuple[np.ndarray, np.ndarray | None]. We are not returning the masked EA directly since it is an anti-pattern. |
thanks @lithomas1 if you wouldn't mind doing a PR to add doc-strings to the maybe_* routines, the issue is the Returns is now not super obvious. thanks. |
Thanks a lot @lithomas1 ! |
Precursor for #40687