ToucanToco / fastexcel

A Python wrapper around calamine
http://fastexcel.toucantoco.dev/
MIT License
120 stars 6 forks source link

Let `dtypes` take single value that applies to all columns AND/OR cast DateTime to String instead of raising UnsupportedColumnTypeCombinationError #256

Closed deanm0000 closed 4 months ago

deanm0000 commented 4 months ago

Sometimes I'll have a file that has some rows of disclaimers and other stuff to be skipped, followed by dates. When I try to read in the file I'll get an UnsupportedColumnTypeCombinationError: unsupported column type combination: {DateTime, String} but since I can't open the file, I don't know what the columns are to use dtypes. I can work around this by doing

column_names = [str(x) for x in range(10)]
dtypes={
               str(x):'string' for x in range(10)
           }

but it only works if the problematic column is in the first 10, not to mention it's annoying and overly verbose.

It'd be nice if we could just do dtypes='string' and then all the columns would just be a string.

PrettyWood commented 4 months ago

This should be resolved in v0.11.0 that just got released. Can you try again?

deanm0000 commented 4 months ago

@PrettyWood

yup good to go, thanks