xrmx opened a new issue #4637: csv import "parse dates" should be more flexible
URL: https://github.com/apache/incubator-superset/issues/4637
 
 
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if any
   - [x] I have reproduced the issue with at least the latest released version 
of superset
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar
   
   
   ### Superset version
   
   latest master 97afcd5809269e885a0dde349081802a427c5674
   
   ### Expected results
   
   Dates should be imported as dates
   
   ### Actual results
   
   Dates are imported as text
   
   ### Steps to reproduce
   
   With actual code parse_dates is a boolean and if true it tries to parse the 
index:
   
   >>> s = StringIO("ciao\n21-1-2017\n")
   >>> df = pd.read_csv(s, parse_dates=True, infer_datetime_format=True)
   >>> df.dtypes
   ciao    object
   dtype: object
   
   But if i pass the column index or name it works fine: 
   
   >>> s = StringIO("ciao\n21-1-2017\n")
   >>> df = pd.read_csv(s, parse_dates=['ciao'], infer_datetime_format=True)
   >>> df.dtypes
   ciao    datetime64[ns]
   dtype: object
   
   So i think parse_dates should not be a boolean field but a text field that 
gets converted to a list of string

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to