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

Implementing __eq__ method to compare Schemas/Columns #42

Open
CloseChoice opened this issue Oct 23, 2020 · 3 comments
Open

Implementing __eq__ method to compare Schemas/Columns #42

CloseChoice opened this issue Oct 23, 2020 · 3 comments

Comments

@CloseChoice
Copy link

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.

@multimeric
Copy link
Owner

Seems like a reasonable request. I don't think it will be high priority for me, however.

@CloseChoice
Copy link
Author

When I have time, I might look into that. You can assign me if you like to

@multimeric
Copy link
Owner

Happy for you to do that. I can probably easily port an implementation of __eq__ to the future branch once that becomes stable, too.

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

No branches or pull requests

2 participants