()
| 1855 | |
| 1856 | #[test] |
| 1857 | fn test_scientific_notation_with_inference() { |
| 1858 | let mut file = File::open("test/data/scientific_notation_test.csv").unwrap(); |
| 1859 | let format = Format::default().with_header(false).with_delimiter(b','); |
| 1860 | |
| 1861 | let (schema, _) = format.infer_schema(&mut file, None).unwrap(); |
| 1862 | file.rewind().unwrap(); |
| 1863 | |
| 1864 | let builder = ReaderBuilder::new(Arc::new(schema)) |
| 1865 | .with_format(format) |
| 1866 | .with_batch_size(512) |
| 1867 | .with_projection(vec![0, 1]); |
| 1868 | |
| 1869 | let mut csv = builder.build(file).unwrap(); |
| 1870 | let batch = csv.next().unwrap().unwrap(); |
| 1871 | |
| 1872 | let schema = batch.schema(); |
| 1873 | |
| 1874 | assert_eq!(&DataType::Float64, schema.field(0).data_type()); |
| 1875 | } |
| 1876 | |
| 1877 | fn invalid_csv_helper(file_name: &str) -> String { |
| 1878 | let file = File::open(file_name).unwrap(); |
nothing calls this directly
no test coverage detected