()
| 2157 | |
| 2158 | |
| 2159 | def test_write_null_string(): |
| 2160 | t = pa.Table.from_arrays([[1, 2, None], ["a", None, "c"]], ["c1", "c2"]) |
| 2161 | buf = io.BytesIO() |
| 2162 | for write_options, res in [ |
| 2163 | (WriteOptions(), b'"c1","c2"\n1,"a"\n2,\n,"c"\n'), |
| 2164 | (WriteOptions(null_string=''), b'"c1","c2"\n1,"a"\n2,\n,"c"\n'), |
| 2165 | (WriteOptions(null_string='NA'), |
| 2166 | b'"c1","c2"\n1,"a"\n2,NA\nNA,"c"\n'), |
| 2167 | (WriteOptions(null_string='N/A'), |
| 2168 | b'"c1","c2"\n1,"a"\n2,N/A\nN/A,"c"\n'), |
| 2169 | ]: |
| 2170 | with CSVWriter(buf, t.schema, write_options=write_options) as writer: |
| 2171 | writer.write_table(t) |
| 2172 | assert buf.getvalue() == res |
| 2173 | buf.seek(0) |
| 2174 | buf.truncate() |
| 2175 | |
| 2176 | |
| 2177 | def test_read_csv_reference_cycle(): |
nothing calls this directly
no test coverage detected