(self)
| 1030 | } |
| 1031 | |
| 1032 | def test_simple_nulls(self): |
| 1033 | # Infer various kinds of data, with nulls |
| 1034 | rows = (b"a,b,c,d,e,f\n" |
| 1035 | b"1,2,,,3,N/A\n" |
| 1036 | b"nan,-5,foo,,nan,TRUE\n" |
| 1037 | b"4.5,#N/A,nan,,\xff,false\n") |
| 1038 | table = self.read_bytes(rows) |
| 1039 | schema = pa.schema([('a', pa.float64()), |
| 1040 | ('b', pa.int64()), |
| 1041 | ('c', pa.string()), |
| 1042 | ('d', pa.null()), |
| 1043 | ('e', pa.binary()), |
| 1044 | ('f', pa.bool_())]) |
| 1045 | assert table.schema == schema |
| 1046 | assert table.to_pydict() == { |
| 1047 | 'a': [1.0, None, 4.5], |
| 1048 | 'b': [2, -5, None], |
| 1049 | 'c': ["", "foo", "nan"], |
| 1050 | 'd': [None, None, None], |
| 1051 | 'e': [b"3", b"nan", b"\xff"], |
| 1052 | 'f': [None, True, False], |
| 1053 | } |
| 1054 | |
| 1055 | def test_decimal_point(self): |
| 1056 | # Infer floats with a custom decimal point |
nothing calls this directly
no test coverage detected