Forum Discussion

apods1979's avatar
apods1979
Helper I
6 years ago
Solved

Failed to save modifications to the server. function Python.Execute

Complete error: Failed to save modifications to the server. Error returned: 'Expression in partition 'n/a' in table 'n/a' references unknown variable or function 'Python.Execute'.

 

I have this error after used this script to load data:
OBS: This script working in COLAB and Python at my machine, but not in Power Query 😥

 

Script:

# 'dataset' holds the input data for this script
import numpy as np
import pandas as pd
from pandas_datareader import data as wb
TickerA='ITSA4.SA'
TickerB='FLRY3.SA'
TickerC='LREN3.SA' 
dataset=pd.DataFrame()
tickers = [TickerA, TickerB, TickerC]
for t in tickers:
dataset[t]=wb.DataReader(t, data_source='yahoo', start='2019-1-1')['Adj Close']
dataset= dataset.reset_index()
dataset= dataset.set_index([dataset.index])
dataset= dataset.fillna(0) 

  • Hi apods1979 ,

     

    Sorry for our poor python knowledge, Is "dataset[t]=XXX" a nested tables? Based on this document, Nested tables are currently not supported. 


    Best regards,

     

  • I had a similar problem. Just go to Option > Preview features and uncheck Store dataset using enhanced metadata format.
    That should do the trick.

8 Replies

  • athulbabuakb's avatar
    athulbabuakb
    Frequent Visitor

    I had a similar problem. Just go to Option > Preview features and uncheck Store dataset using enhanced metadata format.
    That should do the trick.

    • vmerida's avatar
      vmerida
      Frequent Visitor

      Thank you, that work for me too...

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi apods1979 ,

     

    Sorry for our poor python knowledge, Is "dataset[t]=XXX" a nested tables? Based on this document, Nested tables are currently not supported. 


    Best regards,

     

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi apods1979 ,

     

    Does this issue have been resolved? How about the result after you follow the suggestions mentioned by athulbabuakb? Could you please provide more details about it If it still not be resolved? Please don't contain any Confidential Information or Real data in your reply.


    Best regards,

  • Paulien_'s avatar
    Paulien_
    Frequent Visitor

    I run into the same problem. Even when the python script is only: df = dataset, it still returns the error " Failed to save modifications to the server. Error returned: 'Expression in partition 'n/a' in table 'n/a' references unknown variable or function 'Python.Execute'. '." when I try to apply the query. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey guys, really struggling with this error, any other ideas on how to fix it? I've already tried "Store datasets using enhanced metadata format".

     

    • v-lid-msft's avatar
      v-lid-msft
      Community Support

      Hi Anonymous , Paulien_ ,

       

      Could you please try the following steps to see if this error can be reproduced:

      1. Backup the origin pbix file
      2. Install the latest version of Power BI Desktop, (if you are using MS Store version, upgrade in MS Store)
      3. Turn off the Preview Feature "Store datasets using enhanced metadata format" in options.
      4. Restart Power BI Desktop and create a new blank pbix file
      5. Try to copy the queries from origin pbix file to the new file when save the query (instead of using the old pbix file), or just write new query in the blank pbix file.
      6. Then verify if this error occur in the new pbix file

       

      If it is an urgent issue, We suggest you to open a ticket here for help if you are a pro user: https://powerbi.microsoft.com/en-us/support/


      Best regards,