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

[Python] [Bug] TableDiff.hasDifference is sensitive to order when inputs contain multiple identical rows containing None, even if CompareFlags.order is False #200

Open
MichelleArk opened this issue May 23, 2024 · 0 comments

Comments

@MichelleArk
Copy link

Problem:

TableDiff.hasDifference unexpectedly returns True when comparing two input tables that have multiple identical rows with containing None, even if CompareFlags.orderis set toFalse`.

I've observed this for the python daff package, not sure if it is an issue in other language bindings.

Repro case:

import daff

table1 = daff.PythonTableView(
    [
        ['id', 'status'],
        [None, 'B'],
        [None, 'B'],
        [3, 'A']
    ]
)
table2 = daff.PythonTableView(
    [
        ['id', 'status'],
        [3, 'A'],
        [None, 'B'],
        [None, 'B']
    ]
)

flags = daff.CompareFlags()
flags.ordered = False

alignment = daff.Coopy.compareTables(table1, table2, flags).align()
result = daff.PythonTableView([])

diff = daff.TableDiff(alignment, flags)
diff.hilite(result)

assert not diff.hasDifference() # AssertionError

Workaround in dbt-core: dbt-labs/dbt-core#10202

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

1 participant