-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: implement module for shared constructor functions #27551
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
@@ -1,16 +1,51 @@ | |||
""" | |||
Constructor functions intended to be shared by pd.array, Series.__init__, |
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.
hmm, I would have left this where it was I think. what is the reasoning for moving this all to construction? (the array parts I am talking)
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.
after trying to move this back im remembering: because core.arrays.__init__
imports a bunch of stuff keeping it there makes import order a hassle
@@ -278,3 +312,241 @@ def array( | |||
|
|||
result = PandasArray._from_sequence(data, dtype=dtype, copy=copy) | |||
return result | |||
|
|||
|
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.
+1 on combing these routines into array module
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.
sure
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.
though im not wild about that name (hard to grep for)
@WillAyd help with mypy complaints? |
I think this is just starting to validate |
mypy fixed, thanks |
core.construction
intended for code to be shared betweenpd.array
,Series.__init__
, andIndex.__new__
. The module should not need to be internals-aware.This only moves array and extract_array to keep the diff contained. The next step would be to move internals.construction.sanitize_array, which is used in a number of non-internals places and satisfies the not-internals-aware condition.
Several functions from core.dtypes.cast would also make more sense here than in their current locations.
update moved sanitize_array too, and updated imports