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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ellgraa
Frequent Visitor

Apply Changes to query in Query Editor keeps disconnecting

Hello! I am a newbie to PowerBi and have been stuck on this issue for the past day. 

I have successfully uploaded 61 queries pulling data from a rest api into Power BI using individual python scripts. However, when I apply changes in power query editor, I always receive a disconnection error messages for one particular dataset despite my code working perfectly fine elsewhere (e.g. Pycharm). I have uploaded a picture of the error code below. 

This is the error code in text:
ADO.NET: Python script error. Connection Error, retrying in 0 seconds http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

I have updated my power BI desktop app. I have implemented rate limiting. I have refreshed each query individually before attempting to apply changes. My Python script works fine elsewhere. My API key is working as all my other python scripts are successful. My visualisation of this particular dataset is completely fine, however because I now want to load further queries, I need to fix this issue to do this. I understand that is one of my bigger datasets

Many Thanks 🙂

loading error photo.jpg


UPDATE:
I have also received a newer error message when refreshing this specific query:

ADO.NET: Python script error.
<pi>Connection Error, retrying in 0 seconds
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
</pi>
Details:
DataSourceKind=Python
DataSourcePath=Python
Message=Python script error.
<pi>Connection Error, retrying in 0 seconds
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
</pi>
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException




1 ACCEPTED SOLUTION
ellgraa
Frequent Visitor

SOLVED!! I needed to add in a timeout interval in my code which bypassed PBI´s timeout limit. 

View solution in original post

1 REPLY 1
ellgraa
Frequent Visitor

SOLVED!! I needed to add in a timeout interval in my code which bypassed PBI´s timeout limit. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.