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

[get_df] Fix datetime conversion #5274

Merged
merged 1 commit into from
Jun 27, 2018

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jun 23, 2018

This PR fixes an issue where epoch time columns which have already been converted to a timestamp (of type string) in the query are trying to be coerced in Pandas as a timestamp under the assumption that these values are still in the epoch format. Given these are already timestamps one merely needs to cast them to a pandas.Timestamp object.

to: @graceguo-supercat @michellethomas @mistercrunch @timifasubaa

@john-bodley john-bodley changed the title [get_df] Fix datetime conversion [wip][get_df] Fix datetime conversion Jun 23, 2018
@john-bodley john-bodley changed the title [wip][get_df] Fix datetime conversion [get_df] Fix datetime conversion Jun 25, 2018
@john-bodley john-bodley force-pushed the john-bodley-fix-dttm-issue branch 3 times, most recently from dcdf3f5 to 6342c31 Compare June 26, 2018 01:05
@codecov-io
Copy link

codecov-io commented Jun 26, 2018

Codecov Report

Merging #5274 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5274      +/-   ##
=========================================
- Coverage    61.3%   61.3%   -0.01%     
=========================================
  Files         368     368              
  Lines       23453   23452       -1     
  Branches     2713    2713              
=========================================
- Hits        14378   14377       -1     
  Misses       9063    9063              
  Partials       12      12
Impacted Files Coverage Δ
superset/viz.py 81.38% <100%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0eee12...9527872. Read the comment docs.

if df is None or df.empty:
return pd.DataFrame()
else:
if not df.empty:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed the check for df is None does that mean df won't be None? Will we still be passing an empty data frame if there's no data?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check was only there because we were mocking the pandas.DataFrame. The data is obtained from pandas.read_sql_query which returns a pandas.DataFrame object.

@michellethomas
Copy link
Contributor

lgtm

1 similar comment
@mistercrunch
Copy link
Member

lgtm

@john-bodley john-bodley merged commit 117507c into apache:master Jun 27, 2018
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this pull request Jun 27, 2018
timifasubaa pushed a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 27, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Jul 31, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 4, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 4, 2018
mistercrunch pushed a commit that referenced this pull request Aug 12, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🍒 0.27.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🍒 0.27.0 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants