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/11 15:13:31 UTC

[GitHub] [arrow-datafusion] kszucs commented on pull request #856: Rework the python bindings

kszucs commented on pull request #856:
URL: https://github.com/apache/arrow-datafusion/pull/856#issuecomment-896912735


   > My only concern is the addition of the `Py` prefix in a lot of public stuff. Doesn't this cause all public APIs in Python to be prepended by `Py` also? IMO there should not be any prefix.
   
   Right, the intent there is to expose the rust python objects under `datafusion.internals` (this is the current setup, though we can use any other submodule like `datafusion._lib`) and expose them under `datafusion` as aliases without the `Py` prefix. This provides us an additional python layer on top of the rust bindings where we can add pure python related functionality more easily, like:
   
   ```
   from datafusion import internals
   
   class DataFrame(internals.PyDataFrame):
       # additional functionality 
   ```
   
   One additional advantage of using the `Py` prefix in the rust code is that it clearly indicates which rust types are actually python extension types.
   
   Note that this is a common approach for python bindings, see [py-polars](https://github.com/pola-rs/polars/tree/master/py-polars/polars) for example.
   


-- 
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