Forum Discussion
Intellisense for custom Python packages not working in Fabric notebooks
- 1 year ago
Hi HoneHealthMB,
We apologize for the inconvenience caused. Please consider raising a Microsoft support ticket for further investigation. You can explain all the troubleshooting steps you have taken to help them better understand the issue.
You can create a Microsoft support ticket with the help of the link below:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticketIf this helps, please "Accept as solution" and drop a "Kudos" so other members can find it more easily.
Thank you.
Hi HoneHealthMB,
Thank you for reaching out to the Microsoft fabric community forum.
After thoroughly reviewing the details you provided, it seems the core issue is that Pylance (the IntelliSense engine in Fabric notebooks) isn’t rendering the detailed docstrings for your custom package when installed as a wheel, either via a custom Spark environment or notebook resources. The fact that IntelliSense works when the code is directly in the notebook, and that bs4 displays rich IntelliSense, suggests this may be related to how Pylance processes packaged libraries in Fabric’s Spark environment.
Here are a few suggestions to try:
- Ensure your package includes type hints and possibly type stub files. Pylance relies heavily on these for rich IntelliSense. The success of bs4 likely stems from its well-structured metadata, which you could try to emulate in your package structure.
- As a workaround, you could upload your package’s source files to the notebook’s resources folder and add the folder to the Python path. This mimic placing code directly in the notebook and may allow Pylance to display docstrings, though I understand this isn’t ideal for your use case.
- When installing your wheel package (via %pip install or a custom environment), verify that it’s correctly installed in the session’s library path. Restarting the Spark session after installation might help ensure the package is properly loaded.
- Since bs4 works well, analyzing its package structure could provide insights. This might involve looking at its installed files to identify what makes its IntelliSense rendering effective.
For additional guidance on managing Python packages in Fabric notebooks, you may find this official documentation helpful: Using Python Experience on Notebook. It covers package installation and environment setup, which might provide further context.
The fact that even Microsoft’s azure-ai-projects package doesn’t render rich IntelliSense suggests this could be a limitation in Fabric’s Pylance integration, possibly due to its preview status.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Thank you for the reply.
I am adding my wheel package to a custom Spark environment in Fabric to avoid our engineers from having to install it on every notebook, etc. If I do this in my notebook:
print(myclass.__doc__)
I see the documentation content just fine.