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

DEPR: make_block #57754

Merged
merged 15 commits into from
Jun 4, 2024
Merged

Conversation

jbrockmendel
Copy link
Member

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mroeschke mroeschke added Internals Related to non-user accessible pandas implementation Deprecate Functionality to remove in pandas labels Mar 7, 2024
@mroeschke mroeschke added this to the 3.0 milestone Mar 7, 2024
@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Mar 26, 2024

I have been working on a branch for pyarrow testing an alternative to_pandas implementation. I will try to finish that this week (that should then also be in time for including it in pyarrow 16.0), and then I will be able to give more concrete feedback here.

@jorisvandenbossche
Copy link
Member

BTW I posted some comments on the issue last week: #56815

@jbrockmendel
Copy link
Member Author

@jorisvandenbossche with #58197 in are we good to move forward here?

@jbrockmendel
Copy link
Member Author

If there are no comments I plan to merge next week

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbrockmendel apologies for the very slow follow-up here!
Added a few minor questions, but yes, in general I am fine with moving forward with this now (pyarrow 16.0 is released with the change for this, so that's the main thing I would have wanted to wait on)

"make_block is deprecated and will be removed in a future version. "
"Use public APIs instead.",
DeprecationWarning,
stacklevel=find_stack_level(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stacklevel=find_stack_level(),
2,

warnings.warn(
# GH#56815
"make_block is deprecated and will be removed in a future version. "
"Use public APIs instead.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to point to the new pd.api.internals.create_dataframe_from_blocks? I know we don't want to encourage that, but TBH I assume this is used by few libraries for a specific reason anyway (exactly the use case for which the pd.api.internals can be used for), and the docstring of that function also asks the user to raise an issue about it

Comment on lines +127 to +136
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
"make_block is deprecated",
DeprecationWarning,
)

return feather.read_feather(
handles.handle, columns=columns, use_threads=bool(use_threads)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this? (the fix is in a released pyarrow, so with latest of both you won't see any warning. Although of course when testing with an older pyarrow you will see it, but I am not sure we added such warning suppressions for other deprecations like DataFrame(mgr)?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need it, no. we need to catch this either here or filterwarnings in a bunch of test places. so i prefer to catch it one place, but OK either way

@jbrockmendel
Copy link
Member Author

Updated, I think addressing all comments

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update! Looks good

@jorisvandenbossche jorisvandenbossche merged commit 6c321bb into pandas-dev:main Jun 4, 2024
47 checks passed
@jbrockmendel jbrockmendel deleted the depr-make_block branch June 4, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: make_block
3 participants