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

column mismatch wrong exception raised #53

Open
Calosha opened this issue Jan 28, 2021 · 3 comments
Open

column mismatch wrong exception raised #53

Calosha opened this issue Jan 28, 2021 · 3 comments

Comments

@Calosha
Copy link

Calosha commented Jan 28, 2021

lines 59 to 64 in schema.py. code checks if file columns are subset of self.get_column_names() but in Exception printing difference between columns and self.columns so it is always shows that all Columns are different

if set(columns).issubset(self.get_column_names()):
                columns_to_pair = [column for column in self.columns if column.name in columns]
            else:
                raise PanSchArgumentError(
                    'Columns {} passed in are not part of the schema'.format(set(columns).difference(self.columns))
                )
@enricorotundo
Copy link

enricorotundo commented Mar 19, 2021

Probably related to the issue above. In my case schema.validate(test_data) always returns Invalid number of columns. The schema specifies 21, but the data frame has 22 even thought test_data actually has 21 columns.

@multimeric
Copy link
Owner

Hi, thanks for the report. In the interests of time could either of you provide a reproducible example please? Preferably pure Python code.

@Calosha
Copy link
Author

Calosha commented Mar 24, 2021

Probably related to the issue above. In my case schema.validate(test_data) always returns Invalid number of columns. The schema specifies 21, but the data frame has 22 even thought test_data actually has 21 columns.

yes that exactly what is the issue. I will write a sample code and will post it later today

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

No branches or pull requests

3 participants