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

GH-35329: [Python] Address pandas.types.is_sparse deprecation #35366

Merged
merged 2 commits into from
May 9, 2023

Conversation

mroeschke
Copy link
Contributor

@mroeschke mroeschke commented Apr 28, 2023

Rationale for this change

pandas is deprecating pandas.types.is_sparse in 2.1

What changes are included in this PR?

Changing usages of is_sparse to the recommended migration isinstance(dtype, pd.SparseDtype)

Are these changes tested?

Are there any user-facing changes?

No

closes #35329

Copy link
Member

@AlenkaF AlenkaF left a comment

Choose a reason for hiding this comment

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

Thank you for the update! +1
The MacOS failure is not related.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels May 9, 2023
@AlenkaF AlenkaF changed the title MINOR: Address pandas.types.is_sparse deprecation GH-35329: [Python] Address pandas.types.is_sparse deprecation May 9, 2023
@github-actions
Copy link

github-actions bot commented May 9, 2023

@github-actions
Copy link

github-actions bot commented May 9, 2023

⚠️ GitHub issue #35329 has been automatically assigned in GitHub to PR creator.

@AlenkaF AlenkaF merged commit de6c3cd into apache:main May 9, 2023
@mroeschke mroeschke deleted the dpr/pandas/is_sparse branch May 9, 2023 16:38
@ursabot
Copy link

ursabot commented May 9, 2023

Benchmark runs are scheduled for baseline = b73ddc3 and contender = de6c3cd. de6c3cd is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️1.54% ⬆️0.09%] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️3.7% ⬆️2.5%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] de6c3cd2 ec2-t3-xlarge-us-east-2
[Finished] de6c3cd2 test-mac-arm
[Finished] de6c3cd2 ursa-i9-9960x
[Finished] de6c3cd2 ursa-thinkcentre-m75q
[Finished] b73ddc33 ec2-t3-xlarge-us-east-2
[Finished] b73ddc33 test-mac-arm
[Finished] b73ddc33 ursa-i9-9960x
[Finished] b73ddc33 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot
Copy link

ursabot commented May 9, 2023

['Python', 'R'] benchmarks have high level of regressions.
test-mac-arm

liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this pull request May 11, 2023
…pache#35366)

### Rationale for this change

pandas is deprecating `pandas.types.is_sparse` in 2.1

### What changes are included in this PR?

Changing usages of `is_sparse` to the recommended migration `isinstance(dtype, pd.SparseDtype)`

### Are these changes tested?

### Are there any user-facing changes?

No

closes apache#35329
* Closes: apache#35329

Authored-by: Matthew Roeschke <[email protected]>
Signed-off-by: Alenka Frim <[email protected]>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this pull request May 15, 2023
…pache#35366)

### Rationale for this change

pandas is deprecating `pandas.types.is_sparse` in 2.1

### What changes are included in this PR?

Changing usages of `is_sparse` to the recommended migration `isinstance(dtype, pd.SparseDtype)`

### Are these changes tested?

### Are there any user-facing changes?

No

closes apache#35329
* Closes: apache#35329

Authored-by: Matthew Roeschke <[email protected]>
Signed-off-by: Alenka Frim <[email protected]>
rtpsw pushed a commit to rtpsw/arrow that referenced this pull request May 16, 2023
…pache#35366)

### Rationale for this change

pandas is deprecating `pandas.types.is_sparse` in 2.1

### What changes are included in this PR?

Changing usages of `is_sparse` to the recommended migration `isinstance(dtype, pd.SparseDtype)`

### Are these changes tested?

### Are there any user-facing changes?

No

closes apache#35329
* Closes: apache#35329

Authored-by: Matthew Roeschke <[email protected]>
Signed-off-by: Alenka Frim <[email protected]>
raulcd pushed a commit that referenced this pull request May 31, 2023
### Rationale for this change

pandas is deprecating `pandas.types.is_sparse` in 2.1

### What changes are included in this PR?

Changing usages of `is_sparse` to the recommended migration `isinstance(dtype, pd.SparseDtype)`

### Are these changes tested?

### Are there any user-facing changes?

No

closes #35329
* Closes: #35329

Authored-by: Matthew Roeschke <[email protected]>
Signed-off-by: Alenka Frim <[email protected]>
@EBenkler
Copy link

I think this only fixes the issue in python/pyarrow/pandas-shim.pxi, but is_sparse() is also used here:
\envs\develop\lib\site-packages\pyarrow\pandas_compat.py:373: FutureWarning: is_sparse is deprecated and will be removed in a future version. Check isinstance(dtype, pd.SparseDtype) instead.
if _pandas_api.is_sparse(col):

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

Successfully merging this pull request may close these issues.

[Python] pandas is_sparse attribute is deprecated
4 participants