()
| 2124 | |
| 2125 | |
| 2126 | def test_write_quoting_header(): |
| 2127 | t = pa.Table.from_arrays([[1, 2, None], ["a", None, "c"]], ["c1", "c2"]) |
| 2128 | buf = io.BytesIO() |
| 2129 | for write_options, res in [ |
| 2130 | (WriteOptions(quoting_header='none'), b'c1,c2\n1,"a"\n2,\n,"c"\n'), |
| 2131 | (WriteOptions(), b'"c1","c2"\n1,"a"\n2,\n,"c"\n'), |
| 2132 | (WriteOptions(quoting_header='all_valid'), |
| 2133 | b'"c1","c2"\n1,"a"\n2,\n,"c"\n'), |
| 2134 | ]: |
| 2135 | with CSVWriter(buf, t.schema, write_options=write_options) as writer: |
| 2136 | writer.write_table(t) |
| 2137 | assert buf.getvalue() == res |
| 2138 | buf.seek(0) |
| 2139 | |
| 2140 | |
| 2141 | def test_read_csv_reference_cycle(): |
nothing calls this directly
no test coverage detected