(num_blocks: int, temp_database: str)
| 150 | |
| 151 | @pytest.mark.parametrize("num_blocks", (1, 20)) |
| 152 | def test_write_sql_many_rows(num_blocks: int, temp_database: str): |
| 153 | connection = sqlite3.connect(temp_database) |
| 154 | connection.cursor().execute("CREATE TABLE test(id)") |
| 155 | dataset = ray.data.range(1000).repartition(num_blocks) |
| 156 | |
| 157 | dataset.write_sql( |
| 158 | "INSERT INTO test VALUES(?)", lambda: sqlite3.connect(temp_database) |
| 159 | ) |
| 160 | |
| 161 | result = connection.cursor().execute("SELECT * FROM test ORDER BY id") |
| 162 | assert result.fetchall() == [(i,) for i in range(1000)] |
| 163 | |
| 164 | |
| 165 | def test_write_sql_nonexistant_table(temp_database: str): |
nothing calls this directly
no test coverage detected
searching dependent graphs…