-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Convert non-dates in xls date cells to number #13042
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
Conversation
pls add some tests |
@@ -329,29 +329,38 @@ def _parse_cell(cell_contents, cell_typ): | |||
appropriate object""" | |||
|
|||
if cell_typ == XL_CELL_DATE: | |||
if xlrd_0_9_3: | |||
# Use the newer xlrd datetime handling. | |||
cell_contents = xldate.xldate_as_datetime(cell_contents, |
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.
rather than a giant try: except: can you narrow down its placement
d4ebfdb
to
515a5fb
Compare
Current coverage is 84.14%@@ master #13042 diff @@
==========================================
Files 137 137
Lines 50214 50220 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 42253 42256 +3
- Misses 7961 7964 +3
Partials 0 0
|
77951ed
to
c3523db
Compare
Prevoiusly failed tests on the lines that now appear as uncovered according to codecov, I'm not getting this. |
if you want to rebase I think I fixed codecov |
Thanks, seems ok now |
can u post a screen shot of what this excel file looks like |
# GH 10001 : pandas.ExcelFile ignore parse_dates=False | ||
expected_value = 100000000000000000000 | ||
act_series = self.get_exceldf('testdateoverflow')['DateColWithBigInt'] | ||
act_value = act_series.iloc[2] |
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.
construct the expected frame and use assert_frame_equal
Same thing with codecov |
you need to rebase on master
you are not picking up the change I made recently. |
2441fcb
to
05683f6
Compare
check now pls |
# GH 10001 : pandas.ExcelFile ignore parse_dates=False | ||
refdf = pd.DataFrame([[pd.Timestamp('2016-03-12'), 'Marc Johnson'], | ||
[pd.Timestamp('2016-03-16'), 'Jack Black'], | ||
[1e+20, 'Timothy Brown']], |
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.
I am think this would be converted as an integer, right? (or is it actually a float)
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.
In the current implementation it is a float (simply cell_contents is returned). Or such way would be more desired ?:
val = int(cell_contents)
if val == cell_contents:
cell_contents = val
closes GH10001 If there is a date column in excel in which there are cells with some big integers, that during parsing to date cause int/long overflow, issue a warning and convert the value to int or float.
thanks @kordek |
git diff upstream/master | flake8 --diff
closes GH10001