Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bigframes/core/local_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def from_arrow(cls, table: pa.Table) -> LocalTableMetadata:

@dataclasses.dataclass(frozen=True)
class ManagedArrowTable:
data: pa.Table = dataclasses.field(hash=False)
schema: schemata.ArraySchema = dataclasses.field(hash=False)
data: pa.Table = dataclasses.field(hash=False, compare=False)
schema: schemata.ArraySchema = dataclasses.field(hash=False, compare=False)
id: uuid.UUID = dataclasses.field(default_factory=uuid.uuid4)

@functools.cached_property
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/test_local_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,16 @@ def test_local_data_well_formed_round_trip_sliced():
result.reset_index(drop=True),
check_dtype=False,
)


def test_local_data_equal_self():
local_entry = local_data.ManagedArrowTable.from_pandas(pd_data)
assert local_entry == local_entry
assert hash(local_entry) == hash(local_entry)


def test_local_data_not_equal_other():
local_entry = local_data.ManagedArrowTable.from_pandas(pd_data)
local_entry2 = local_data.ManagedArrowTable.from_pandas(pd_data[::2])
assert local_entry != local_entry2
assert hash(local_entry) != hash(local_entry2)