GuyBourne
Databricks Employee
Databricks Employee
This error pattern, 'Function' object attribute '__doc__' is read-only, is a known upstream issue in fastcore related to how it monkey-patches Python built-in function objects. The fastcore library attempts to set __doc__ on built-in Function (C-level) objects, which CPython does not allow. This can surface when:
  1. A minor CPython patch is included in the new runtime (e.g., 3.12.x → 3.12.y), tightening attribute-setting behaviour on built-in types.
  2. A different library version in the runtime environment changes the import order or triggers a different code path in fastcore's initialisation.
Since you confirmed the only visible change is the runtime release (18.3.5 → 18.3.6), a CPython micro-version bump or a change in a transitive dependency is the most probable trigger.

Recommended next steps

  1. Check the Python micro-version: Run import sys; print(sys.version) on both 18.3.5 and 18.3.6 clusters to confirm whether the CPython patch level changed.
  2. Pin to a working runtime: If you need an immediate fix, pin your cluster to 18.3.5 while investigating.
  3. Check fastcore's GitHub issues: The fastcore issue tracker has had similar __doc__ read-only reports tied to specific Python versions.
  4. File a support ticket: Since this appears to be a regression introduced by the 18.3.6 maintenance release, filing a Databricks support ticket referencing the runtime change would help the Runtime team investigate whether a CPython or dependency change is responsible.