-
Notifications
You must be signed in to change notification settings - Fork 85
Fetching DF segfaults when outputtypehandler is present #486
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
Comments
Thanks for the report. We can replicate it. One item on our task list is to look at type handling etc. Were you wanting something similar, or does your code base have the handler/converter in place for non-dataframe queries? |
I do have already a handler in place for non-df, I hit this when porting existing code to df fetching. (I like that issue you linked! 😉 ) |
This patch can be used to avoid the segfault. More effort is needed to get to the true source of the issue, but this is will "work" for you. The other workaround is to simply not specify an output type handler -- since it won't do you any good anyway! diff --git a/src/oracledb/impl/base/cursor.pyx b/src/oracledb/impl/base/cursor.pyx
index 3a78fa40..0815be2b 100644
--- a/src/oracledb/impl/base/cursor.pyx
+++ b/src/oracledb/impl/base/cursor.pyx
@@ -306,6 +306,8 @@ cdef class BaseCursorImpl:
cdef:
BaseConnImpl conn_impl
object type_handler
+ if self.fetching_arrow:
+ return None
if self.outputtypehandler is not None:
type_handler = self.outputtypehandler
else:
|
type handler while fetching data frames (#486).
I have pushed a patch that corrects this issue and have initated a build from which you can download pre-built development wheels once it completes. You can also build from source if you prefer. If you can test your scenario and confirm the patch works as expected, that would be appreciated! |
Thanks @anthony-tuininga , will test as soon as it's out! |
@anthony-tuininga just to be explicit, the fix is supposed to prevent the crash OR obey the outputtypehandler specified? |
It prevents the crash. It does not obey the output type handler -- doing so would incur significant overhead in a number of cases and in others there may not be an appropriate data type. The data types for Arrow do not match Oracle database types. |
Makes sense, thanks! Also likely faster to do it in Arrow anyway Will this be documented or at least print a warning? |
@cjbj will take a look at the documentation and see if something needs to be changed there. Thanks! |
The general plan is add some kind of support. Suggestions about what it looks like & behaves are welcome. |
type handler while fetching data frames (#486).
This was included in python-oracledb 3.1.1 which was just released. |
Uh oh!
There was an error while loading. Please reload this page.
What versions are you using?
3.1.0, repro in python 3.9 and 3.12, issue is on client side I think, DB version is irrelevant
Is it an error or a hang or a crash?
Hard crash, segfault
What error(s) or behavior you are seeing?
Segmentation fault
Does your application call init_oracle_client()?
Reproduces both in thin and thick mode
Include a runnable Python script that shows the problem.
The text was updated successfully, but these errors were encountered: