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

MINOR: [Python][Docs] Add examples for MapArray.from_arrays #37656

Merged

Conversation

slobodan-ilic
Copy link
Contributor

Rationale for this change

This PR enriched the MapArray.from_arrays with some nice examples. The examples are from the real-world scenario of working with survey data (scaled down, of course).

What changes are included in this PR?

The only change that this PR presents is to the docstring of the MapArray.from_arrays function.

Are these changes tested?

Does not apply

Are there any user-facing changes?

Yes, the docstring of the MapArray.from_arrays function.

@github-actions
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}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

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.

Great example! I left a few small comments, let me know what you think. I thought it might be clearer to explicitly state that the numpy representation is there to visualize the data that we will put in the MapArray.

python/pyarrow/array.pxi Outdated Show resolved Hide resolved
python/pyarrow/array.pxi Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Sep 11, 2023
@slobodan-ilic
Copy link
Contributor Author

slobodan-ilic commented Sep 11, 2023

Great example! I left a few small comments, let me know what you think. I thought it might be clearer to explicitly state that the numpy representation is there to visualize the data that we will put in the MapArray.

I accepted both of your changes. Thanks so much. I'm glad you find the example useful.

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.

Last few comments. After that LGTM! I added a committer for final review.

python/pyarrow/array.pxi Outdated Show resolved Hide resolved
python/pyarrow/array.pxi Outdated Show resolved Hide resolved
@kou kou changed the title Add examples for MapArray.from_arrays [Python][Docs] Add examples for MapArray.from_arrays Sep 11, 2023
@kou
Copy link
Member

kou commented Sep 11, 2023

Could you read the auto generated comment?
#37656 (comment)

@slobodan-ilic slobodan-ilic force-pushed the add-examples-for-map-array-from-arrays branch from 5602b85 to 9bfd081 Compare September 12, 2023 06:38
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.

Hi @slobodan-ilic and thank you for this great example!
Adding a suggestion to fix the doctest error.

We should also add an issue for the PR to be linked to, as Kou already mentioned.

python/pyarrow/array.pxi Outdated Show resolved Hide resolved
python/pyarrow/array.pxi Outdated Show resolved Hide resolved
@slobodan-ilic
Copy link
Contributor Author

Hi @slobodan-ilic and thank you for this great example! Adding a suggestion to fix the doctest error.

We should also add an issue for the PR to be linked to, as Kou already mentioned.

@AlenkaF I was thinking about adding MINOR: [Python] Add examples for MapArray.from_arrays rather than creating an issue, since I believe it's a minor PR (as per second part of the autogenerated comment that @kou referenced). But if you say the issue creation is the way to go forward, please lmk and I'll do so.

@slobodan-ilic slobodan-ilic changed the title [Python][Docs] Add examples for MapArray.from_arrays MINOR: [Python][Docs] Add examples for MapArray.from_arrays Sep 12, 2023
@AlenkaF
Copy link
Member

AlenkaF commented Sep 12, 2023

@AlenkaF I was thinking about adding MINOR: [Python] Add examples for MapArray.from_arrays rather than creating an issue, since I believe it's a minor PR (as per second part of the autogenerated comment that @kou referenced). But if you say the issue creation is the way to go forward, please lmk and I'll do so.

Yes of course, that is totally fine 👍

@slobodan-ilic slobodan-ilic force-pushed the add-examples-for-map-array-from-arrays branch from 0c11829 to d02059e Compare September 12, 2023 11:04
@raulcd
Copy link
Member

raulcd commented Sep 12, 2023

Thanks for the contribution @slobodan-ilic !

@slobodan-ilic
Copy link
Contributor Author

Thanks for the contribution @slobodan-ilic !

Hi @raulcd! Long time no see ❤️

@slobodan-ilic
Copy link
Contributor Author

slobodan-ilic commented Sep 12, 2023

@AlenkaF I was thinking about adding MINOR: [Python] Add examples for MapArray.from_arrays rather than creating an issue, since I believe it's a minor PR (as per second part of the autogenerated comment that @kou referenced). But if you say the issue creation is the way to go forward, please lmk and I'll do so.

Yes of course, that is totally fine 👍

@AlenkaF I'm seeing some failures in the AppVeyor build (even after accepting your changes), and they seem unrelated to my changes. Furthermore, when I run the offending tests locally, they all pass. This seems to be one: python/pyarrow/tests/test_fs.py::test_get_file_info_with_selector. How should we resolve this?

@raulcd
Copy link
Member

raulcd commented Sep 12, 2023

@AlenkaF I'm seeing some failures in the AppVeyor build (even after accepting your changes), and they seem unrelated to my changes.

It seems to be failing on main as seen here: https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/48012043
I've opened a different issue to track it here: #37675

@AlenkaF
Copy link
Member

AlenkaF commented Sep 12, 2023

@AlenkaF I'm seeing some failures in the AppVeyor build (even after accepting your changes), and they seem unrelated to my changes. Furthermore, when I run the offending tests locally, they all pass. This seems to be one: python/pyarrow/tests/test_fs.py::test_get_file_info_with_selector. How should we resolve this?

There is already an open PR to fix this issue #37558 so you can ignore this failing build.

python/pyarrow/array.pxi Outdated Show resolved Hide resolved
python/pyarrow/array.pxi Outdated Show resolved Hide resolved
python/pyarrow/array.pxi Outdated Show resolved Hide resolved
@danepitkin
Copy link
Member

I'm fine leaving it the way it is! I do agree the example is more relateable this way.

@slobodan-ilic slobodan-ilic force-pushed the add-examples-for-map-array-from-arrays branch from d02059e to 8b7d800 Compare September 12, 2023 16:24
@slobodan-ilic slobodan-ilic force-pushed the add-examples-for-map-array-from-arrays branch from 8b7d800 to fd68a1e Compare September 13, 2023 10:23
@danepitkin
Copy link
Member

Added one last suggestion, otherwise LGTM!

@slobodan-ilic slobodan-ilic force-pushed the add-examples-for-map-array-from-arrays branch from 1630b82 to 735bb49 Compare September 13, 2023 16:14
@slobodan-ilic
Copy link
Contributor Author

Added one last suggestion, otherwise LGTM!

Addressed. 💯

python/pyarrow/array.pxi Outdated Show resolved Hide resolved
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.

Thank you for you contribution @slobodan-ilic!

@AlenkaF AlenkaF merged commit 28266f1 into apache:main Sep 14, 2023
11 checks passed
@AlenkaF AlenkaF removed the awaiting committer review Awaiting committer review label Sep 14, 2023
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Sep 14, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 28266f1.

There were no benchmark performance regressions. 🎉

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

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…#37656)

### Rationale for this change
This PR enriched the `MapArray.from_arrays` with some nice examples. The examples are from the real-world scenario of working with survey data (scaled down, of course).

### What changes are included in this PR?
The only change that this PR presents is to the docstring of the `MapArray.from_arrays` function.

### Are these changes tested?
Does not apply

### Are there any user-facing changes?
Yes, the docstring of the `MapArray.from_arrays` function.

Lead-authored-by: Slobodan Ilic <[email protected]>
Co-authored-by: Slobodan Ilic <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Co-authored-by: Dane Pitkin <[email protected]>
Signed-off-by: AlenkaF <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…#37656)

### Rationale for this change
This PR enriched the `MapArray.from_arrays` with some nice examples. The examples are from the real-world scenario of working with survey data (scaled down, of course).

### What changes are included in this PR?
The only change that this PR presents is to the docstring of the `MapArray.from_arrays` function.

### Are these changes tested?
Does not apply

### Are there any user-facing changes?
Yes, the docstring of the `MapArray.from_arrays` function.

Lead-authored-by: Slobodan Ilic <[email protected]>
Co-authored-by: Slobodan Ilic <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Co-authored-by: Dane Pitkin <[email protected]>
Signed-off-by: AlenkaF <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants