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

Example in merge_union_of_records is a no-op #2212

Closed
ivirshup opened this issue Feb 6, 2023 · 1 comment · Fixed by #2213
Closed

Example in merge_union_of_records is a no-op #2212

ivirshup opened this issue Feb 6, 2023 · 1 comment · Fixed by #2213
Assignees
Labels
docs Improvements or additions to documentation

Comments

@ivirshup
Copy link

ivirshup commented Feb 6, 2023

Which documentation?

Python docstrings

What needs to be documented?

In the example given, the result type is the same as the input type:

Quote from the docstring
Simplifies unions of records, e.g.

    >>> array = ak.Array([{"a": 1}, {"b": 2}])

into records of options, i.e.

    >>> ak.merge_union_of_records(array)
    <Array [{a: 1, b: None}, {a: None, ...}] type='2 * {a: ?int64, b: ?int64}'>
>>> import awkward as ak
>>> ak.Array([{"a": 1}, {"b": 2}]).type.show()
2 * {
    a: ?int64,
    b: ?int64
}
>>> ak.merge_union_of_records(ak.Array([{"a": 1}, {"b": 2}])).type.show()
2 * {
    a: ?int64,
    b: ?int64
}
@ivirshup ivirshup added the docs Improvements or additions to documentation label Feb 6, 2023
@agoose77
Copy link
Collaborator

agoose77 commented Feb 6, 2023

Gah, this is the reason for doctests. I made a last minute change here. Thanks for catching it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants