Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

English ordinals are converted to datetime #9

Open
fmeyer opened this issue Jul 31, 2017 · 2 comments
Open

English ordinals are converted to datetime #9

fmeyer opened this issue Jul 31, 2017 · 2 comments

Comments

@fmeyer
Copy link

fmeyer commented Jul 31, 2017

When dealing with regular english ordinal numbers, the library converts then to datetime.
ex:

list(strconv.convert_series(["20th", "street", "2015-01-01"]))

becomes:
[datetime.datetime(2017, 7, 20, 0, 0), 'street', datetime.datetime(2015, 1, 1, 0, 0)]

This is caused because duparse takes the ordinal as a literal date when the previous types aren't satisfied. Since unregistering the datetime converter affects the other fields on the series, the only solution I found is to define a new ordinal type.

So the question to discuss is if the default fallback value should be datetime because the same issue happens when the string contains a ratio like 2/3

@bruth
Copy link
Owner

bruth commented Aug 2, 2017

Good observation. Since dateutil (duparse) will try to infer what it can, so there are likely a bunch of other edge cases that could be hit. This may need to be a parameter as to whether date parsing through be fuzzy or strict (i.e. one of the predefined date formats).

@bruth
Copy link
Owner

bruth commented Sep 6, 2017

@fmeyer Have anymore thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants