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

fix(datasets:skip) Update tests for multiple partitioners #3830

Merged
merged 3 commits into from
Jul 18, 2024
Merged
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
8 changes: 4 additions & 4 deletions datasets/flwr_datasets/federated_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def test_multiple_partitioners(self) -> None:
dataset_test_partition0 = dataset_fds.load_partition(0, self.test_split)

dataset = datasets.load_dataset(self.dataset_name)
self.assertEqual(
len(dataset_test_partition0),
len(dataset[self.test_split]) // num_test_partitions,
)
expected_len = len(dataset[self.test_split]) // num_test_partitions
mod = len(dataset[self.test_split]) % num_test_partitions
expected_len += 1 if 0 < mod else 0
self.assertEqual(len(dataset_test_partition0), expected_len)

def test_no_need_for_split_keyword_if_one_partitioner(self) -> None:
"""Test if partitions got with and without split args are the same."""
Expand Down