Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv import "parse dates" should be more flexible #4637

Closed
3 tasks done
xrmx opened this issue Mar 17, 2018 · 0 comments · Fixed by #4639
Closed
3 tasks done

csv import "parse dates" should be more flexible #4637

xrmx opened this issue Mar 17, 2018 · 0 comments · Fixed by #4639

Comments

@xrmx
Copy link
Contributor

xrmx commented Mar 17, 2018

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

latest master 97afcd5

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

xrmx added a commit to xrmx/superset that referenced this issue Mar 23, 2018
Instead of a boolean which has way less chances to work. While
at it add a proper label for the "con" field.

Fixes apache#4637
graceguo-supercat pushed a commit that referenced this issue Mar 23, 2018
Instead of a boolean which has way less chances to work. While
at it add a proper label for the "con" field.

Fixes #4637
michellethomas pushed a commit to michellethomas/panoramix that referenced this issue May 24, 2018
…4639)

Instead of a boolean which has way less chances to work. While
at it add a proper label for the "con" field.

Fixes apache#4637
wenchma pushed a commit to wenchma/incubator-superset that referenced this issue Nov 16, 2018
…4639)

Instead of a boolean which has way less chances to work. While
at it add a proper label for the "con" field.

Fixes apache#4637
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant