Temporarily remove large-database SqlClientData tests.
This removal will be followed-up shortly by a reconfiguration of these to allow selectively skipping the large-database construction.
@@ -29,10 +29,6 @@ def test_dataset_filepath():
return os.path.join(FLAGS.test_tmpdir, 'test.sqlite')
-def large_dataset_filepath():
- return os.path.join(FLAGS.test_tmpdir, 'large_test.sqlite')
-
-
def make_test_example(client_id: str, e: int) -> bytes:
return tf.train.Example(
features=tf.train.Features(
@@ -82,37 +78,6 @@ def setUpModule():
'INSERT INTO client_metadata (client_id, split_name, num_examples) '
'VALUES (?, ?, ?);', (client_id, split_name, count))
- with sqlite3.connect(large_dataset_filepath()) as connection:
- test_setup_queries = [
- """CREATE TABLE examples (
- split_name TEXT NOT NULL,
- client_id TEXT NOT NULL,
- serialized_example_proto BLOB NOT NULL);""",
- """CREATE INDEX idx_client_id_split
- ON examples (split_name, client_id);""",
- """CREATE TABLE client_metadata (
- client_id TEXT NOT NULL,
- split_name TEXT NOT NULL,
- num_examples INTEGER NOT NULL);""",
- """CREATE INDEX idx_metadata_client_id
- ON client_metadata (client_id);""",
- ]
- for q in test_setup_queries:
- connection.execute(q)
- examples_per_client = 10
- for i in range(100_000):
- client_id = 'client_{}'.format(i)
- only_split = 'train'
- for e in range(examples_per_client):
- connection.execute(
- 'INSERT INTO examples '
- '(split_name, client_id, serialized_example_proto) '
- 'VALUES (?, ?, ?);',
- (only_split, client_id, make_test_example(client_id, e)))
- connection.execute(
- 'INSERT INTO client_metadata (client_id, split_name, num_examples) '
- 'VALUES (?, ?, ?);', (client_id, only_split, examples_per_client))
-
class SqlClientDataTest(tf.test.TestCase):
@@ -182,13 +147,6 @@ class SqlClientDataTest(tf.test.TestCase):
with self.subTest('test'):
test_split('test', 1)
- def test_dataset_from_large_number_of_clients(self):
- client_data = sql_client_data.SqlClientData(large_dataset_filepath())
- try:
- client_data.create_tf_dataset_from_all_clients(seed=42)
- except Exception as e: # pylint: disable=broad-except
- self.fail(e)
-
class PreprocessSqlClientDataTest(tf.test.TestCase):
@@ -334,14 +292,6 @@ class PreprocessSqlClientDataTest(tf.test.TestCase):
with self.subTest('test'):
test_split('test', 1)
- def test_dataset_from_large_number_of_clients(self):
- client_data = sql_client_data.SqlClientData(large_dataset_filepath())
- client_data = client_data.preprocess(lambda x: x)
- try:
- client_data.create_tf_dataset_from_all_clients(seed=42)
- except Exception as e: # pylint: disable=broad-except
- self.fail(e)
-
if __name__ == '__main__':
execution_contexts.set_local_execution_context()
