Skip to content

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Oct 2, 2025

  • 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.

Discussed in #62423 among others. This ensures we wrap list in np.array at the top of all arithmetic/comparison/logical methods*.

* Not quite accurate. For logical methods on numpy dtypes we deprecated and now disallow dtype-less sequences. So this does the wrapping on EAs, but doesn't revert that deprecation for non-EA cases.

As a result, Series[dt64] - [datetime_obj] no longer raises. Note that it does return object dtype, which is not what the user in #62524 wants.

This also results in a changed dtype for test_add_list_to_masked_array.

Update I'm working on a branch to deprecate wrapping for tuple and non-list is_list_like(other) and not hasattr(other, "dtype")

@jbrockmendel
Copy link
Member Author

The alternative to np.array is sanitize_array (effectively pd.Series(the_list)._values). That would break the Int64 case bc the None would be cast to NaN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant