diff --git a/modin/core/dataframe/pandas/partitioning/partition_manager.py b/modin/core/dataframe/pandas/partitioning/partition_manager.py index 07a4d2de027..cb207f64d4e 100644 --- a/modin/core/dataframe/pandas/partitioning/partition_manager.py +++ b/modin/core/dataframe/pandas/partitioning/partition_manager.py @@ -681,10 +681,7 @@ def broadcast_apply( np.ndarray NumPy array of result partition objects. """ - # The `broadcast_apply` runtime condition differs from - # the same condition in `map_partitions` because the columnar - # approach for `broadcast_apply` results in a slowdown. - if np.prod(left.shape) <= 1.5 * CpuCount.get(): + if not DynamicPartitioning.get(): # block-wise broadcast new_partitions = cls.base_broadcast_apply( axis, @@ -693,6 +690,8 @@ def broadcast_apply( right, ) else: + # The dynamic partitioning behavior of `broadcast_apply` differs from that of `map_partitions`, + # since the columnar approach for `broadcast_apply` results in slowdown. # axis-wise broadcast new_partitions = cls.broadcast_axis_partitions( axis=axis ^ 1, diff --git a/modin/core/storage_formats/pandas/query_compiler.py b/modin/core/storage_formats/pandas/query_compiler.py index f6c3892fc09..410bd2b50d8 100644 --- a/modin/core/storage_formats/pandas/query_compiler.py +++ b/modin/core/storage_formats/pandas/query_compiler.py @@ -45,8 +45,7 @@ from pandas.core.indexing import check_bool_indexer from pandas.errors import DataError -from modin.config import RangePartitioning -from modin.config.envvars import CpuCount +from modin.config import CpuCount, RangePartitioning from modin.core.dataframe.algebra import ( Binary, Fold,