frictionlessdata / tableschema-js

A JavaScript library for working with Table Schema.
http://frictionlessdata.io/
MIT License
82 stars 27 forks source link

Question about: Date format 'default' vs 'any' #151

Closed ghost closed 5 years ago

ghost commented 5 years ago

I notice that when using a date, such as '2022-22-22', the 'default' cast accepts this date, as the underlying function parses this to '2023-10-22', whereas 'any' fails the validation. We are considering changing the 'default' date validation on our side in Data Curator to 'any' to support users who would usually expect a date like this to fail validation. I notice that when we infer Schema, the return we get is a date, with 'default' format - is there a reason why this (date->default) was chosen as the usual response for how a date value (rather than date->any) should be inferred? I've read through the frictionless specs again, but I'm not sure where the behaviour for converting months/days is drawn from - I'm guessing there's a reference I'm missing here. Thanks in advance.

roll commented 5 years ago

@mattRedBox TBH, I don't have a clear vision of this date situation. I was always wondering that any is kind against of having an interoperable standard idea. I mean having any means you totally rely on the implementation. E.g. Python can parse some format but Java can't - so our data exchange pipeline is broken. But I'm not a data publisher to fully understand this side of needs.

I suggest syncing with @akariv @anuveyatsu on it. DataCurator and datahub.io are two big eco-systems using the libs. So I think it makes sense to share the experience inferring/working with this date format. And the libs should follow this insight.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.