Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running pytest on Databricks might fail if filesystem is read-only #3171

Closed
astrojuanlu opened this issue Oct 13, 2023 · 1 comment
Closed
Labels
Component: Documentation 📄 Issue/PR for markdown and API documentation

Comments

@astrojuanlu
Copy link
Member

Description

A user reported the other day that they were getting an OSError: [Errno 95] Operation not supported error mentioning the __pycache__ directory after running the tests on Databricks:

image

(source https://linen-slack.kedro.org/t/15886807/team-i-am-trying-to-run-pytest-on-databricks-and-getting-thi#d700145d-a167-4215-8dda-fedb15c5545a)

The Databricks documentation on running unit tests https://docs.databricks.com/en/notebooks/testing.html#run-unit-tests specifies this line:

...
# Skip writing pyc files on a readonly filesystem.
sys.dont_write_bytecode = True

We could maybe add this to our docs, or put it in our starters.

Alternatively, we might decide to not do anything, because this is hardly our fault, and we'd have to keep up with whatever Databricks does.

@astrojuanlu astrojuanlu added the Component: Documentation 📄 Issue/PR for markdown and API documentation label Oct 13, 2023
@stichbury
Copy link
Contributor

stichbury commented Oct 19, 2023

It's unfortunate that the error is not documented in the Slack message except as an image since it would itself be sufficient to index it so anyone searching google to find an answer would hit the linen archive and get a solution.

Let's do it here so it's clear (and @astrojuanlu has already done this above) and this will count as our documentation of this very specific issue.

Issue summary

You may get an OSError: [Errno 95] Operation not supported error mentioning the __pycache__ directory after running the pytest tests on Databricks:

Resolution

The Databricks documentation on running unit tests https://docs.databricks.com/en/notebooks/testing.html#run-unit-tests specifies this line:

# Skip writing pyc files on a readonly filesystem.
sys.dont_write_bytecode = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation 📄 Issue/PR for markdown and API documentation
Projects
Archived in project
Development

No branches or pull requests

2 participants