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-41985: [Python][Docs] Clarify docstring of pyarrow.compute.scalar() #45668

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chilin0525
Copy link

@chilin0525 chilin0525 commented Mar 4, 2025

Rationale for this change

The current docstring for pyarrow.compute.scalar() is incomplete and potentially misleading. It states that it only accepts "a subset of types" when in reality it accepts any value that can be converted to a pyarrow.Scalar. Additionally, there's no clear explanation of the difference between pyarrow.scalar() and pyarrow.compute.scalar(), which can be confusing for users since both functions have the same name but serve different purposes.

What changes are included in this PR?

This PR updates the docstring for pyarrow.compute.scalar() to clarify that it accepts any value convertible to a pyarrow.Scalar and add a detailed explanation of the difference between pyarrow.scalar() and pyarrow.compute.scalar()

Are these changes tested?

via CI.

Are there any user-facing changes?

No.

@kou
Copy link
Member

kou commented Mar 4, 2025

@github-actions crossbow submit preview-docs

Copy link

github-actions bot commented Mar 4, 2025

Revision: 17fecc6

Submitted crossbow builds: ursacomputing/crossbow @ actions-86db13bc16

Task Status
preview-docs GitHub Actions

@kou
Copy link
Member

kou commented Mar 4, 2025

@jorisvandenbossche It seems that http://crossbow.voltrondata.com/pr_docs/45668/python/api/compute.html doesn't have pyarrow.compute.scalar(). Should we add it to https://github.com/apache/arrow/blob/main/docs/source/python/api/compute.rst ? Or we don't need it in our API reference?

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

Successfully merging this pull request may close these issues.

2 participants