-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: make dtype required in _from_sequence_of_strings #56519
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
TYP: make dtype required in _from_sequence_of_strings #56519
Conversation
@mroeschke is this check new? i dont see what it is complaining about |
Co-authored-by: Matthew Roeschke <[email protected]>
good suggestion, seems to have done the trick |
@@ -316,7 +318,7 @@ def _from_sequence( | |||
|
|||
@classmethod | |||
def _from_sequence_of_strings( | |||
cls, strings, *, dtype: Dtype | None = None, copy: bool = False | |||
cls, strings, *, dtype: ExtensionDtype, copy: bool = 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.
At least for arrow, dtype=None
was supposed to mean "let pa.array
infer the type", and now that can't be done?
This method is only ever called with a dtype object. There’s also a recent
issue about having a dedicated constructor for inference.
…On Sat, Feb 3, 2024 at 2:02 PM Matthew Roeschke ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pandas/core/arrays/arrow/array.py
<#56519 (comment)>:
> @@ -316,7 +318,7 @@ def _from_sequence(
@classmethod
def _from_sequence_of_strings(
- cls, strings, *, dtype: Dtype | None = None, copy: bool = False
+ cls, strings, *, dtype: ExtensionDtype, copy: bool = False
At least for arrow, dtype=None was supposed to mean "let pa.array infer
the type", and now that can't be done?
—
Reply to this email directly, view it on GitHub
<#56519 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5UM6A7CJGWIEV5TNHGKELYR2XXLAVCNFSM6AAAAABAW7H2RSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNRRGEZDQMZQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thanks @jbrockmendel |
* TYP: make dtype required in _from_sequence_of_strings * GH ref * mypy fixup * Move whatsnew * Update pandas/core/arrays/base.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.