()
| 2054 | |
| 2055 | |
| 2056 | def test_write_quoting_header(): |
| 2057 | t = pa.Table.from_arrays([[1, 2, None], ["a", None, "c"]], ["c1", "c2"]) |
| 2058 | buf = io.BytesIO() |
| 2059 | for write_options, res in [ |
| 2060 | (WriteOptions(quoting_header='none'), b'c1,c2\n1,"a"\n2,\n,"c"\n'), |
| 2061 | (WriteOptions(), b'"c1","c2"\n1,"a"\n2,\n,"c"\n'), |
| 2062 | (WriteOptions(quoting_header='all_valid'), |
| 2063 | b'"c1","c2"\n1,"a"\n2,\n,"c"\n'), |
| 2064 | ]: |
| 2065 | with CSVWriter(buf, t.schema, write_options=write_options) as writer: |
| 2066 | writer.write_table(t) |
| 2067 | assert buf.getvalue() == res |
| 2068 | buf.seek(0) |
| 2069 | |
| 2070 | |
| 2071 | def test_read_csv_reference_cycle(): |
nothing calls this directly
no test coverage detected