fix(#165): removing potentially ambiguous date format #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
the previous commit failed because it recognized '10/15/1998' as a valid date format, but then tried to interpret it as 'DD/MM/YYYY' which failed because month can't be 15.
In the original issue, I said it should be a permissive as possible, but now I think it should default to null if there's any possiblity for ambiguity, so only support YYYY-MM-DD and default anything else to NULL
This condition still isn't perfect, because there's a possibility for errors when something is formatted like 1234-56-78 but is not a valid date, but Im not sure if there's a better way...if that case every actually happened, it might be necessarry to fix the data rather than trying to address everything in the case statement.
The other option could be to check for valid dates in the case condition...which would get messy, and we would want to move it to a dbt macro.
so this could be a quick fix to the current problem.
We also need to do something similar for patient_f_client (I don't have access to that repo)