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

mapvizieR function parsing some dates incorrectly #321

Open
chrishaid opened this issue May 17, 2017 · 2 comments
Open

mapvizieR function parsing some dates incorrectly #321

chrishaid opened this issue May 17, 2017 · 2 comments
Assignees
Labels

Comments

@chrishaid
Copy link
Collaborator

chrishaid commented May 17, 2017

I've got dates such 01/12/2017 (January 12th, 2017) getting parsed as 2017-12-01 (Dec 1st, 2017). But most dates are fine. Our dates come in as text fields and are unadultered from how NWEA puts them in the CDF

This bit of code (i.e., the munge_startdate() function) is the culprit. From the docs:

When several format-orders are specified parse_date_time sorts the supplied format-orders based on a training set and then applies them recursively on the input vector.

I get s sense it's guessing wrong on the those ambiguous dates. Like, what is this so called "training set"?

Possible remedy we sample the teststartdate column, infer the format for each sampled date, then set the date order fromat (ymd, mdy, etc) to be used by the parser explicitly by taking the most common format in the sample?

Thoughts @almartin82?

@chrishaid chrishaid added the bug label May 17, 2017
@chrishaid chrishaid self-assigned this May 17, 2017
@almartin82
Copy link
Owner

almartin82 commented May 17, 2017 via email

@chrishaid
Copy link
Collaborator Author

It's consistent across CDFs. My guess is that when you pull data down from your DB and you stored it as a date in your DB, then you are getting ymd back. Which makes sense.

Literally the problem was with two ambiguous dates out of hundreds.

so in my case, say you sample 20 dates. All 20 will mdy, but 19 might be parsed that way, with one ambigous date (12/01/2017) getting parsed as dmy. But a vote of the sample 19-1 for mdy would then set the parser to explicitely used the mdy ordering for every instance.

Does that makes sense?

@almartin82 almartin82 changed the title mapvizieR function parsing some dates in correctly mapvizieR function parsing some dates incorrectly Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants