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

Optional import hypotheses doesn't install hypothesis #1649

Open
rmetcalfe-msp opened this issue May 16, 2024 · 3 comments
Open

Optional import hypotheses doesn't install hypothesis #1649

rmetcalfe-msp opened this issue May 16, 2024 · 3 comments
Labels

Comments

@rmetcalfe-msp
Copy link

Location of the documentation

https://pandera.readthedocs.io/en/stable/data_synthesis_strategies.html#usage-in-unit-tests
https://pandera.readthedocs.io/en/stable/index.html#extras

Documentation problem

When reading about how to create example dataframes from schemas on this page it mentions that you need hypothesis library.
Skipping to the index page/README to understand if that's an optional dependency seems to indicate it is, though there's some confusion over spelling hypothesis vs hypotheses.

This lead me to get ModuleNotFoundError: No module named 'hypothesis' errors until I dug further and discovered that
calling pip install pandera[hypotheses] only actually installs scipy, and you have to install pandera[strategies] to get hypothesis.

Suggested fix for documentation

I would suggest including hypothesis library with the pandera[hypotheses] optional install and fixing the discrepancy in spelling, or specifying in the strategy page that you need to install pandera[strategies] for this functionality.

@cosmicBboy
Copy link
Collaborator

This is an unfortunate naming collision.

When I added Hypothesis checks to the codebase I didn't anticipate ever using the hypothesis library for data synthesis.

pip install pandera[hypotheses] unlocks hypothesis checks.

pip install pandera[strategies] unlocks data synthesis strategies, which uses hypothesis.

To clarify this it would make sense to add the appropriate pip install commands in the corresponding pages:

Would you be able to make a PR for the docs updates?

@cosmicBboy
Copy link
Collaborator

@rmetcalfe-msp any thoughts on the docs solution to clarify this behavior?

@rmetcalfe-msp
Copy link
Author

@cosmicBboy thanks for the explanation, sounds reasonable.
I'll try address in a PR when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants