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-35623: [C++][Python] FixedShapeTensorType.ToString() should print the type's parameters #36496

Merged
merged 7 commits into from
Oct 9, 2023

Conversation

AlenkaF
Copy link
Member

@AlenkaF AlenkaF commented Jul 6, 2023

Rationale for this change

The string representation of two different FixedShapeTensorType objects is currently the same: extension<arrow.fixed_shape_tensor>.

What changes are included in this PR?

Override general type ToString() method for FixedShapeTensorType. The string representation of a tensor in this PR is proposed as follows:

extension<arrow.fixed_shape_tensor[value_type=*, shape=[*]]

Are these changes tested?

Yes, in Python and in C++.

Are there any user-facing changes?

No.

Copy link
Member

@rok rok left a comment

Choose a reason for hiding this comment

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

This would be useful! Let's add a c++ test and consider a JSON string?

cpp/src/arrow/extension/fixed_shape_tensor.h Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting review Awaiting review awaiting changes Awaiting changes labels Jul 6, 2023
@AlenkaF AlenkaF marked this pull request as ready for review August 24, 2023 09:16
@AlenkaF
Copy link
Member Author

AlenkaF commented Aug 24, 2023

@rok @jorisvandenbossche this should be ready for review with the suggestions included.

Copy link
Member

@rok rok left a comment

Choose a reason for hiding this comment

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

Leaving a suggestion for string helpers. LGTM otherwise!

cpp/src/arrow/extension/fixed_shape_tensor.cc Outdated Show resolved Hide resolved
cpp/src/arrow/extension/fixed_shape_tensor.cc Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Aug 24, 2023
@AlenkaF AlenkaF marked this pull request as draft September 27, 2023 06:33
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Oct 2, 2023
Copy link
Member

@rok rok left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for adding the utility function!

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Oct 2, 2023
cpp/src/arrow/util/print.h Outdated Show resolved Hide resolved
cpp/src/arrow/extension/fixed_shape_tensor.cc Outdated Show resolved Hide resolved
cpp/src/arrow/extension/fixed_shape_tensor.cc Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Oct 2, 2023
Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Oct 3, 2023
@AlenkaF AlenkaF marked this pull request as ready for review October 5, 2023 13:45
@AlenkaF AlenkaF requested a review from bkietz October 5, 2023 13:45
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Oct 5, 2023
@AlenkaF AlenkaF merged commit 76f987e into apache:main Oct 9, 2023
38 checks passed
@AlenkaF AlenkaF removed the awaiting merge Awaiting merge label Oct 9, 2023
@AlenkaF AlenkaF deleted the gh-35623-tensor-type-str branch October 9, 2023 03:50
@AlenkaF
Copy link
Member Author

AlenkaF commented Oct 9, 2023

Thank you all for the reviews and suggestions!

@AlenkaF AlenkaF added this to the 14.0.0 milestone Oct 9, 2023
@conbench-apache-arrow
Copy link

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

There was 1 benchmark result indicating a performance regression:

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

@conbench-apache-arrow
Copy link

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

There was 1 benchmark result indicating a performance regression:

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

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
…print the type's parameters (apache#36496)

### Rationale for this change

The string representation of two different `FixedShapeTensorType` objects is currently the same: `extension<arrow.fixed_shape_tensor>`.

### What changes are included in this PR?

Override general type `ToString()` method for `FixedShapeTensorType`. The string representation of a tensor in this PR is proposed as follows:

``` 
extension<arrow.fixed_shape_tensor[value_type=*, shape=[*]]
```
### Are these changes tested?

Yes, in Python and in C++.

### Are there any user-facing changes?

No.
* Closes: apache#35623

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…print the type's parameters (apache#36496)

### Rationale for this change

The string representation of two different `FixedShapeTensorType` objects is currently the same: `extension<arrow.fixed_shape_tensor>`.

### What changes are included in this PR?

Override general type `ToString()` method for `FixedShapeTensorType`. The string representation of a tensor in this PR is proposed as follows:

``` 
extension<arrow.fixed_shape_tensor[value_type=*, shape=[*]]
```
### Are these changes tested?

Yes, in Python and in C++.

### Are there any user-facing changes?

No.
* Closes: apache#35623

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…print the type's parameters (apache#36496)

### Rationale for this change

The string representation of two different `FixedShapeTensorType` objects is currently the same: `extension<arrow.fixed_shape_tensor>`.

### What changes are included in this PR?

Override general type `ToString()` method for `FixedShapeTensorType`. The string representation of a tensor in this PR is proposed as follows:

``` 
extension<arrow.fixed_shape_tensor[value_type=*, shape=[*]]
```
### Are these changes tested?

Yes, in Python and in C++.

### Are there any user-facing changes?

No.
* Closes: apache#35623

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: AlenkaF <frim.alenka@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.

[Python] FixedShapeTensorType.ToString() should print the type's parameters
5 participants