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-39440: [Python] Calling pyarrow.dataset.ParquetFileFormat.make_write_options as a class method results in a segfault #40976

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

AlenkaF
Copy link
Member

@AlenkaF AlenkaF commented Apr 3, 2024

Rationale for this change

Calling make_write_options() method as class instead of instance method results in segfault.

What changes are included in this PR?

Adds a type check on self and raises an error if not ParquetFileFormat.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Copy link
Member

@danepitkin danepitkin left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Apr 3, 2024
@pitrou
Copy link
Member

pitrou commented Apr 4, 2024

I don't think it makes sense to add the check here, because we would have to do that on many existing methods. Example:

>>> pa.Array.get_total_buffer_size(0)
Erreur de segmentation

@AlenkaF
Copy link
Member Author

AlenkaF commented Apr 4, 2024

Right, but I would also agree with Joris here: #39440 (comment)

Now, in this case of ParquetFileFormat.make_write_options, it's more important I think, because it makes more sense to indeed try to call this thinking it is a static class method.

@pitrou
Copy link
Member

pitrou commented Apr 4, 2024

I opened cython/cython#6127 on the Cython side. Remember that it's fine to suggest additions to third-party libraries or utilities when it's general enough that it could serve other people.

@pitrou
Copy link
Member

pitrou commented Apr 4, 2024

Right, but I would also agree with Joris here: #39440 (comment)

Now, in this case of ParquetFileFormat.make_write_options, it's more important I think, because it makes more sense to indeed try to call this thinking it is a static class method.

Ah! It makes sense, then. Can you add the rationale as a comment in the source code?

@AlenkaF
Copy link
Member Author

AlenkaF commented Apr 4, 2024

I opened cython/cython#6127 on the Cython side. Remember that it's fine to suggest additions to third-party libraries or utilities when it's general enough that it could serve other people.

Oh cool! Broadening my horizons =)

@AlenkaF
Copy link
Member Author

AlenkaF commented Apr 4, 2024

@pitrou I have added a comment in the last commit: b09cae7.

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
@AlenkaF AlenkaF merged commit 074d45f into apache:main Apr 5, 2024
11 of 12 checks passed
@AlenkaF AlenkaF removed the awaiting committer review Awaiting committer review label Apr 5, 2024
@AlenkaF AlenkaF deleted the gh-39440-make_write_options-segfault branch April 5, 2024 08:54
Copy link

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

There were 4 benchmark results indicating a performance regression:

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

raulcd pushed a commit that referenced this pull request Apr 10, 2024
… for Cython 2 (#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in #40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in #40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
raulcd pushed a commit that referenced this pull request Apr 10, 2024
… for Cython 2 (#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in #40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in #40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request Apr 15, 2024
…_error for Cython 2 (apache#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in apache#40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in apache#40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
tolleybot pushed a commit to tmct/arrow that referenced this pull request May 2, 2024
…ke_write_options as a class method results in a segfault (apache#40976)

### Rationale for this change

Calling `make_write_options()` method as class instead of instance method results in segfault.

### What changes are included in this PR?

Adds a type check on `self` and raises an error if not `ParquetFileFormat`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#39440

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
tolleybot pushed a commit to tmct/arrow that referenced this pull request May 2, 2024
…_error for Cython 2 (apache#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in apache#40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in apache#40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
tolleybot pushed a commit to tmct/arrow that referenced this pull request May 4, 2024
…ke_write_options as a class method results in a segfault (apache#40976)

### Rationale for this change

Calling `make_write_options()` method as class instead of instance method results in segfault.

### What changes are included in this PR?

Adds a type check on `self` and raises an error if not `ParquetFileFormat`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#39440

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
tolleybot pushed a commit to tmct/arrow that referenced this pull request May 4, 2024
…_error for Cython 2 (apache#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in apache#40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in apache#40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
rok pushed a commit to tmct/arrow that referenced this pull request May 8, 2024
…ke_write_options as a class method results in a segfault (apache#40976)

### Rationale for this change

Calling `make_write_options()` method as class instead of instance method results in segfault.

### What changes are included in this PR?

Adds a type check on `self` and raises an error if not `ParquetFileFormat`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#39440

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
rok pushed a commit to tmct/arrow that referenced this pull request May 8, 2024
…_error for Cython 2 (apache#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in apache#40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in apache#40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
rok pushed a commit to tmct/arrow that referenced this pull request May 8, 2024
…ke_write_options as a class method results in a segfault (apache#40976)

### Rationale for this change

Calling `make_write_options()` method as class instead of instance method results in segfault.

### What changes are included in this PR?

Adds a type check on `self` and raises an error if not `ParquetFileFormat`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#39440

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
rok pushed a commit to tmct/arrow that referenced this pull request May 8, 2024
…_error for Cython 2 (apache#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in apache#40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in apache#40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…ke_write_options as a class method results in a segfault (apache#40976)

### Rationale for this change

Calling `make_write_options()` method as class instead of instance method results in segfault.

### What changes are included in this PR?

Adds a type check on `self` and raises an error if not `ParquetFileFormat`.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#39440

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…_error for Cython 2 (apache#41059)

### Rationale for this change

`test_make_write_options_error` has been failing on Cython 2 crossbow build because in older versions of Cython the methods were "regular" C extension method had type check automatically built in. In Cython 3 that is not the case, see cython/cython#6127 and so the check for `ParquetFileFormat` was added in apache#40976.

### What changes are included in this PR?

Checking the error raised for both messages, type check and the check for `ParquetFileFormat` added in apache#40976.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#41043

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
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.

None yet

3 participants