PandasSchema
PandasSchema copied to clipboard
Implementing __eq__ method to compare Schemas/Columns
I am creating schemas dynamically (from ddl schemas). It would be great if I could build some test and just do
expected_schema == result_schema
Right now I am doing the comparison like
for expected_col, result_col in zip(expected.columns, result.columns):
for ex_val, res_val in zip(expected_col.validations, result_col.validations):
assert type(ex_val) == type(res_val)
which is not accurate because the same types aren't necessarily the same validations especially if we are talking about custom validators.
Seems like a reasonable request. I don't think it will be high priority for me, however.
When I have time, I might look into that. You can assign me if you like to
Happy for you to do that. I can probably easily port an implementation of __eq__
to the future branch once that becomes stable, too.