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

Fix a typo #1290

Merged
merged 1 commit into from
Feb 15, 2022
Merged

Fix a typo #1290

merged 1 commit into from
Feb 15, 2022

Conversation

douglasdavis
Copy link
Contributor

Stumbled upon this while working on dask-awkward. It's getting triggered from an upstream concatenate

traceback
In [40]: da[:, :, "x"]
Out[40]: dask.awkward<getitem, npartitions=2>

In [41]: da[:, :, "x"].compute()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [41], in <module>
----> 1 da[:, :, "x"].compute()

File ~/software/repos/dask/dask/base.py:290, in DaskMethodsMixin.compute(self, **kwargs)
    266 def compute(self, **kwargs):
    267     """Compute this dask collection
    268 
    269     This turns a lazy Dask collection into its in-memory equivalent.
   (...)
    288     dask.base.compute
    289     """
--> 290     (result,) = compute(self, traverse=False, **kwargs)
    291     return result

File ~/software/repos/dask/dask/base.py:574, in compute(traverse, optimize_graph, scheduler, get, *args, **kwargs)
    571     postcomputes.append(x.__dask_postcompute__())
    573 results = schedule(dsk, keys, **kwargs)
--> 574 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])

File ~/software/repos/dask/dask/base.py:574, in <listcomp>(.0)
    571     postcomputes.append(x.__dask_postcompute__())
    573 results = schedule(dsk, keys, **kwargs)
--> 574 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])

File ~/software/repos/dask-awkward/src/dask_awkward/core.py:32, in _finalize_array(results)
     30 def _finalize_array(results: Any) -> Any:
     31     if any(isinstance(r, ak.Array) for r in results):
---> 32         return ak.concatenate(results)
     33     elif len(results) == 1 and isinstance(results[0], int):
     34         return results[0]

File ~/.pyenv/versions/3.10.2/envs/dask-awkward/lib/python3.10/site-packages/awkward/_v2/operations/structure/ak_concatenate.py:90, in concatenate(arrays, axis, merge, mergebool, highlevel, behavior)
     87         collapsed = batch[0].mergemany(batch[1:])
     88         batch = [collapsed.merge_as_union(x)]
---> 90 out = batch[0].mergemany(batch[1:])
     91 if isinstance(out, ak._v2.contents.unionarray.UnionArray):
     92     out = out.simplify_uniontype(merge=merge, mergebool=mergebool)

File ~/.pyenv/versions/3.10.2/envs/dask-awkward/lib/python3.10/site-packages/awkward/_v2/contents/listoffsetarray.py:732, in ListOffsetArray.mergemany(self, others)
    728     return self
    729 listarray = ak._v2.contents.listarray.ListArray(
    730     self.starts, self.stops, self._content, None, self._parameters, self._nplike
    731 )
--> 732 return listarray.mergemany(others)

File ~/.pyenv/versions/3.10.2/envs/dask-awkward/lib/python3.10/site-packages/awkward/_v2/contents/listarray.py:941, in ListArray.mergemany(self, others)
    932         raise ValueError(
    933             "cannot merge "
    934             + type(self).__name__
   (...)
    937             + "."
    938         )
    940 tail_contents = contents[1:]
--> 941 nextcontent = contents[0].mergemany(tail_contents)
    943 nextstarts = ak._v2.index.Index64.empty(total_length, self._nplike)
    944 nextstops = ak._v2.index.Index64.empty(total_length, self._nplike)

File ~/.pyenv/versions/3.10.2/envs/dask-awkward/lib/python3.10/site-packages/awkward/_v2/contents/indexedarray.py:541, in IndexedArray.mergemany(self, others)
    538 if len(others) == 0:
    539     return self
--> 541 head, tail = self._merging_strategy(others)
    543 total_length = 0
    544 for array in head:

File ~/.pyenv/versions/3.10.2/envs/dask-awkward/lib/python3.10/site-packages/awkward/_v2/contents/indexedarray.py:467, in IndexedArray._merging_strategy(self, others)
    465 while i < len(others):
    466     other = others[i]
--> 467     if isinstance(other, ak._v2.content.unionarray.UnionArray):
    468         break
    469     else:

AttributeError: module 'awkward._v2' has no attribute 'content'

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

Yes, that should be "contents". Thanks!!!

@jpivarski jpivarski enabled auto-merge (squash) February 15, 2022 19:39
@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #1290 (8caabc8) into main (8e68200) will increase coverage by 1.27%.
The diff coverage is 75.05%.

Impacted Files Coverage Δ
src/awkward/_v2/_connect/numba/arrayview.py 96.24% <ø> (ø)
src/awkward/_v2/_connect/numba/layout.py 87.01% <ø> (ø)
src/awkward/_v2/operations/convert/ak_from_cupy.py 25.00% <0.00%> (-50.00%) ⬇️
src/awkward/_v2/operations/structure/ak_isclose.py 100.00% <ø> (ø)
src/awkward/_v2/operations/convert/ak_to_cupy.py 8.19% <3.44%> (-66.81%) ⬇️
src/awkward/_v2/operations/describe/ak_backend.py 9.52% <9.52%> (ø)
src/awkward/_v2/contents/unmaskedarray.py 54.95% <25.00%> (-1.12%) ⬇️
src/awkward/_v2/contents/indexedarray.py 58.62% <37.14%> (-2.03%) ⬇️
...c/awkward/_v2/operations/describe/ak_to_backend.py 37.50% <37.50%> (ø)
src/awkward/_v2/operations/io/ak_to_json_file.py 47.05% <43.75%> (-27.95%) ⬇️
... and 49 more

@jpivarski jpivarski merged commit 5e49baf into scikit-hep:main Feb 15, 2022
@douglasdavis douglasdavis deleted the ddavis-typo-fix branch February 15, 2022 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants