You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Not quite sure if this is a bug or a mistake in my set-up.
I have specified ordered: True in my yaml file and wants to validate the ordering of columns against the pandas dataframe which I will pass this into the schema.validate() function. However, it keeps raising error due to COLUMN_NOT_ORDERED and this is because the first column in my dataframe is not matching what the first column in the schema is.
Diving deeper, when i parse the yaml file using yaml.safe_loads(<>) and later check the schema using DataFrameSchema, the column ordering in this schema object becomes an alphabetically one and not the order which i have defined in the yaml file as shown below:
With this set-up, i wanted to check if my dataframe's columns are in the order of this. However, when i run pa.DataFrameSchema().from_yaml(schema_content), it outputs the column in an alphabetically order which then determines that my dataframe's column ordering is wrong.
Describe the bug
Not quite sure if this is a bug or a mistake in my set-up.
I have specified
ordered: True
in my yaml file and wants to validate the ordering of columns against the pandas dataframe which I will pass this into the schema.validate() function. However, it keeps raising error due toCOLUMN_NOT_ORDERED
and this is because the first column in my dataframe is not matching what the first column in the schema is.Diving deeper, when i parse the yaml file using
yaml.safe_loads(<>)
and later check the schema usingDataFrameSchema
, the column ordering in this schema object becomes an alphabetically one and not the order which i have defined in the yaml file as shown below:With this set-up, i wanted to check if my dataframe's columns are in the order of this. However, when i run
pa.DataFrameSchema().from_yaml(schema_content)
, it outputs the column in an alphabetically order which then determines that my dataframe's column ordering is wrong.This is what the Pandera columns look like:
Code Sample, a copy-pastable example
Expected behavior
I should be able to specify the order of columns i want in the list of yaml and pandera shouldn't be ordering the columns alphabetically?
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
when i print(schema) this gives me the first column as "Access group" and not GId
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: