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-36696: [Go] Improve the MapOf and ListOf helpers #36697

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

wolfeidau
Copy link
Contributor

@wolfeidau wolfeidau commented Jul 14, 2023

Rationale for this change

The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a ListOfWithName which matches the MapOf function in that it takes a name, rather than deriving it from the elements name, which should actually be element.

This just seems clearer to me as an interface, and makes construction a bit more obvious.

What changes are included in this PR?

  • Removed references to panics I can't find
  • Updated error messages for list and map to be clearer with validation errors
  • Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name

Closes #36696

Are these changes tested?

Yes, I added a test for the new ListOfWithName function.

Are there any user-facing changes?

@wolfeidau wolfeidau requested a review from zeroshade as a code owner July 14, 2023 21:26
@github-actions
Copy link

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

* Removed references to panics I can't find
* Updated error messages for list and map to be clearer with validation errors
* Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name
@wolfeidau wolfeidau force-pushed the feat_list_with_name branch from dab43fc to bf8efbb Compare July 14, 2023 21:58
return nil, xerrors.Errorf("parquet: listof repetition must not be repeated, got :%s", rep)
}

if rep == parquet.Repetitions.Repeated || element.RepetitionType() == parquet.Repetitions.Repeated {
Copy link
Member

Choose a reason for hiding this comment

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

rep == parquet.Repetitions.Repeated is redundant here as it is already checked above this.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Jul 17, 2023
zeroshade
zeroshade previously approved these changes Jul 17, 2023
@zeroshade zeroshade dismissed their stale review July 17, 2023 16:02

mistake, should be changes requested

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Jul 17, 2023
Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

remove redundant check.

Is it possible for one of these to call the other to reduce duplicate code between them?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Jul 17, 2023
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 19, 2023
@wolfeidau
Copy link
Contributor Author

@zeroshade sorry for the duplication, I really should have picked this up.

Also sorted out the checks to actually do what I intended, which was make the error messages clearer and more specific to the check performed.

Copy link
Member

@zeroshade zeroshade 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 merge Awaiting merge and removed awaiting change review Awaiting change review labels Jul 20, 2023
@zeroshade zeroshade merged commit 15ee521 into apache:main Jul 20, 2023
@zeroshade zeroshade removed the awaiting merge Awaiting merge label Jul 20, 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 15ee521.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

R-JunmingChen pushed a commit to R-JunmingChen/arrow that referenced this pull request Aug 20, 2023
### Rationale for this change

The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a `ListOfWithName` which matches the `MapOf` function in that it takes a name, rather than deriving it from the elements name, which should actually be `element`.

This just seems clearer to me as an interface, and makes construction a bit more obvious.

### What changes are included in this PR?

* Removed references to panics I can't find
* Updated error messages for list and map to be clearer with validation errors
* Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name

Closes apache#36696 

### Are these changes tested?

Yes, I added a test for the new `ListOfWithName` function.

### Are there any user-facing changes?

* Closes: apache#36696

Authored-by: Mark Wolfe <[email protected]>
Signed-off-by: Matt Topol <[email protected]>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
### Rationale for this change

The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a `ListOfWithName` which matches the `MapOf` function in that it takes a name, rather than deriving it from the elements name, which should actually be `element`.

This just seems clearer to me as an interface, and makes construction a bit more obvious.

### What changes are included in this PR?

* Removed references to panics I can't find
* Updated error messages for list and map to be clearer with validation errors
* Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name

Closes apache#36696 

### Are these changes tested?

Yes, I added a test for the new `ListOfWithName` function.

### Are there any user-facing changes?

* Closes: apache#36696

Authored-by: Mark Wolfe <[email protected]>
Signed-off-by: Matt Topol <[email protected]>
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.

[Go][Parquet] Improve the MapOf and ListOf helpers
2 participants