Forum Discussion
Anonymous
4 years agoNot applicable
Python requests working in Power Query not when loaded in Data Model
My Python script is not successfully loading into the Data Model. The script works; it runs in an IDE (I use Pycharm), and also runs and returns data in the Power Query Editor. I am using it to get d...
YukiK
4 years agoImpactful Individual
I'm not 100% sure on this, but I always had to add print(df) at the end of the script. Never seen your error, but maybe it's worth a try
Anonymous
4 years agoNot applicable
Hey YukiK, thanks I did try but unfortunately same outcome 😞 for extra clarity, this is the screenshot from inside the Editor:
but I receive the error I posted originally if I hit "Close & Apply".
On a side note, I think that Power BI pulls in all active variables that have type DataFrame - if you delete the variable using del command (e.g. del df) then Power BI won't import it back. Not sure where print actually prints to, happy to learn 🙂 Thanks anyway!