MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_scientific_notation_with_inference

Function test_scientific_notation_with_inference

arrow-csv/src/reader/mod.rs:1857–1875  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 10

defaultFunction · 0.85
infer_schemaMethod · 0.80
with_formatMethod · 0.80
with_delimiterMethod · 0.45
with_headerMethod · 0.45
with_projectionMethod · 0.45
with_batch_sizeMethod · 0.45
buildMethod · 0.45
nextMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected