Forum Discussion
Invalid data source credential - Data gateway
Hi vikassingh49111,
According to your description, it seems that when you use python code, the gateway won't work, right? If so, and if possible, could you please inform me your python code? Then I could test this in my environment.
By the way, Install the Personal Gateway - you need a Personal Gateway installed on the machine where the file is located, and where Python is installed. You could refer to Data Gateway Configuration for Python for details.
Best Regards,
Zoe Zhi
I tried to install personal gateway at the same location where my python is installed on my local computer, and I saved my .pbix powerBI file at the same location but still it showing me the same error.
The Python script I am using is -
# 'dataset' holds the input data for this script
import pickle
loaded_model = pickle.load(open(r"Y:\ML Models\XGBVWF.dat", "rb"))
df = dataset
y_pred = loaded_model.predict(df)
df['prediction']= y_pred
and advanced editor query is -
let
Source = SharePoint.Files("XXXXXXXXX", [ApiVersion = 15]),
#"ContractTerminationstoPredict.csv_XXXXXXX/ML Test/" = Source{[Name="ContractTerminationstoPredict.csv",#"Folder Path"="XXXXXXX/ML Test/"]}[Content],
#"Imported CSV" = Csv.Document(#"XXXXXXX/ML Test/",[Delimiter=",", Columns=4, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Run Python script" = Python.Execute("# 'dataset' holds the input data for this script#(lf)#(lf)import pickle#(lf)loaded_model = pickle.load(open(r""Y:\ML Models\XGBVWF.dat"", ""rb""))#(lf)df = dataset#(lf)y_pred = loaded_model.predict(df)#(lf)df['prediction']= y_pred",[dataset=#"Changed Type"]),
df = #"Run Python script"{[Name="df"]}[Value],
The error message is -
Please try again later or contact support. If you contact support, please provide these details.