How to import a function to another notebook using Repos without %run?

maranBH
New Contributor III

Hi all,

I was reading the Repos documentation: https://docs.databricks.com/repos.html#migrate-from-run-commands

It is explained that, one advantage of Repos is no longer necessary to use %run magic command to make funcions available in one notebook to another. That is to say, we can import them with:

"from notebook_in_repos import fun"

I tested it out on Repos, but it doesn´t work. I get: "No module named notebook_in_repos"

I really want this feature. It is painfull to build an entire module just to do an import. And on the other hand, the %run magic command is not a good replace; it overwrites local variables and mess up namespaces.

How can I make this work?

Thanks.