Forum Discussion

Brendan151's avatar
Brendan151
Frequent Visitor
2 years ago

Read from Semantic Model with Spark SQL

I'm trying to use a notebook to read data from a sematic model in a different workspace to the notebook. Following the guide here:
https://learn.microsoft.com/en-us/fabric/data-science/read-write-power-bi#read-data-using-spark-in-python-r-sql-and-scala
I can read data from the same worksapce, but when I try to extend it to different workspace as outlined in the documentation I get the following error when trying to show the tables:

 

 

Py4JJavaError: An error occurred while calling o297.sql.
: spray.json.DeserializationException: Object is missing required member 'configuredBy'

 

 

I am an admin in the the notebook workspace and the workspace I am trying to access.

 

Thanks in advance for any help.

5 Replies

  • v-cboorla-msft's avatar
    v-cboorla-msft
    Microsoft Employee

    Hi Brendan151 

     

    Thanks for using Microsoft Fabric Community.

    Apologies for the inconvenience.

    As I understand that you are getting an error when trying to read data from a semantic model in a different workspace using a notebook in Microsoft Fabric.

    The following troubleshooting steps might help you:

    • If you are using an older version of the SemPy library that does not support cross-workspace access. Could you please update the SemPy library to the latest version by running this code in a notebook cell:
    %pip install --upgrade semantic-link
    import sempy.fabric as fabric
    • You are not providing the correct workspace name or ID when calling the SemPy methods. You need to make sure that the workspace name or ID matches the one in the Fabric UI. 
    • The error message "spray.json.DeserializationException: Object is missing required member 'configuredBy'" suggests a missing configuration element.

    I hope this information helps. Please do let us know if you have any further questions.

     

    Thanks.

    • Brendan151's avatar
      Brendan151
      Frequent Visitor

      Hi v-cboorla-msft 

       

      Thanks for your reply. 

       

      I am using the latest version of SemPy but the documentation confirms SemPy is not needed for this and I have confirmed the ID matches that shown in the UI.

       

      spark.conf.set("spark.sql.catalog.pbi", "com.microsoft.azure.synapse.ml.powerbi.PowerBICatalog")
      spark.conf.set("spark.sql.catalog.pbi.workspace", "<ID>")
      
      spark.sql("SHOW TABLES FROM pbi").show(1000, truncate=False)

       

      I am not sure where to add a Configured by element?

       

      Thanks.

      • v-cboorla-msft's avatar
        v-cboorla-msft
        Microsoft Employee

        Hi Brendan151 

         

        Inorder to understand the exact issue, it requires a deeper investigation from our engineering team about your workspace and the logic behind it to properly understand what might be happening. 

        Please go ahead and raise a support ticket to reach our support team: support-ticket 

        Please provide the ticket number here as we can keep an eye on it.