apache / arrow-nanoarrow

Helpers for Arrow C Data & Arrow C Stream interfaces
https://arrow.apache.org/nanoarrow
Apache License 2.0
149 stars 34 forks source link

refactor(python): Split type identifier utilities into thier own module #545

Closed paleolimbot closed 6 days ago

paleolimbot commented 6 days ago

This is another chapter in the saga to split up _lib.pyx to make it easier to find the piece of code one is looking for. Another advantage of this is that VSCode's Cython plugin does a much better job when cimports are explicit: for something like from nanoarrow_c cimport *, this means that every use of a nanoarrow symbol (including NANOARROW_TYPE_XXX) would get a yellow squiggly underline (which normally highlight things that should be fixed). The setup here enables both Python and Cython modules to use _types.UINT8. In Cython this compiles into a C symbol reference (i.e., not an attribute lookup, which might be slow).

paleolimbot commented 6 days ago

Thanks!