I really like the UDF examples you gave!
Two small nits:
- I'd be more upfront in saying that code must be a script, since notebooks can't be deployed in cluster mode.
- The Python convention you link are a bit out of date IMHO, and do not reflect our current setup. I documented our tox setup here User:GModena (WMF)/Data Pipeline Onboarding#Python Code Style. Feel free to propose changes / improve both conventions and docs!