Skip to content

Python tables with different row counts compare equal #8195

Description

@carloea2

Feature Summary

Python Table equality compares row iterators with zip but does not compare their lengths. Zip stops at the shorter input, so tables with the same prefix compare equal even when one contains additional workflow rows. An empty table also compares equal to any non-empty table.

Before: one row equals two matching-prefix rows in both directions, and zero rows equals two rows.

After: row counts must match before row values are compared. Equal tables still compare equal.

Reproduction evidence:

  1. Construct one Table containing id 1.
  2. Construct another Table containing id 1 and id 2.
  3. Compare the tables in either direction.
  4. Observe True even though the row counts differ.
  5. Compare an empty Table with the two-row Table and observe True again.

Version and commit evidence:

1.3.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)
70c2114

Relevant log output

shorter_rows=1
longer_rows=2
shorter_equals_longer=True
longer_equals_shorter=True
empty_equals_longer=True

Proposed Solution or Design

After: row counts must match before row values are compared. Equal tables still compare equal.

Affected Area

Workflow Engine (Amber)

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions