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

Use __eq__ to allow InputColumns to be compared without having to call quote() or unquote() #2533

Open
RobinL opened this issue Nov 28, 2024 · 1 comment

Comments

@RobinL
Copy link
Member

RobinL commented Nov 28, 2024

In the codebase we often have to be careful when looking at the equality of two columns to ensure we're not comparing quoted to unquoted

I wondered whether it may be possible/sensible to define a eq on the class that defines equality of the column name irrespective of whether it's quoted or unquoted.

Need to check how this would work out for the in operator e.g. if this_input_col in input_cols_list then do something i think for that you might need to define __hash__

@ADBond
Copy link
Contributor

ADBond commented Dec 2, 2024

I think in for lists use __eq__ under the hood, so should work okay with just that. Would need __hash__ for sets/dicts, but presumably we don't have any such cases currently as it's not already hashable.

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

2 participants