The file path of the above error is suggesting it is from the Pillow library dependency:
"/databricks/python/lib/python3.8/site-packages/PIL/_typing.py"
Pillow's _typing.py checks for NumPy >=1.21 while 10.4 runtime has these versions installed by default:
NumPy version: 1.20.1
Pillow version: 8.2.0
You can try to pin a compatible version of the package in your code numpy==1.21.0