Forum Discussion
Python Script Refresh Error via Service/Personal Gateway - Data source credentials
Hi bsztaje ,
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.
Once you've uploaded the .pbix file to the Power BI service, a couple more steps are necessary to enable data refresh (in the service) and to enable visuals to be updated in the service (the data needs access to Python for visuals to be updated). The additional steps are the following:
- Enable scheduled refresh for the dataset - to enable scheduled refresh for the workbook that contains your dataset with Python scripts, see Configuring scheduled refresh, which also includes information about Personal Gateway.
- Install the Personal Gateway - you need a Personal Gateway installed on the machine where the file is located, and where Python is installed; the Power BI service must access that workbook and re-render any updated visuals. You can get more information on how to install and configure Personal Gateway.
More details: Use Python in Power Query Editor
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I went through all the steps described earlier, but to be sure, I checked the above again and all is like should be - privacy settings to public, personal gateway installed and running on the machine where the file is located, and where Python is installed, but
in addition, I left only one python installation (3.8 native / no venv) on the machine where the personal gateway is installed. (previously I had 3 python instances (2.7, 3.8 and 3.10)
and nothing has changed:
Locally no issue with python and executing script as a data source:
import pandas as pd
from jira import JIRA
jira = JIRA(options={'server': 'xxx'}, basic_auth=('xxx', 'xxx'))
data = []
for singleIssue in jira.search_issues(jql_str='issuetype = Story AND Team = 1340 AND (status ="Ready for Assignment" or (status = Backlog and substatus = ready )) AND "Acceptance Criteria" IS NOT EMPTY AND description IS NOT EMPTY and "epic link" IS NOT EMPTY AND "Story Points" !=0 AND ("Story Flags" !=Planned OR Labels !=planned) ORDER by Rank DESC'):
data.append([singleIssue.key, singleIssue.fields.summary, singleIssue.fields.status, singleIssue.fields.customfield_10023, singleIssue.fields.customfield_10001, singleIssue.fields.customfield_10014])
StoryReady2Assigment = pd.DataFrame(data, columns=['key', 'summary','status', 'story points', 'team', 'EpicLink'])