Skip to content

Commit

Permalink
Fix return type on UDF
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Chia committed May 20, 2024
1 parent cb31198 commit b2da2ae
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b2da2ae

Please sign in to comment.