How to pass python Class Object from parent synapse notebook to child notebook

heta desai 247 Reputation points
2022-10-28T14:12:20.203+00:00

I have created class object in parent synapse notebook. I want to pass that class object to child notebook which is called using mssparkutils.notebook.run("Notebook") command. The class is defined inside wheel package. I want to avoid importing the wheel package and recreating the object in child class as same thing I am doing in parent notebook.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,696 questions
0 comments No comments
{count} votes

Accepted answer
  1. HimanshuSinha-msft 19,386 Reputation points Microsoft Employee
    2022-10-31T19:35:53.14+00:00

    Hello @Anonymous ,
    Thanks for the question and using MS Q&A platform.

    Basically you are trying to pass the object from notebook A to notebook B . I dont think thats possible . But you can try to use to the
    mssparkutils.fs.put method to write this to a file from notebook A and read the same from notebook B .

    https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/microsoft-spark-utilities?pivots=programming-language-python#file-system-utilities

    Please do let me if you have any queries.
    Thanks
    Himanshu


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
      • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

0 additional answers

Sort by: Most helpful