Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PowerBI4Life
Frequent Visitor

Python in Power Query Editor

Are there any risks to using Python in the Power Query Editor?  It sounds like the data source settings must be set to "public".  Who would be able to see this information? 

1 ACCEPTED SOLUTION
ams1
Responsive Resident
Responsive Resident

Hi @PowerBI4Life ,

 

Everything has risks 🙂, IMO the biggest one being the user doing something wrong in the code that exposes the data.

 

"python.exe" installed on your machine will be able to "see" your data.

 

The thing is python.exe is an external program installed on your machine and PowerBI gives python your data - so if your machine is compromised... things might happen (btw if your machine gets compromised not even PowerBI is safe anymore).

Python also has libs (pandas etc.) - if those libs get compromised...

 

IF you're careful and install python/python libs from trusted locations (btw same goes for PowerBI itself and everything), you should be OK -> (imo) this "worrying" should NOT stop you for using python, go for it! 

 

Worry more about the code you use in PowerQuery, Python etc.

View solution in original post

2 REPLIES 2
knuckledown234
Frequent Visitor

I'm seconding the above question. 
Microsoft's documentation states that Python can only be used with data sources with security settings set to "Public": "For the Python scripts to work properly in the Power BI service, all data sources need to be set to public. For more information about privacy settings and their implications, see Privacy Levels." ( Use Python in Power BI Power Query Editor - Power BI | Microsoft Learn )

 

Reviewing the documentation below, it sounds like the Private/Public/Organizational security levels are more about how data sources can interact with each other than actual security provided. "Public" doesn't actually mean that anyone can see the data, but it does mean that other data sources interacting with the data source in Power BI can see the data. Am I understanding that correctly? 

 

Understand Power BI Desktop privacy levels - Power BI | Microsoft Learn

ams1
Responsive Resident
Responsive Resident

Hi @PowerBI4Life ,

 

Everything has risks 🙂, IMO the biggest one being the user doing something wrong in the code that exposes the data.

 

"python.exe" installed on your machine will be able to "see" your data.

 

The thing is python.exe is an external program installed on your machine and PowerBI gives python your data - so if your machine is compromised... things might happen (btw if your machine gets compromised not even PowerBI is safe anymore).

Python also has libs (pandas etc.) - if those libs get compromised...

 

IF you're careful and install python/python libs from trusted locations (btw same goes for PowerBI itself and everything), you should be OK -> (imo) this "worrying" should NOT stop you for using python, go for it! 

 

Worry more about the code you use in PowerQuery, Python etc.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.