Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Special holiday offer! You and a friend can attend FabCon with a BOGO code. Supplies are limited. Register now.
Hi,
I created a custom library and the Def's have docstrings. I noticed that they aren't being displayed from within the Fabric notebooks. Is there something that I need to do to activate them? I didn't notice docstrings for the built-in libraries are available.
Thanks
Solved! Go to Solution.
Hello @kwenzelmms
Ensure docstrings use triple-quoted strings immediately following function/class declarations
def my_function(param):
"""Display this docstring in Fabric Notebooks
Args:
param: Example parameter
"""
...
Package libraries as `.whl` files with proper metadata in `setup.py`
Create dedicated Fabric environment
2. Add custom library through UI:
• Workspace > New > Environment > Add from PyPI/upload WHL
3. Publish environment before notebook use
4. Select environment in notebook toolbar
In notebook :
import importlib
importlib.reload(mylib)
If this is helpful please accept the answer
Hi @kwenzelmms,
As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.
If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.
Hi @kwenzelmms,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like you are facing an issue with your docstrings are not being displayed in Microsoft Fabric Notebooks when you try to access them. Even your built-in Pythion libraries are not displaying docstrings. As @nilendraFabric has responded to your issue, please go through his response. If you are able to solve your issue then please mark the helpful reply as solution
I would also take a moment to thank @nilendraFabric, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Community Support Team
If this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
Hi @kwenzelmms,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.
Hi @kwenzelmms,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hello @kwenzelmms
Ensure docstrings use triple-quoted strings immediately following function/class declarations
def my_function(param):
"""Display this docstring in Fabric Notebooks
Args:
param: Example parameter
"""
...
Package libraries as `.whl` files with proper metadata in `setup.py`
Create dedicated Fabric environment
2. Add custom library through UI:
• Workspace > New > Environment > Add from PyPI/upload WHL
3. Publish environment before notebook use
4. Select environment in notebook toolbar
In notebook :
import importlib
importlib.reload(mylib)
If this is helpful please accept the answer
I have tried the recommendation you mentioned and am still not seeing the docstrings. Though I see them in VsCode, I want to build another local project where the module is referenced as a true library and not part of an existing project. That way I can see whether the docstrings are being stripped from my library.
I'm simply using python -m build to built it. I know that won't strip docstrings away.
Hi @kwenzelmms,
Thanks for going through the responses. Since you can see the docstrings in VS Code but not in Fabric, it’s likely an issue with how Fabric loads the library rather than the packaging process itself.
You can follow few steps to verify if docstrings are present. You can verify optimization flags in Fabric
as it might be running Python in optimized mode, which removes docstrings. Use this code:
"import sys
print(sys.flags.optimize)"
If it returns 1 or 2, Python is running in optimized mode, which removes docstrings. If it returns 0 then docstrings should be available.
You can also run the following code inside your Fabric Notebook to verify if docstrings are present.
"import my_custom_library
print(my_custom_library.some_function.__doc__)"
If this returns "None", it confirms that docstrings are being stripped at runtime in Fabric.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Community Support Team
If this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.