-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
REF: de-duplicate Block.__init__ #38134
Conversation
ok for 1.2 |
@jbrockmendel if you can address these comments can get this in |
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.
What's the rationale for this change? Why is it needed to deprecate it? (pyarrow code currently works fine? Or is there a problem with it)
We recently made it so that all our internal calls explicitly pass ndim. Now we're telling other packages (that ideally wouldnt be accessing internals in the first place) they need to do the same. |
But so is there an actual reason to require this, apart from "we are not using the keyword anymore internally" ? If we do the change, we could also keep this for after the 1.2 RC, so the deprecation is only for 1.3, which gives pyarrow time to fix the code and have a release before this is released by pandas. |
The motivation that led me to update all of our internal usages to always pass ndim explicitly was that on other branches I was getting errors related to incorrect ndim inference. (Keep in mind I have active branches for both ArrayManager and EA2D among others and I don't recall off the top of my head which one(s) were producing these errors)
ndim inference isn't going to be particularly slow, but we do call the Block constructors a lot, so it could add up.
In general I think being more explicit and more strict in internals code makes maintenance easier, yes. |
@jbrockmendel can we remove the blocker tag? and do this for 1.3? |
sounds good |
Mothballing pending apache/arrow#8957 |
re-opening; now that make_block is exposed specifically for downstream, we can do the validation there and be stricter in private-internals |
lgtm @jorisvandenbossche if any issues. |
To make it explicit: the PR now no longer includes a deprecation warning. But you still changed the behaviour of |
|
Yep, but thus downstream libraries using |
great |
thanks @jbrockmendel |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff