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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Python script - error scheduled refresh

Hi, 
 
I am currently facing a problem with a scheduled refresh in PowerBI web.
 
Some context:
 
  • I have written a python script to extract directly some from a MySQL server and do some cleaning & transformation (within PowerBI desktop)
  • Then I have built some tables / visulations (non really relevant for this post I guess) 
  • Finally I have published the report on as usual in my workspace (I am using the personal gateway in an AWS virtual machine). 
So far, everything is going all right. 
 
My problem:
 
  • When I try to refresh the table on PowerBI Web, I got this error message: 
Last refresh failed: Tue Jan 08 2019 20:57:51 GMT+0000 (Greenwich Mean Time) 
Scheduled refresh has been disabled.Hide details 
 
Data source error:
Scheduled refresh is disabled because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources. Then reactivate scheduled refresh.
Cluster URI:
Activity ID:
9a466e5d-c4b9-4ced-9e05-36cc0a0e9d54
Request ID:
c18c7178-5573-44ac-9533-a419111b0290
Time:
2019-01-08 20:57:51Z
 
  • Then I try to edit the Python crendtials (i.e. WindowsWithouImpersonation > Sign in) and I get the below error message:
Failed to update data source credentials: An error happened while reading data from the provider: 'Could not load file or assembly 'Microsoft.PowerBI.Scripting, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)'Hide details
Activity ID:
8fb9708a-da0c-406c-a903-22616fb91a8c
Request ID:
d6935e86-3dd1-8256-0fc9-8847e150235e
Status code:
400
Time:
Tue Jan 08 2019 21:17:14 GMT+0000 (Greenwich Mean Time)
Version:
13.0.7840.225
Cluster URI:
 
Has someone faced the same situation and managed to solve it?
 
Many thanks!!!
 
JB
3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Actually, there are two parts of Python on Power BI. One is the Python visual while the other is Python script as a data source. The responses from the Product Team say the call from Python visual isn't supported, which means the Python visual only can use the local dataset. Form your description, if your data is not in the query editor(You could open the query editor to check it), you could not use the Python visual in Power BI Service.

The workaround could be loading all the data in your data model and then interact with Python visual. 

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hey Daniel, 

 

Many thanks for your answer. 

 

To give some more details:

 

In this case, I am not using a python visual. I am only using a python as data source ("get data") and in my script I am using different python libraries to extract and process the data (i.e. SQLalchemy, pandas, RE,...).

 

When I run the above in PowerBI desktop, everything is working perfectly. I am having trouble to schedule an automated daily refresh on PowerBI web. 

 

Would you perhaps know to what kind of problem this might relate? 

 

Thanks again for your precious help!

 

Cheers. 

Hi @Anonymous,

Have you used the Python to get data for your Power BI report? For example, if you use below code to create a random data:

import random
for x in range(10):
  print random.randint(1,101)

The data generated from python could not be used in Power BI Service due to the Power BI Service could not support it.

And if you use below code to fetch data from your local data or other database:

dataset = pandas.read_csv("C:\\path\\to\\my\\data.csv")

This way is also could not be supported in Power BI Service, but it could be used in desktop.

Hope it could help you.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors