cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

fastai import in databricks broken

barnabywalker
New Contributor

Has anyone else had a problem today (2026-09-04) with imports from fastai?

The error message points to a problem with the underlying fastcore package:

AttributeError: 'Function' object attribute '__doc__' is read-only

I'm getting the same error using fastai versions 2.8.5 and 2.8.8.

The only change I can see is in the compute event logs, my 'Compute is using release 18.3.6' compared to 18.3.5 yesterday.

5 REPLIES 5

GuyBourne
New Contributor III
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.

barnabywalker
New Contributor

Thank you for the reply Guy, I'm not actually sure whether the change is down to runtime version now - I've tried importing from fastai using various runtimes (18.2.9, 17.3.20, 19.6.3), using a node with or without GPU, and using an ML and a non-ML runtime.

I guess filing a support ticket is my best bet...

Also, I couldn't find any other issues with the same problem with setting __doc__ on read-only built-in types in the fastcore issue tracker. If you found any, would you mind linking to them?

GuyBourne
New Contributor III

This is what I was referring to: 

https://github.com/AnswerDotAI/fastcore/issues/927

was your version pinned?

 

Thanks for pointing to that issue, but I'm really not sure it's related to this error?

I pinned the fastai version to 2.8.5, which was the version that worked yesterday, and tried different runtimes. It didn't work for any of them, so not sure what the problem is here.