File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -533,6 +533,15 @@ def test_null_values_in_cells() -> None:
533533 pd_assert_frame_equal (sheet .to_pandas (), pd_expected )
534534
535535
536+ def test_invalid_value_num () -> None :
537+ excel_reader = fastexcel .read_excel (path_for_fixture ("fixture-invalid-cell-value-num.xlsx" ))
538+ sheet = excel_reader .load_sheet (0 )
539+
540+ expected = {"Column" : [8.0 , None ]}
541+ pd_assert_frame_equal (sheet .to_pandas (), pd .DataFrame (expected ))
542+ pl_assert_frame_equal (sheet .to_polars (), pl .DataFrame (expected ))
543+
544+
536545def test_null_column_is_nullable () -> None :
537546 sheet = fastexcel .read_excel (path_for_fixture ("null-column.xlsx" )).load_sheet (0 )
538547 assert sheet .to_arrow ().schema .field ("nullonly" ).nullable is True
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ fn get_cell_dtype<DT: CellType + Debug + DataType>(
229229 match cell. get_error ( ) {
230230 // considering cells with #N/A! or #REF! as null
231231 Some (
232- CellErrorType :: NA | CellErrorType :: Value | CellErrorType :: Null | CellErrorType :: Ref ,
232+ CellErrorType :: NA | CellErrorType :: Value | CellErrorType :: Null | CellErrorType :: Ref | CellErrorType :: Num ,
233233 ) => Ok ( DType :: Null ) ,
234234 Some ( err) => Err ( FastExcelErrorKind :: CalamineCellError ( err. to_owned ( ) ) . into ( ) ) ,
235235 None => Err ( FastExcelErrorKind :: Internal ( format ! (
You can’t perform that action at this time.
0 commit comments