- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2026 08:58 PM
- Labels:
-
Spark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2026 09:49 AM
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
I hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2026 02:23 PM - edited 01-16-2026 02:23 PM
@emma_s Thank you for the guidance! The wheel package approach worked perfectly.
I also tried putting the .py directly in but it did not work
/Workspace/Libraries/custom_datasource.py