Is there a way to add docstring to user defined functions in databricks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 07:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 12:55 AM
@Hitesh Agarwal Hi. AFAIK, I don't see any examples with docstring in udf. We just add the comments using typical comment way. Is there anything in particular, you want to achieve using docstring?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 01:07 AM
@Vigneshraja Palaniraj Hi, normal VS Code we can add docstring to python code but I was unable to do the same in databricks. After the latest updates in databricks we get auto-completion feature, also, when you hover over a system defined function there's a dialog box which gives you function definition, basic info and function return type. I wanted to achieve the same with user defined functios using docstring
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 02:37 AM
Hi @Hitesh Agarwal Yes I get that. I don't see anything like that available yet. Let us see if any new feature is available for the same in upcoming releases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 10:01 PM
Hi, I am not sure if this helps: https://www.databricks.com/blog/2020/12/15/python-autocomplete-improvements-for-databricks-notebooks...
Also, please tag @Debayan with your next response which will notify me. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 10:35 PM
@Debayan Mukherjee I have gone through this article and this doesn't helps as it mentions how to see docstrings for a system defined function but not how to add docstrings to user defined functions.

