From b2da2aebc2df97764aaefc27d086b42023120455 Mon Sep 17 00:00:00 2001 From: Jay Chia Date: Mon, 22 Jan 2024 15:40:45 -0800 Subject: [PATCH] Fix return type on UDF --- .../embeddings/daft_tutorial_embeddings_stackexchange.ipynb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tutorials/embeddings/daft_tutorial_embeddings_stackexchange.ipynb b/tutorials/embeddings/daft_tutorial_embeddings_stackexchange.ipynb index 2ef885234c..29df0776d4 100644 --- a/tutorials/embeddings/daft_tutorial_embeddings_stackexchange.ipynb +++ b/tutorials/embeddings/daft_tutorial_embeddings_stackexchange.ipynb @@ -268,7 +268,10 @@ "metadata": {}, "outputs": [], "source": [ - "@daft.udf(return_dtype=daft.DataType.python())\n", + "@daft.udf(return_dtype=daft.DataType.struct({\n", + " \"related_top_question\": daft.DataType.string(),\n", + " \"similarity\": daft.DataType.float64(),\n", + "}))\n", "def similarity_search(embedding_col, top_embeddings, top_urls):\n", " if len(embedding_col) == 0: return []\n", " \n",