Upgrade to v0.4 breaks Jupyter Notebooks use cases
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Code that worked inside of a Jupyter Notebook in v0.3 of MSGraphFS no longer works in v0.4. Here is an example of code that runs without error when executed in a notebook cell in v0.3 but not in v0.4. The code runs successfully in v0.4 when executed as a script, so it seems to be the fact that Jupyter provides its own event loop that is tripping it up.
import os
import msgraphfs
from dsd_sharepointfs import get_access_token_interactive
token = get_access_token_interactive() # retrieves access token via public client flow
client_id = os.getenv("DSD_SHAREPOINT_FS_CLIENT_ID")
tenant_id = os.getenv("DSD_AZURE_TENANT_ID")
drive_id = "b!oc7uSdROqk-OOYAKmTu8MmOA9AXS2kZDs59EF92bPvUkJSHmL6ZzQJDueJUxFuGV"
fs = msgraphfs.MSGDriveFS(
client_id=client_id,
drive_id=drive_id,
oauth2_client_params = {
"token":token,
}
)
print(fs.ls("/", detail=False)[:5])
Running inside a notebook cell with v0.4 gives the error
NotImplementedError: Calling sync() from within a running loop.
The same error is obtained when calling fs.open(). The error persists even if I pass in asyncio.get_event_loop() for the loop parameter of the MSGDriveFS constructor.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the v0.4 failure in a Jupyter notebook using the MSGDriveFS example, especially fs.ls() and fs.open(), then compare it with running the same code as a script. Start by tracing the asyncio event-loop handling around the sync() call; done means these operations work inside a notebook without the NotImplementedError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- backend, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100