Skip to content

GH-45902: [Python][Parquet] Expose ParquetWriter properties and arrow_properties #47087

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

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

Conversation

SoundBot
Copy link

@SoundBot SoundBot commented Jul 12, 2025

Rationale for this change

Exposes ParquetWriter properties via writer.properties and writer.arrow_properties
(see #45902)

What changes are included in this PR?

See above

Are these changes tested?

Yes

Are there any user-facing changes?

Yes, properties are available via writer.properties and writer.arrow_properties

Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@SoundBot SoundBot force-pushed the expose-parquetwrite-props branch 3 times, most recently from f921baf to db3942b Compare July 14, 2025 03:47
@SoundBot SoundBot changed the title [Python][Parquet] Expose ParquetWriter properties and arrow_properties GH-45902: [Python][Parquet] Expose ParquetWriter properties and arrow_properties Jul 14, 2025
Copy link

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

@SoundBot SoundBot marked this pull request as ready for review July 14, 2025 04:18
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.

Thanks for submitting a PR!
From a quick look the test needs a @pytest.mark.pandas mark and some style changes are needed to fix linter errors:

diff --git a/cpp/src/parquet/arrow/writer.cc b/cpp/src/parquet/arrow/writer.cc
index 3724e2edf0..cdaeebc294 100644
--- a/cpp/src/parquet/arrow/writer.cc
+++ b/cpp/src/parquet/arrow/writer.cc
@@ -473,7 +473,9 @@ class FileWriterImpl : public FileWriter {
 
   const WriterProperties& properties() const override { return *writer_->properties(); }
 
-  const ArrowWriterProperties& arrow_properties() const override { return *arrow_properties_; }
+  const ArrowWriterProperties& arrow_properties() const override {
+    return *arrow_properties_;
+  }
 
   ::arrow::MemoryPool* memory_pool() const override {
     return column_write_context_.memory_pool;
diff --git a/python/pyarrow/_parquet.pyx b/python/pyarrow/_parquet.pyx
index f1287d7b8a..6f3b9a5f[43](https://github.com/apache/arrow/actions/runs/16257450496/job/45897414651?pr=47087#step:5:44) 100644
--- a/python/pyarrow/_parquet.pyx
+++ b/python/pyarrow/_parquet.pyx
@@ -2458,7 +2458,6 @@ cdef class WriterPropertiesWrapper(_Weakrefable):
         return self.props.default_column_properties().statistics_enabled()
 
 
-
 cdef class ArrowWriterPropertiesWrapper(_Weakrefable):
     cdef:
         shared_ptr[ArrowWriterProperties] props

I will have a look at the proposed code shortly.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 14, 2025
@SoundBot SoundBot force-pushed the expose-parquetwrite-props branch from db3942b to 23d3161 Compare July 14, 2025 23:48
@SoundBot SoundBot force-pushed the expose-parquetwrite-props branch from 23d3161 to 3adfc51 Compare July 14, 2025 23:54
@SoundBot
Copy link
Author

@AlenkaF thank you, I added @pytest.mark.pandas and ran pre-commit run --all-files

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