Skip to content

Commit

Permalink
Fixing more bugs revealed by prepping for SciPy. (#699)
Browse files Browse the repository at this point in the history
* partition.py was missing a lot of methods; I just went down the list.

* Now testing every Content method in PartitionedArray.

* The '__array__' parameter shouldn't be deeply passed through VirtualArray.

* Don't let PartitionedArrays contain empty partitions. It leads to type errors.

* Fixed column-sampling (for list lengths) in case of a nullable sample.
  • Loading branch information
jpivarski committed Feb 5, 2021
1 parent db7c657 commit 83cf114
Show file tree
Hide file tree
Showing 5 changed files with 471 additions and 223 deletions.
17 changes: 15 additions & 2 deletions src/awkward/operations/convert.py
Expand Up @@ -3200,8 +3200,21 @@ def _ParquetState_arrow_to_awkward(table, struct_only, masked, unpack):
out = out.content
else:
out = out.field(item)
if masked and not isinstance(out, ak.layout.ByteMaskedArray):
out = out.toByteMaskedArray()
if masked:
if isinstance(out, ak.layout.BitMaskedArray):
out = out.toByteMaskedArray()
elif isinstance(out, ak.layout.ListOffsetArray32) and isinstance(
out.content, ak.layout.BitMaskedArray
):
out = ak.layout.ListOffsetArray32(
out.offsets, out.content.toByteMaskedArray()
)
elif isinstance(out, ak.layout.ListOffsetArray64) and isinstance(
out.content, ak.layout.BitMaskedArray
):
out = ak.layout.ListOffsetArray64(
out.offsets, out.content.toByteMaskedArray()
)
return out


Expand Down

0 comments on commit 83cf114

Please sign in to comment.