I'm trying to read a .ipynb file into the repos of Azure Databricks, but encountering the following error:
Interestingly, other file types like xlsx seem to work just fine:
I've already tried several approaches to resolve it, including:
Despite these efforts, I am still unable to achieve the desired outcome, which is to execute the following action as depicted in the image below:
Desired Action
My suspicion is that Azure Databricks might be denying the read operation for security reasons.
Has anyone encountered a similar issue or have any ideas on how to resolve this?
Notebooks aren't exposed to the Workspace File System (WSFS). It's kind of design decision. If you need to obtain notebook's source code, then you can use Databricks Python SDK (recomemnded) or Export Workspace object REST API (cumbersome).
import base64
import databricks.sdk
from databricks.sdk.service.workspace import ImportFormat
w = databricks.sdk.WorkspaceClient()
notebook = w.workspace.export("/Repos/..../notebook",
format=ImportFormat.JUPYTER)
ipynb = base64.decodebytes(notebook.content.encode('ascii')).decode("utf-8")