-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Properly propagate exceptions in sas.pyx #47149
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
ofs = cnt + 3 | ||
ofs += <uint16_t>inbuff[ipos] << 4 | ||
ipos += 1 | ||
for k in range(cmd): | ||
outbuff[rpos + k] = outbuff[rpos - <int>ofs + k] | ||
rpos += cmd | ||
|
||
else: |
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.
This case is actually impossible and I removed it so that nobody is confused why we aren't testing the raise ValueError
.
pandas/io/sas/sas.pyx
Outdated
@@ -294,7 +291,7 @@ cdef class Parser: | |||
self.parser._current_row_in_chunk_index = self.current_row_in_chunk_index | |||
self.parser._current_row_in_file_index = self.current_row_in_file_index | |||
|
|||
cdef bint read_next_page(self): | |||
cdef read_next_page(self): |
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.
Why was the bint
here removed?
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.
Because otherwise read_next_page
doesn't propagate exceptions. Alternative could be cdef bint read_next_page(self) except *
or cdef bint read_next_page(self) except 1
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 alternatives would be preferred IMO
2a5438f
to
ac4c2f1
Compare
thanks @jonashaag |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.