Skip to content

Commit ab58245

Browse files
lint
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
1 parent f0ce861 commit ab58245

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

python/ray/data/_internal/execution/operators/map_operator.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,9 @@ def __init__(self, min_rows_per_bundle: Optional[int]):
564564
bundle up to this target, but only exceed it if not doing so would
565565
result in an empty bundle.
566566
"""
567-
assert min_rows_per_bundle is None or min_rows_per_bundle >= 0, (
568-
"Min rows per bundle has to be non-negative"
569-
)
567+
assert (
568+
min_rows_per_bundle is None or min_rows_per_bundle >= 0
569+
), "Min rows per bundle has to be non-negative"
570570

571571
self._min_rows_per_bundle = min_rows_per_bundle
572572
self._bundle_buffer: List[RefBundle] = []

python/ray/data/_internal/logical/rules/operator_fusion.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ def _can_fuse(self, down_op: PhysicalOperator, up_op: PhysicalOperator) -> bool:
179179
(
180180
isinstance(up_logical_op, AbstractMap)
181181
and isinstance(down_logical_op, AbstractMap)
182-
and self._can_fuse_map_ops(up_logical_op, down_logical_op, up_op.data_context)
182+
and self._can_fuse_map_ops(
183+
up_logical_op, down_logical_op, up_op.data_context
184+
)
183185
)
184186
or (
185187
isinstance(up_logical_op, AbstractMap)
@@ -309,8 +311,7 @@ def _get_fused_map_operator(
309311

310312
# Derive min num rows per input bundle
311313
min_rows_per_bundled_input = self._derive_bundle_min_num_rows(
312-
down_logical_op,
313-
up_logical_op
314+
down_logical_op, up_logical_op
314315
)
315316

316317
target_max_block_size = self._get_merged_target_max_block_size(
@@ -488,10 +489,7 @@ def _can_fuse_map_ops(
488489

489490
# Do not fuse read op with downstream map op in case when downstream has
490491
# `min_rows_per_input_bundle` specified (to avoid reducing reading parallelism)
491-
if (
492-
upstream_op.is_read_op()
493-
and ds_bundle_min_rows_req is not None
494-
):
492+
if upstream_op.is_read_op() and ds_bundle_min_rows_req is not None:
495493
return False
496494

497495
# Avoid fusing operators in cases when doing so would lead to a dramatic parallelism

python/ray/data/_internal/plan.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def generate_logical_plan_string(
259259
chars_left_for_col_name = max(
260260
SCHEMA_LINE_CHAR_LIMIT - len(shortened_suffix),
261261
MIN_FIELD_LENGTH,
262-
)
262+
)
263263
col_str = (
264264
f"{col_str[:chars_left_for_col_name]}{shortened_suffix}"
265265
)

0 commit comments

Comments
 (0)