Fix dateformat of timestamp field for the flights.json.gz test dataset #440
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.
Problem:
I recently used the
flights.json.gz
dataset for testing Elasticsearch queries in another project. When indexing the data into Elasticsearch I noticed that thetimestamp
causes some parsing errors. The date format for this field, which is specified intests/__init__.py
, isstrict_date_hour_minute_second
. In the dataset the timestamp is sometimes set to something like this"2018-02-10"
, which leads to parsing errors.I wrote this short bash "script" to search all timestamp fields in the dataset that don't contain the
"T"
separator. It's not that efficient but it proves the point.The output is:
BTW, these "invalid" timestamps only occur in the
flights.json.gz
dataset but not inflights_small.json.gz
.Solution:
In order to support these timestamps I changed the date format to
strict_date_optional_time
.