emma_s
Databricks Employee
Databricks Employee

Hi,

Your findings are correct. Because of the way spark works it can distribute UDFs across the worker nodes but it can't do the same with a class in another folder like the utilities folder. It relies on having these as an importable python package, therefore If your utilities directory isn’t part of a packaged (installed) Python module, it isn’t distributed to worker nodes on Databricks cluster and therefore it can't be used.
To get around this you need to update the settings in the pipeline so it sees it as a python module this doc should help you https://docs.databricks.com/aws/en/ldp/import-workspace-files.

In particular, this section 

emma_s_0-1768585750144.png

I hope that helps.

View solution in original post