Closed zivanfi closed 4 years ago
@zivanfi very good catch!!! Need to be fixed for sure! I can look into it since I'm working with a custom date parser decorator. BTW I released the new version with your PR today!
That's good news, thanks for the release!
I ran into a problem with dataclasses with fields that have default values. I managed to reproduce the issue with a small change in one of the tests: Modify
UserWithDateFormatDecorator
intests/mocks.py
to contain adatetime
with a default value:Executing the test shows the error:
Apparently, dataclass-csv tries to parse the default value as if it were an input string from the CSV, although in reality it is already a
datetime
(and can't be changed to astr
either).