Day of week (& other date fields) recast as timestamps
- Dominant language
- Python
- Stars
- 82
- Forks
- 157
- PR merge metrics
- No merged PRs in 30d
Description
Our client is uploading CSV data to CKAN which includes a column containing a day of the week.
Datapusher (via messytables) appears to decide that this is a date column and converts it to a timestamp. "Wednesday" appears to be interpreted as "This Wednesday" and is replaced by a timestamp in the form 2015-06-03T00:00:00 - which is useless to anyone reading the data, and frequently misleading.
Since the messytables code seemed to say that DateType includes format detection, I tried altering the configuration to use that instead of the DateUtilType that Datapusher uses normally, by adding:
``` python
TYPES = [messytables.StringType, messytables.DecimalType, messytables.IntegerType, messytables.DateType, messytables.BoolType]
TYPE_MAPPING = {
'String': 'text',
'Integer': 'numeric',
'Decimal': 'numeric',
'Date': 'timestamp'
}
```
into datapusher_settings.py. But it made no difference.
Is there any way of ensuring that dates get recognised as dates (and don't get given a spurious 00:00:00 timestamp), and days get left as days (strings)?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.