Is DAFT Async UDFs a work in progress or is it alr...
# daft-dev
n
Is DAFT Async UDFs a work in progress or is it already released? Couldn’t find any examples in the documentation so curious to know how to implement them.
c
Async UDF's are available today. They are still pretty new so we don't have them fully documented yet, but we do have one example here https://docs.daft.ai/en/stable/quickstart/#transform-columns-with-custom-logic
TL;DR
Copy code
@daft.func
async def my_function(input) -> str:
  await do_something()
  return "done"

df.select(my_function(df["col"]))
❤️ 1
n
Thanks! A follow-up on these lines… how do I decide when to use daft.udf and when to use daft.func?
c
daft.func is newer and easier to use api, daft.udf will eventually be deprecated. If you don't have any need for a stateful udf, or custom vectorization/batching, then daft.func is the way to go.
n
Got it thanks!