image.png


When working in Databricks, it’s common to develop additional Python classes as reusable helpers—for example, to read data from APIs or to apply repeatable PySpark transformations.

The most common approach is to create separate .ipynb notebook files and import them into your main notebook using the %run magic command:

%run ./PythonClass

What’s Wrong with %run ./Notebook?

There are several major drawbacks to relying on %run for code reuse:


Better Solution: Deploy Wheel with CI/CD

A Python wheel (.whl) is a portable, versioned package.

With GitHub Actions, you can automate the build and upload process every time you push to main.


Recommended Project Structure (src layout)