(self)
| 1053 | } |
| 1054 | |
| 1055 | def test_decimal_point(self): |
| 1056 | # Infer floats with a custom decimal point |
| 1057 | parse_options = ParseOptions(delimiter=';') |
| 1058 | rows = b"a;b\n1.25;2,5\nNA;-3\n-4;NA" |
| 1059 | |
| 1060 | table = self.read_bytes(rows, parse_options=parse_options) |
| 1061 | schema = pa.schema([('a', pa.float64()), |
| 1062 | ('b', pa.string())]) |
| 1063 | assert table.schema == schema |
| 1064 | assert table.to_pydict() == { |
| 1065 | 'a': [1.25, None, -4.0], |
| 1066 | 'b': ["2,5", "-3", "NA"], |
| 1067 | } |
| 1068 | |
| 1069 | convert_options = ConvertOptions(decimal_point=',') |
| 1070 | table = self.read_bytes(rows, parse_options=parse_options, |
| 1071 | convert_options=convert_options) |
| 1072 | schema = pa.schema([('a', pa.string()), |
| 1073 | ('b', pa.float64())]) |
| 1074 | assert table.schema == schema |
| 1075 | assert table.to_pydict() == { |
| 1076 | 'a': ["1.25", "NA", "-4"], |
| 1077 | 'b': [2.5, -3.0, None], |
| 1078 | } |
| 1079 | |
| 1080 | def test_simple_timestamps(self): |
| 1081 | # Infer a timestamp column |
nothing calls this directly
no test coverage detected