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

io requires packaging dependency but it is not specified in setup.py #335

Closed
3 tasks done
marwan116 opened this issue Nov 28, 2020 · 4 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@marwan116
Copy link

marwan116 commented Nov 28, 2020

Describe the bug
A clear and concise description of what the bug is.

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of pandas.
  • (optional) I have confirmed this bug exists on the master branch of pandas.

Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Hi there, I am a new user of pandera - I did a pip install pandera[all] in a fresh environment using python 3.8.6.
and then I ran the quick start script

import pandas as pd
import pandera as pa

# data to validate
df = pd.DataFrame({
    "column1": [1, 4, 0, 10, 9],
    "column2": [-1.3, -1.4, -2.9, -10.1, -20.4],
    "column3": ["value_1", "value_2", "value_3", "value_2", "value_1"],
})

# define schema
schema = pa.DataFrameSchema({
    "column1": pa.Column(int, checks=pa.Check.less_than_or_equal_to(10)),
    "column2": pa.Column(float, checks=pa.Check.less_than(-1.2)),
    "column3": pa.Column(str, checks=[
        pa.Check.str_startswith("value_"),
        # define custom checks as functions that take a series as input and
        # outputs a boolean or boolean Series
        pa.Check(lambda s: s.str.split("_", expand=True).shape[1] == 2)
    ]),
})

validated_df = schema(df)
print(validated_df)
  • and I got this error:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/marwansarieddine/.pyenv/versions/pandera_demo/lib/python3.8/site-packages/pandera/__init__.py", line 5, in <module>
    from .decorators import check_input, check_io, check_output, check_types
  File "/Users/marwansarieddine/.pyenv/versions/pandera_demo/lib/python3.8/site-packages/pandera/decorators.py", line 21, in <module>
    from . import errors, schemas
  File "/Users/marwansarieddine/.pyenv/versions/pandera_demo/lib/python3.8/site-packages/pandera/schemas.py", line 12, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'

It seems to me in the setup.py file that packaging (https://pypi.org/project/packaging/) has to be added as a dependency perhaps under the io (given I see packaging imported in test_io - but its also imported in schemas - so I am not sure)

@marwan116 marwan116 added the bug Something isn't working label Nov 28, 2020
@cosmicBboy
Copy link
Collaborator

thanks for pointing this out @marwan116! I just noticed this bug myself, lemme cut a new bugfix version 0.5.1 to resolve this issue

@cosmicBboy
Copy link
Collaborator

@marwan116 just released https://pypi.org/project/pandera/0.5.1/

let me know if this fixes the issue!

@cosmicBboy
Copy link
Collaborator

fixed in version 0.5.1 https://github.com/pandera-dev/pandera/releases/tag/v0.5.1

@marwan116
Copy link
Author

@cosmicBboy I apologize, I never followed up on this - but it looks like it is working now - thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants