Skip to content

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed Nov 26, 2024
1 parent a765cbc commit b18121b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions python/cudf_polars/cudf_polars/experimental/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, count: int):


LowerIRTransformer: TypeAlias = (
"GenericTransformer[IR, MutableMapping[IR, PartitionInfo]]"
"GenericTransformer[IR, tuple[IR, MutableMapping[IR, PartitionInfo]]]"
)
"""Protocol for Lowering IR nodes."""

Expand Down Expand Up @@ -278,22 +278,22 @@ def _(

nrows = max(ir.df.shape()[0], 1)
count = math.ceil(nrows / rows_per_partition)
length = math.ceil(nrows / count)

slices = [
DataFrameScan(
ir.schema,
ir.df.slice(offset, length),
ir.projection,
ir.predicate,
ir.config_options,
)
for offset in range(0, nrows, length)
]
new_node = Union(ir.schema, None, *slices)
return new_node, {slice: PartitionInfo(count=1) for slice in slices} | {
new_node: PartitionInfo(count=count)
}

if count > 1:
length = math.ceil(nrows / count)
slices = [
DataFrameScan(
ir.schema,
ir.df.slice(offset, length),
ir.projection,
ir.predicate,
ir.config_options,
)
for offset in range(0, nrows, length)
]
return rec(Union(ir.schema, None, *slices))

return rec.state["default_mapper"](ir)


##
Expand All @@ -307,7 +307,7 @@ def _(
) -> tuple[IR, MutableMapping[IR, PartitionInfo]]:
# zlice must be None
if ir.zlice is not None:
return rec.state["default_mapper"](ir)
return rec.state["default_mapper"](ir) # pragma: no cover

# Lower children
children, _partition_info = zip(*(rec(c) for c in ir.children), strict=False)
Expand Down

0 comments on commit b18121b

Please sign in to comment.