From 46aec540b27b0b623355392e44e639c43ca754b4 Mon Sep 17 00:00:00 2001 From: Arik Mitschang Date: Mon, 26 Aug 2024 15:27:22 -0400 Subject: [PATCH] Fix typos in UDF documentation There were a few inconsistencies in the UDF documentation w.r.t resource requests. --- daft/udf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daft/udf.py b/daft/udf.py index 56950294d6..bfc0a4e570 100644 --- a/daft/udf.py +++ b/daft/udf.py @@ -492,8 +492,8 @@ def udf( Resource Requests ----------------- - You can also hint Daft about the resources that your UDF will require to run. For example, the following UDF requires 4 CPUs to run. On a - machine/cluster with 8 CPUs, Daft will be able to run up to 2 instances of this UDF at once, giving you a concurrency of 2! + You can also hint Daft about the resources that your UDF will require to run. For example, the following UDF requires 2 CPUs to run. On a + machine/cluster with 8 CPUs, Daft will be able to run up to 4 instances of this UDF at once, giving you a concurrency of 4! >>> import daft >>> @daft.udf(return_dtype=daft.DataType.int64(), num_cpus=2) @@ -525,7 +525,7 @@ def udf( ... return x >>> >>> # Override the num_cpus to 2 instead - >>> udf_needs_8_cpus = udf_needs_4_cpus.override_options(num_cpus=2) + >>> udf_needs_2_cpus = udf_needs_4_cpus.override_options(num_cpus=2) >>> >>> df = daft.from_pydict({"x": [1, 2, 3]}) >>> df = df.with_column("new_x", udf_needs_2_cpus(df["x"]))