Skip to main content

Power BI

New

Python editor overhaul - Power BI

Vote (1) Share
Henry Post's profile image

Henry Post on 03 Dec 2024 19:23:13

Python editor overhaul – Power BI


Power BI has big quality issues with the Python editor. I'm used to PyCharm/IDLE/the Python REPL, and found it very hard to diagnose Python scripts, interpret errors, or even make small changes to them in Power BI.

 

1. When you go to "Get Data - More - Python Script", you are only allowed to paste a Python script in. You can't use a file on disk. Power BI forces you to embed a static script in Power BI. This is annoying because it'd be nice to maintain a file-based repo of Python scripts, instead of embedding them in the .pbix file.

 

2. If I want to edit the imported Python script, you get a terribly hard to read block of text:

 

https://gist.github.com/meltingscales/e04821c2f75b72de2ae98d788d5b91d3

 

 

3. Error logs have no history: If I have a Python error, I can't easily diagnose it from within PowerBI or debug it. I have to open a separate text editor, hope that I saved my original Python script, run it in my own REPL, and also copy the error to an external text editor.

 

4. No stdout: If my script prints to stdout, I can't view it.

 

I could go on, but I think the main point stands: Debugging or editing Power BI Python scripts is really painful. Even an IDLE-like interface would be amazingly useful.

 

Alternatively, a community guide on "How do I develop complex Python scripts within Power BI and test them" would be useful. Perhaps Microsoft could make a Github repository that has a flow set up.


v-yaningy-msft was incredibly helpful and suggested this link: Use an external Python IDE with Power BI - Power BI | Microsoft Learn


I think that a more rich integration, perhaps with Visual Studio Code or some sort of language server, as an extension, would make Power BI Python editing far less painful.



Comments (1)
Henry Post's profile image Profile Picture

Henry Post on 03 Dec 2024 19:24:01

RE: Python editor overhaul - Power BI

Related community question: https://community.fabric.microsoft.com/t5/Desktop/Python-editor-overhaul-PowerBI/m-p/4310717#M1351107