Skip to content

Commit 5e40837

Browse files
colin-hoColin Ho
andauthored
feat: Default native runner (Eventual-Inc#3608)
Set swordfish as default Note: - Disables printing of physical plan explains for now --------- Co-authored-by: Colin Ho <[email protected]>
1 parent e706caa commit 5e40837

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

daft/context.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import warnings
88
from typing import TYPE_CHECKING, ClassVar, Literal
99

10-
from daft import get_build_type
1110
from daft.daft import IOConfig, PyDaftExecutionConfig, PyDaftPlanningConfig
1211

1312
if TYPE_CHECKING:
@@ -109,14 +108,8 @@ def _get_runner_config_from_env() -> _RunnerConfig:
109108
max_task_backlog=task_backlog,
110109
force_client_mode=ray_force_client_mode,
111110
)
112-
113-
# Use native runner if in dev mode
114-
elif get_build_type() == "dev":
115-
return _NativeRunnerConfig()
116-
117-
# Fall back on PyRunner
118111
else:
119-
return _PyRunnerConfig(use_thread_pool=use_thread_pool)
112+
return _NativeRunnerConfig()
120113

121114

122115
@dataclasses.dataclass

daft/dataframe/dataframe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ def explain(
208208
print_to_file("\n== Optimized Logical Plan ==\n")
209209
builder = builder.optimize()
210210
print_to_file(builder.pretty_print(simple))
211-
print_to_file("\n== Physical Plan ==\n")
212-
physical_plan_scheduler = builder.to_physical_plan_scheduler(get_context().daft_execution_config)
213-
print_to_file(physical_plan_scheduler.pretty_print(simple, format=format))
211+
if get_context().get_or_create_runner().name != "native":
212+
print_to_file("\n== Physical Plan ==\n")
213+
physical_plan_scheduler = builder.to_physical_plan_scheduler(get_context().daft_execution_config)
214+
print_to_file(physical_plan_scheduler.pretty_print(simple, format=format))
214215
else:
215216
print_to_file(
216217
"\n \nSet `show_all=True` to also see the Optimized and Physical plans. This will run the query optimizer.",

daft/runners/pyrunner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ def run_iter(
340340
results_buffer_size: int | None = None,
341341
) -> Iterator[LocalMaterializedResult]:
342342
warnings.warn(
343-
"PyRunner will be deprecated in v0.4.0 and the new NativeRunner will become the default for local execution."
344-
"We recommend switching to the NativeRunner now via `daft.context.set_runner_native()` or by setting the env variable `DAFT_RUNNER=native`. "
343+
"PyRunner is deprecated and the new NativeRunner is now the default for local execution."
344+
"Please switch to the NativeRunner now via `daft.context.set_runner_native()` or by setting the env variable `DAFT_RUNNER=native`. "
345345
"Please report any issues at github.com/Eventual-Inc/Daft/issues",
346346
)
347347
# NOTE: Freeze and use this same execution config for the entire execution

src/daft-local-plan/src/translate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub fn translate(plan: &LogicalPlanRef) -> DaftResult<LocalPhysicalPlanRef> {
197197
))
198198
}
199199
LogicalPlan::Repartition(repartition) => {
200-
log::warn!("Repartition Not supported for Local Executor!; This will be a No-Op");
200+
log::warn!("Repartition not supported on the NativeRunner. This will be a no-op. Please use the RayRunner instead if you need to repartition");
201201
translate(&repartition.input)
202202
}
203203
LogicalPlan::MonotonicallyIncreasingId(monotonically_increasing_id) => {

0 commit comments

Comments
 (0)