Since augur curate format-dates produces masked dates (e.g. 1997-XX-XX), if you pass outputs through the command again, it will error on the masked dates.
echo '{"date": "1997"}' \
| augur curate format-dates \
--date-fields date \
--expected-date-formats '%Y' \
| augur curate format-dates \
--date-fields date \
--expected-date-formats '%Y-%m-%d'
ERROR: Unable to format date string '1997-XX-XX' in field 'date' of record 0.
It is currently able to work around this issue by explicitly passing the %Y-XX-XX format to the command
Requiring users to pass the masked formats to get around this seems like an extra load on the user, especially considering they would have to account for all masked formats (i.e. XXXX-XX-XX, %Y-XX-XX, %Y-%m-XX).
The command should just be able to recognize this format internally and pass through the date unchanged if it's already masked.
Context
Originally brought up by @emmahodcroft on Slack.
Since
augur curate format-dates
produces masked dates (e.g. 1997-XX-XX), if you pass outputs through the command again, it will error on the masked dates.It is currently able to work around this issue by explicitly passing the
%Y-XX-XX
format to the commandDescription
Requiring users to pass the masked formats to get around this seems like an extra load on the user, especially considering they would have to account for all masked formats (i.e.
XXXX-XX-XX
,%Y-XX-XX
,%Y-%m-XX
).The command should just be able to recognize this format internally and pass through the date unchanged if it's already masked.