Skip to content
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

Merged
merged 13 commits into from
Feb 14, 2024

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added the ExtensionArray Extending pandas with custom dtypes or arrays. label Dec 18, 2023
@jbrockmendel
Copy link
Member Author

Error: /home/runner/work/pandas/pandas/pandas/core/arrays/base.py:334:EX03:pandas.api.extensions.ExtensionArray._from_sequence_of_strings:flake8 error: line 2, col 4: E121 continuation line under-indented for hanging indent

@mroeschke is this check new? i dont see what it is complaining about

jbrockmendel and others added 2 commits February 2, 2024 12:20
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@jbrockmendel
Copy link
Member Author

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
Copy link
Member

@mroeschke mroeschke Feb 3, 2024

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?

@jbrockmendel
Copy link
Member Author

jbrockmendel commented Feb 4, 2024 via email

@mroeschke mroeschke added this to the 3.0 milestone Feb 14, 2024
@mroeschke mroeschke merged commit 6d999c0 into pandas-dev:main Feb 14, 2024
47 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-from_sequence_of_strings branch February 15, 2024 02:43
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* 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 <10647082+mroeschke@users.noreply.github.com>

---------

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants