You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/12 03:14:59 UTC

[GitHub] [arrow] pi-guy-in-the-sky opened a new issue #10923: Use Python to access an `arrow::Table` created in C++

pi-guy-in-the-sky opened a new issue #10923:
URL: https://github.com/apache/arrow/issues/10923


   Hello, apologies in advance for the specific question.
   
   A brief overview: I have some C++ code which creates an `arrow::Table`. I want to access this table in Python. I've been attempting to do so using Boost.Python, but it segfaults when I actually try to access the data.
   
   I've included a minimum reproducible example using Docker in [this gist](https://gist.github.com/pi-guy-in-the-sky/eb7793445c50257d105167828466d529). It builds and installs a shared library named `hello`. Python has no problem `import`ing the library, calling `hello.create_table()`, and even correctly getting the shape of the resulting table, but when I try to do anything with the table e.g. `table.to_string()`, it segfaults. I included the stack trace from Valgrind in the gist.
   
   Am I even approaching this from the right direction? I don't have any experience with Cython but if all else fails I'd be willing to learn it to get the project to work. Any directions would be much appreciated.
   
   Thanks in advance for your time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] pi-guy-in-the-sky commented on issue #10923: Use Python to access an `arrow::Table` created in C++

Posted by GitBox <gi...@apache.org>.
pi-guy-in-the-sky commented on issue #10923:
URL: https://github.com/apache/arrow/issues/10923#issuecomment-897917549


   Thank you so much! You were right, it was a problem with two different pyarrow versions. I tried to follow the instructions earlier but didn't realize that the `python3 setup.py build_ext --inplace` required `$ARROW_HOME` to be properly set. After I set it to `/usr/local` and fixed the installation details, everything works fine. I have an updated gist [here](https://gist.github.com/pi-guy-in-the-sky/b3d3501b4a14b8d5c44f76f7338c96a3) in case anybody finds this in the future.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] emkornfield commented on issue #10923: Use Python to access an `arrow::Table` created in C++

Posted by GitBox <gi...@apache.org>.
emkornfield commented on issue #10923:
URL: https://github.com/apache/arrow/issues/10923#issuecomment-897369010


   Its not clear from the gist, but is it possible you might have two different version of arrow libraries you are linking against (pyarrow's and normal C++ arrow)?  Did you follow [the instructions](https://arrow.apache.org/docs/python/extending.html#c-api) for only using the pyarrow C++ library?  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] pi-guy-in-the-sky closed issue #10923: Use Python to access an `arrow::Table` created in C++

Posted by GitBox <gi...@apache.org>.
pi-guy-in-the-sky closed issue #10923:
URL: https://github.com/apache/arrow/issues/10923


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org