Skip to content

GH-51265: [Python] Refactor and centralize duplicated reader docstrin… - #51630

Open
MarkCruz911 wants to merge 1 commit into
apache:mainfrom
MarkCruz911:main
Open

MarkCruz911 wants to merge 1 commit into
apache:mainfrom
MarkCruz911:main

Conversation

@MarkCruz911

@MarkCruz911 MarkCruz911 commented Sep 29, 2026 •

Copy link
Copy Markdown

Rationale for this change

This PR resolves issue #51265 by refactoring duplicated reader docstrings in python/pyarrow/parquet/core.py to adhere to DRY (Don't Repeat Yourself) principles.

What changes are included in this PR?

  • Centralized shared documentation for thrift_string_size_limit, thrift_container_size_limit, and schema_depth_limit into a module-level constant _READER_COMMON_DOCS.
  • Replaced three duplicated docstring blocks across ParquetFile, ParquetDataset, and _read_table_docstring with {_READER_COMMON_DOCS} f-string interpolation.

Are these changes tested?

Yes, verified syntax validity and confirmed via git diff and grep checks that duplicated string blocks were eliminated without changing the end-user documentation output.

Are there any user-facing changes?

No. Rendered documentation and API signatures remain identical.

Was AI used for this PR?

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human

@github-actions

Copy link
Copy Markdown

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

@MarkCruz911

Copy link
Copy Markdown
Author

Hi @AlenkaF @raulcd @rok, friendly ping on this! Whenever you have a moment, could you please approve the workflows to run the CI checks and review the changes? Thanks!

@raulcd raulcd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We seem to be using already _read_docstring_common on lots of them, can't this be part of that?
It seems wrong to have both _read_docstring_common and a new _READER_COMMON_DOCS

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