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-45003: [Python][Docs] Update docstrings for metadata methods on Field and Schema classes #45004

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

amoeba
Copy link
Member

@amoeba amoeba commented Dec 11, 2024

Rationale for this change

The docstrings here are not completely accurate. See #45003.

I looked at whether it would make more sense or be more natural for methods like these to return an empty dict instead of None and I think None feels better from an API design and usage perspective.

What changes are included in this PR?

Updated docstrings to reflect actual behavior.

Are these changes tested?

While the changes don't need testing, I did check to see if we have unit tests for the behavior that's been documented here. We do.

Are there any user-facing changes?

Accurate docs.

@kou kou changed the title GH-45003: Update docstrings for metadata methods on Field and Schema classes GH-45003: [Python][Docs] Update docstrings for metadata methods on Field and Schema classes Dec 12, 2024
@amoeba
Copy link
Member Author

amoeba commented Dec 12, 2024

For reviewers: I considered changing these to return an empty dict instead of None but wasn't sure what was more Pythonic or made the most sense as it relates to PyArrow. Thoughts appreciated.

@AlenkaF
Copy link
Member

AlenkaF commented Dec 12, 2024

If I look for example at pa.Table.replace_schema_metadata, the metadata there can be a dict or None. So I agree with returning None here also when the metadata is empty.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 12, 2024
@raulcd raulcd merged commit a1627b9 into apache:main Dec 13, 2024
15 of 16 checks passed
@raulcd raulcd removed the awaiting committer review Awaiting committer review label Dec 13, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label Dec 13, 2024
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit a1627b9.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

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.

3 participants