Skip to content

indexes_equal() fails if the column comments do not match #45

@martinburchell

Description

@martinburchell

As suggested by the code comment in indexes_equal(), the string comparison isn't quite enough. If one column being compared has a comment and the other one doesn't (or the comments are different), the comparison will fail:

def indexes_equal(a: Index, b: Index) -> bool:

This might be quite hard to fix properly. You would need to compare the list of expressions on each index. Or you could argue that the indexes should not be considered equal if they have different comments.

See ucam-department-of-psychiatry/crate#243

The workaround is to ensure that the columns referenced by the indexes have identical comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions