-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[get_df] Fix datetime conversion #5274
Conversation
0c0287c
to
40b501e
Compare
dcdf3f5
to
6342c31
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
6342c31
to
37b8a9b
Compare
37b8a9b
to
9527872
Compare
if df is None or df.empty: | ||
return pd.DataFrame() | ||
else: | ||
if not df.empty: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
lgtm |
1 similar comment
lgtm |
(cherry picked from commit 117507c)
(cherry picked from commit 117507c)
(cherry picked from commit 117507c)
(cherry picked from commit 117507c)
(cherry picked from commit 117507c)
(cherry picked from commit 117507c)
(cherry picked from commit 117507c)
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